Skip to content

Learn how to build beautiful Node.js CLIs - interactive examples with Chalk, Figlet, Inquirer, and Ora.

License

Notifications You must be signed in to change notification settings

gomzkov/my-node-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

my-node-cli

my-node-cli

Learn how to build beautiful Node.js CLIs

license node version

ExamplesInstallationLibrariesBlog Post


A hands-on example project demonstrating how to create interactive command-line interfaces with Node.js. Companion repo for the Medium article Building a CLI with Node.js in 2024.

CLI Demo

Examples

This project includes interactive examples for popular CLI libraries:

Example Library What it demonstrates
Basic Example Node.js Simple console output
Chalk Example chalk Colored terminal output
Figlet Example figlet ASCII art text banners
Inquirer Example inquirer Interactive text prompts
Inquirer Confirm inquirer Yes/no confirmation prompts
Inquirer List inquirer Selection list prompts
Ora Example ora Terminal spinners

Installation

# Clone the repository
git clone https://github.com/gomzkov/my-node-cli.git

# Navigate to project
cd my-node-cli

# Install dependencies
npm install

# Link globally (optional)
npm link

Usage

Run the CLI to see all examples:

# If linked globally
my-node-cli

# Or run directly
npm start

Select an example from the interactive menu to see it in action.

Libraries

This project demonstrates these essential CLI libraries:

  • Commander — CLI framework with commands and options
  • Chalk — Terminal string styling
  • Figlet — ASCII art text generation
  • Inquirer — Interactive command line prompts
  • Ora — Elegant terminal spinners

Project Structure

my-node-cli/
├── bin/
│   └── index.js          # CLI entry point
├── src/
│   └── commands/         # Example implementations
│       ├── basic-example.js
│       ├── chalk-example.js
│       ├── figlet-example.js
│       ├── inquirer-example.js
│       ├── inquirer-confirm-example.js
│       ├── inquirer-list-example.js
│       └── ora-example.js
├── package.json
└── README.md

Learn More

Read the full tutorial on Medium: Building a CLI with Node.js in 2024

License

MIT

About

Learn how to build beautiful Node.js CLIs - interactive examples with Chalk, Figlet, Inquirer, and Ora.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •