Ask Claude to Build a CLI Tool from a Description of What It Should Do
Custom CLI tools save time, but building them from scratch — argument parsing, help text, error handling — is tedious. Describe what you need and Claude builds a proper tool.
"Build a CLI tool called 'dbsnap' that takes a snapshot of a database,
sanitizes personal data, and saves it as a compressed file.
It should accept --database, --output, and --sanitize flags."
Claude builds a complete, usable tool with all the pieces you'd write yourself:
# What Claude generates:
dbsnap --database myapp --output ./snapshots --sanitize
# With proper help text:
dbsnap --help
# With validation:
dbsnap --database "" # Error: --database is required
This works for any kind of tool:
# Project management
"Build a CLI tool that counts lines of code by language,
excluding vendor directories and test files"
# Development workflow
"Build a tool that checks if all required environment variables
are set by reading the .env.example file"
# Data processing
"Build a CLI that reads a CSV, validates each row against a schema,
and outputs a report of errors"
# Infrastructure
"Build a tool that checks the health of all services in our
docker-compose file and prints a status table"
Specify the language and framework:
# Node.js with Commander
"Build this in Node.js using Commander for argument parsing"
# Python with Click
"Build this in Python using Click with type hints"
# Go with Cobra
"Build this in Go using Cobra — it should compile to a single binary"
# Bash for simplicity
"Build this as a bash script — no external dependencies"
Claude includes the details that make a tool feel professional:
- Help text —
--helpwith descriptions for every flag - Validation — checks required arguments before running
- Exit codes — proper 0/1 exit codes for scripting
- Color output — formatted tables, progress indicators, colored status
- Config files — optional config file support so you don't repeat flags
Every team has tools that should exist but nobody builds — describe the tool to Claude and it creates something your team can use today.
via Claude Code
Log in to leave a comment.
Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.
Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.
Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.