Termivore
Feed your hunger for beautiful CLI interfaces with Termivore
What is Termivore?
Termivore is a Node.js package for creating beautiful and responsive command line interfaces. With spinner animations, progress bars, table printing, and more, Termivore provides developers with powerful and flexible tools to create custom terminal interfaces. It also includes utilities for handling user input, validating arguments, and parsing options. Whether you're building a CLI tool, a server-side application, or a DevOps automation script, Termivore can help you streamline your development process and create high-quality terminal interfaces with ease.
Table of Contents
Features
🚀 CLI Command Creation: users can easily create and customize their own CLI commands with arguments/options and actions.🎡 Spinner: display an animated spinner to indicate loading📝 Logger: log messages to the console with customizable colors and styles🕹️ Prompt: prompt the user for input with customizable options and validation🔗 Open Link: Open's the url passed to it in the user's default browser.📊 Progress Bar (SOON): display a progress bar with percentage and ETA📜 Table (SOON): print data in a tabular format with support for pagination, sorting, and filtering🎚️ Slider (SOON): allow the user to input a value using a slider with customizable range and step🧐 Argument Parsing (SOON): parse command line arguments with support for options, flags, and values🤖 Auto-suggestion (SOON): provide auto-suggestion for command line input using fuzzy search🤝 Interactive (SOON): provide interactive command line interfaces with support for mouse events and key bindings
Installation
Full Getting Started Guide Here
You can import the features of Termivore as and when you need them, but if you're creating a new CLI, not just integrating some of our features into an existing CLI, it's recommended you use the Termivore CLI (see below).
Termivore CLI
A quick and easy way to get your CLI started is to use Termivore's CLI (It wouldn't be a CLI package without it's own CLI right?)
First of all you'll want to install termivore globally:
npm i -g termivore
Now you can run termivore help
if you want to see more details about the available commands, but to get started you'll just need to do:
termivore create
Just follow the instructions, termivore will do the rest for you!
If you don't want to go through all the questions, you can pass various arguments and options:
create <project-name> <root-command> --language --no-help --no-version --linting-preference --no-git
Argument/Option | Description |
---|---|
<project-name> |
The name of the project and directory to create |
<root-command> |
The root command of your cli, e.g. Termivore's root command is 'termivore' |
--language |
The language of your project, must be either 'TypeScript' or 'JavaScript' (alternatively, use: -l or --lang ) |
--no-help |
Use this flag if you don want a help command to be created (alternatively, use: -nh ) |
--no-version |
Use this flag if you don't want a -v flag to show your CLIs version (alternatively, use: -nv ) |
--linting-preference |
Specify your linting preference, 'both', 'eslint', 'prettier', 'none' (alternatively, use: -lp or --lint ) |
--no-git |
Use this flag if you don't want to init this project as a git repository (alternatively, use: -ng ) |
Manual Installation
If you're creating a new CLI from scratch, it's recommended to use the Termivore CLI.
However, if you're using termivore for the features in an existing CLI then you can do the following:
npm i termivore
You will now be able to import the methods/classes needed.
import { log } from 'termivore';
log('Example of a bold log!').bold().print();
import { Spinner } from 'termivore';
const mySpinner = new Spinner();
// Perform async task here...
mySpinner.start();
See usage form more details.
FAQ
Nothing here yet, if you have a question you want answering, please raise an issue on the GitHub repository, using the Question template.
Contributors
License
Termivore is distributed under the Apache License, Version 2.0, which allows for the use, modification, and distribution of the software under certain conditions.
Please note that this is not a comprehensive list of the terms and conditions of the Apache License, Version 2.0. For the full text of Termivore's license agreement, please see the link provided above.