The best open source CLI tools on npm share one trait: they solve a small, repeated annoyance and then get out of the way. This curated list collects the command-line utilities I actually keep installed — most of them are mine (BenihKode Dev Tools), and a few are widely used packages worth knowing.
Every entry installs with a single npm command and runs from the terminal.
Why CLI tools still win on npm
GUIs come and go; a good CLI tool is scriptable, composable, and works over SSH.
npm is the distribution channel that made this class of tool mainstream: npx
lets you try a utility without a permanent install, and npm install -g pins it
for daily use. The packages below are all open source and small enough to read.
Commit and Git workflow tools
gitcommitgen — generates a conventional commit message from your staged diff.
npm install -g @fanioz/gitcommitgen
gitcommitgen --commit
secretsweep — scans staged files for API keys and tokens before they leave your machine.
npm install -g @fanioz/secretsweep
npx secretsweep staged
Both are covered in detail on their tool pages: gitcommitgen and secretsweep.
Data and JSON tools
jsonask — query JSON in plain English instead of jq syntax.
npm install -g @fanioz/jsonask
jsonask users.json "where role is admin"
If you spend more time remembering jq filters than getting answers, this is the
one to install. Full examples live on the jsonask tool page.
Environment and config tools
envtainer — validate and diff .env files across environments.
npx envtainer validate
npx envtainer diff development production
See the envtainer page for the workflow.
Established community tools worth having
Beyond the BenihKode set, a few npm-distributed CLIs earn their install:
| Tool | Install | What it does |
|---|---|---|
| eslint | npm i -g eslint | Lint JavaScript and TypeScript |
| prettier | npm i -g prettier | Opinionated code formatting |
| http-server | npm i -g http-server | Serve a folder over HTTP in one command |
| np | npm i -g np | Guided, safer npm package publishing |
| degit | npm i -g degit | Clone a repo template without git history |
Each one replaces a task you would otherwise do by hand or with a heavier tool.
How to evaluate an npm CLI before installing it
Not every small package deserves a global install. A quick checklist:
- Read the package page. Last publish date, weekly downloads, and open issues tell you whether it is maintained.
- Check dependencies. A CLI with three dependencies is easier to trust than one with three hundred.
- Prefer
npxfirst. Try the tool without committing to a global install. - Confirm the scripts. Run
npm view <pkg> scriptsto see what it executes on install. - Look for a lockfile and a repo. A real repository and CI are good signals.
This is the same scrutiny you apply to any dependency — a CLI tool is a dependency that happens to have a command name.
What to look for in a curated CLI list
A useful curated list is not a dump of every package that mentions “cli” in its description. The tools worth listing share a few properties, and the list above was filtered on them:
- One job. The tool does a single thing well, which makes it composable with the rest of your shell.
- Zero or minimal configuration. If a tool needs a config file before its first useful run, it does not get adopted.
- Reads and writes standard streams. A tool that reads
stdinand writesstdoutchains withgrep,jq, and friends instead of fighting them. - A single install command.
npm install -gornpx, nothing more. - Open source and readable. You can inspect what runs on install.
Those five filters eliminate most npm noise and leave a set you can adopt without regret.
Building a small, composable toolkit
The value of a curated list is not the individual tools; it is how they combine. A few examples from packages above, strung together:
# Query an API response, filter it, and pretty-print the result
curl -s https://api.example.com/items \
| jsonask "where status is active" -o json \
| jq '.[0]'
# Guard the commit path before you describe it
git add -p && npx secretsweep staged && gitcommitgen --commit
The pattern is consistent: each tool owns one step and passes plain data to the next. That is the advantage of npm-distributed CLIs over heavyweight IDEs — you assemble exactly the pipeline your project needs.
Build your own
The reason these tools exist is that the barrier to publishing a CLI on npm is
low. A Node script plus a bin field in package.json is a shippable tool.
From Script to Tool walks through that step, and
Shipped: My First npm Package covers the
publishing details. If you have a script you run more than once a week, that is
a CLI waiting to be published.
The shortlist
If you install only five today:
- gitcommitgen for commit messages
- secretsweep for pre-commit secret scanning
- jsonask for JSON queries
- envtainer for environment validation
- eslint + prettier for code quality
Each installs in seconds and earns its place within a day.
Browse the full set on the developer tools collection, and check the BenihKode Journal for build stories behind each one.