botox-cli
v1.0.0
Published
A CLI tool with handy utilities for "experienced" developers and sysadmins - so you don't even have to move a muscle 😉.
Downloads
2
Readme
Botox CLI
A Node.js CLI tool with handy utilities for "experienced" developers and sysadmins - so you don't even have to move a muscle 😉.
Features
botox kbp <port>/botox killbyport <port>: Kill process by portbotox gitclean: Clean up merged git branches (except main/master)botox flushdns: Flush DNS cache (macOS, Windows, Linux)
Usage
botox --help
botox kbp 3000
botox gitclean
botox flushdnsInstallation
npm install -g .
# or for local development
npm linkShell Alias Integration (Advanced)
You can enable first-class shell aliases for all your botox commands—just like the GitHub CLI—using the built-in alias command.
To make aliases available in every shell session, add this line to your .zshrc, .bashrc, or similar shell profile:
# Enable botox subcommands as top-level shell commands (e.g. 'kbp', 'gitclean', 'flushdns')
eval "$(botox alias -- "$0")"This will let you run kbp 3000 or gitclean directly in your shell, as if they were standalone commands, while still using the single botox binary under the hood.
- Why?
- Faster workflows (type
kbp 8080instead ofbotox kbp 8080) - Shell completion and history for subcommands
- Feels like a suite of first-class tools
- Faster workflows (type
- How does it work?
- The built-in
aliascommand emits shell functions for each subcommand, which forward tobotox. - Inspired by the GitHub CLI's alias system (see this blog post).
- The built-in
Note: This is optional. You can always use
botox <command>as normal.
Development
- Each command lives in its own module in
lib/commands/ - Uses commander for CLI parsing
- Uses shelljs for shell commands
- Uses chalk for colorful output
Project Structure
botox/
├── bin/index.js # CLI entry point
├── lib/commands/
│ ├── killbyport.js
│ ├── gitclean.js
│ └── flushdns.js
├── package.json
└── README.mdLocal Development & Testing
To use botox globally from any terminal during development, run:
npm linkThis symlinks your project as a global CLI, so you can run botox and all its subcommands from anywhere. This is also required for the alias integration to work as expected.
- After running
npm link, you can testbotox,kbp,gitclean, etc. from any directory. - Changes you make to your code will be reflected immediately (no need to re-link).
License
MIT
