@adithya-naik/cmd-tracker
v1.0.5
Published
π A developer tool that auto-captures, categorizes and saves terminal commands per project for easy revision
Downloads
208
Maintainers
Readme
π cmd-tracker
A developer tool that auto-captures, categorizes and saves terminal commands per project for easy revision
π― 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 initStep 2 β Enable automatic capture:
npx tracker hook
source ~/.bashrc # bash
source ~/.zshrc # zsh (Mac)
source ~/.config/fish/config.fish # fishStep 3 β Work normally! Then revise:
npx tracker listThat'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 commandsSearch commands:
tracker search "install" # find all install commands
tracker search "git" # find all git related commandsSave favorites for quick revision:
tracker favorite "git rebase -i HEAD~3"
tracker favorites # see all starred commandsExport 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.gitignoreYour command history stays local β never pushed to GitHub
π Automatic Secret Redaction

Security is a core priority of cmd-tracker. Before any command is written to .tracker/commands.json, it is automatically scanned for sensitive information.
If a command contains credentials such as API keys, access tokens passwords, or private keys, the sensitive value or credential segment is replaced with [REDACTED], while the rest of the command is preserved. This keeps your command history useful without exposing secrets.
Example
AWS example β Before
export AWS_SECRET_ACCESS_KEY=mySecretKeyAWS example β Saved as
export AWS_SECRET_ACCESS_KEY=[REDACTED]Another example:
curl example β Before
curl -u sampleuser:examplePass https://api.example.comcurl example β Saved as
curl -u [REDACTED] https://api.example.comπ‘οΈ Supported Secret Types
The sanitizer automatically detects and redacts:
- AWS credentials (
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY, etc.) - API keys
- Access tokens
- Authentication tokens
- Passwords
- Bearer tokens
- HTTP Basic Authentication credentials
curl -u/curl --usercredentials- GitHub Personal Access Tokens
- GitLab Personal Access Tokens
- Slack tokens
- SSH private keys
- PEM private keys
β οΈ Commands That Are Not Saved
If a command consists entirely of sensitive information (for example, only a GitHub token or a private key), cmd-tracker will not save it.
Example:
Input
ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxResult
Command not saved (contains only sensitive data)β Why This Matters
This feature helps prevent accidental exposure of secrets while keeping your command history clean and useful.
- π Prevents credentials from being stored in
.tracker/commands.json - π Preserves the readable parts of commands for future reference
- π« Avoids saving commands that contain nothing except sensitive information
- π» Works automaticallyβno configuration required
π₯οΈ 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 fishUbuntu/Debian:
sudo apt install fishFedora:
sudo dnf install fishWindows (WSL):
sudo apt install fishSetup tracker in Fish
npx tracker init
npx tracker hook
source ~/.config/fish/config.fishThat'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!
