Skip to content

irunonironic/cli-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLI Tool

A versatile Node.js command-line tool built with Commander, fs, and Chalk. It performs multiple file-based operations:

  • count-words <file> — counts words
  • count-lines <file> — counts lines
  • summary <file> — displays line, word, and sentence counts
  • search <word> <file> — searches for a word (supporting --ignore-case)
  • stat <file> — shows file type, size, creation & modification timestamps

⚙️ Installation

git clone https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git
cd YOUR_REPO_NAME
npm install

Usage

# Run locally
node index.js <command>

# If installed globally
cli <command>

Examples:

node index.js count-words notes.txt
node index.js count-lines notes.txt
node index.js summary notes.txt
node index.js search --ignore-case hello notes.txt
node index.js stat notes.txt

✅ Notes

  • Use --debug or --verbose flags for detailed output
  • You can install globally with npm install -g . for direct cli command access

💡 Next Steps

  • Expand with new commands (append, replace, head, tail, etc.)
  • Add richer error handling and user prompts
  • Consider adding unit tests and publishing to npm

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors