Skip to content

adithya-naik/cmd-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

44 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Ÿ cmd-tracker

A developer tool that auto-captures, categorizes and saves terminal commands per project for easy revision

npm version npm downloads npm total downloads GitHub stars GitHub issues License: MIT Node.js


🎯 What is cmd-tracker?

cmd-tracker is an npm package that automatically captures, categorizes and saves every terminal command you type in a project.

Perfect for:

  • πŸŽ“ Students learning Linux, Git, Docker, Angular etc.
  • πŸ‘¨β€πŸ’» Developers who want to track commands used in a project
  • πŸ“ Anyone who wants to revise terminal commands they've used

How it works

You work normally in terminal
         ↓
Commands auto-captured in background
         ↓
Saved to .tracker/commands.json in your project
         ↓
Run tracker list β†’ see entire command history

πŸ“¦ Installation

Install in your learning/project repo:

npm install @adithya-naik/cmd-tracker

πŸš€ Quick Start

Step 1 β€” Initialize in your repo:

npx tracker init

Step 2 β€” Enable automatic capture:

npx tracker hook
source ~/.bashrc                # bash
source ~/.zshrc                 # zsh (Mac)
source ~/.config/fish/config.fish  # fish

Step 3 β€” Work normally! Then revise:

npx tracker list

That's it! Every command you type is now saved automatically πŸͺ„


πŸ“‹ All Commands

Command Description
tracker init Initialize tracker in your project
tracker hook Enable automatic command capture
tracker unhook Disable automatic command capture
tracker list Show all saved commands
tracker list <category> Filter by category
tracker search <query> Search through commands
tracker stats Show statistics by category
tracker favorite <cmd> Toggle command as favorite
tracker favorites Show all favorites
tracker export Export as JSON
tracker export --csv Export as CSV (opens in Excel)
tracker clear Clear all commands
tracker clear <category> Clear specific category

πŸ—‚οΈ Categories

Commands are automatically categorized into:

Category Commands
πŸ”€ git git status, git push, git commit...
πŸ“¦ npm npm install, npx, npm run...
🐳 docker docker ps, docker build...
🐧 linux ls, cd, mkdir, chmod...
🟒 node node, nodemon...
πŸ”΄ angular ng new, ng serve, ng generate...
🐍 python python, pip install...
πŸ”· go go build, go run, go get...
β˜• java java, javac, mvn, gradle...
πŸ¦€ rust cargo build, cargo run, rustc...
πŸ”· dotnet dotnet run, dotnet build...
☸️ kubernetes kubectl get pods, helm install...
πŸ—„οΈ database mysql, psql, mongosh, redis-cli...
☁️ cloud aws s3 ls, gcloud, az login...
πŸ“₯ packageManagers yarn, pnpm, brew, snap...
πŸ§ͺ testing jest, vitest, playwright, cypress...
πŸ€– ai claude, gemini, opencode, aider...
πŸ“Œ others everything else

πŸ’‘ Usage Examples

Filter by category:

tracker list git      # see all git commands
tracker list linux    # see all linux commands
tracker list npm      # see all npm commands

Search commands:

tracker search "install"   # find all install commands
tracker search "git"       # find all git related commands

Save favorites for quick revision:

tracker favorite "git rebase -i HEAD~3"
tracker favorites   # see all starred commands

Export for sharing/backup:

tracker export          # creates tracker-export.json
tracker export --csv    # creates tracker-export.csv (opens in Excel!)

πŸ“ Project Structure

After running tracker init, a .tracker folder is created:

your-project/
β”œβ”€β”€ .tracker/
β”‚   └── commands.json   ← your personal command history
β”œβ”€β”€ your-files...
└── package.json

βœ… .tracker/ is automatically added to .gitignore Your command history stays local β€” never pushed to GitHub


πŸ–₯️ Platform Support

Platform Support
Mac (zsh) βœ… Full support
Linux (bash) βœ… Full support
Windows (Git Bash) βœ… Supported
Windows (PowerShell) ⚠️ Manual save only
Fish βœ… Full support

Windows CMD/PowerShell users: use tracker save "command" manually or use Git Bash / WSL for automatic capture


🐟 Fish Shell Support

Install Fish Shell

Mac:

brew install fish

Ubuntu/Debian:

sudo apt install fish

Fedora:

sudo dnf install fish

Windows (WSL):

sudo apt install fish

Setup tracker in Fish

npx tracker init
npx tracker hook
source ~/.config/fish/config.fish

That's it! Every command you type in fish will now be saved automatically! πŸŽ‰


🀝 Contributing

Contributions are welcome! Feel free to:

  • Open an issue for bugs or feature requests
  • Submit a pull request

πŸ“„ License

MIT Β© Jatoth Adithya Naik


⭐ Star this repo if you find it useful!

GitHub β€’ npm β€’ Issues