$ recombobulate _
home / tips / build-a-nodejs-cli-tool-with-commanderjs-using-claude
0

Build a Node.js CLI Tool with Commander.js Using Claude

bagwaa @bagwaa · Mar 26, 2026 · Workflows
build-a-nodejs-cli-tool-with-commanderjs-using-claude

Need a quick CLI tool for your team? Claude can scaffold the entire thing — argument parsing, subcommands, help text, and all the boilerplate you'd rather not write by hand.

Create a Node.js CLI tool using Commander.js called "deployer" with
these subcommands:
- deploy <environment> — runs deployment with a --dry-run flag
- status — shows current deployment status
- rollback — reverts to the previous version with a --force flag
Add coloured output with chalk and a loading spinner with ora.

Claude generates a clean project structure with bin/deployer.js, proper shebang lines, and a package.json with the right bin field so it installs globally with npm link.

For more advanced CLIs, ask Claude to add interactive prompts:

Add an interactive setup wizard using inquirer that asks for the
AWS region, cluster name, and confirms before deploying.

You can also point Claude at an existing shell script and ask it to convert:

Convert this bash deploy script into a proper Node.js CLI with
Commander.js. Keep the same flags and behaviour but add input
validation and helpful error messages.

Claude handles the tedious parts — process.exit codes, --help generation, argument validation, and even tab completion setup.

Turn your one-off scripts into proper CLI tools in minutes, not hours.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Scan Pending Changes for Security Issues with /security-review

The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.

bagwaa @bagwaa · 1 hour ago
0
Run Setup Scripts on Every Session with the SessionStart Hook

The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.

bagwaa @bagwaa · 1 hour ago
0
Write Property-Based Tests with fast-check and Claude

Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.

bagwaa @bagwaa · 2 hours ago