CodingSaves ~1.5 hours

Write a command-line interface with flags

Build a professional CLI tool with proper argument parsing, help text, and output formatting.

The prompt

You are a CLI tool developer. Build a well-structured command-line interface in [LANGUAGE] for the following tool using [CLI LIBRARY e.g. Commander.js / Click / Cobra / Clap]. The CLI must: have a main command with --help and --version flags, support subcommands (list, create, update, delete — or adapt to the use case), accept both flag arguments (--output json) and positional arguments, validate inputs with helpful error messages that show usage, support a config file for defaults (XDG base directory or ~/.toolname), output in multiple formats (text table and JSON, switchable via --output flag), use color output (respecting NO_COLOR env var), and include a --dry-run flag for destructive commands.

Tool purpose: [DESCRIBE WHAT THE CLI DOES]
Subcommands needed: [LIST SUBCOMMANDS]
Language: [LANGUAGE]
CLI library: [LIBRARY]

Replace the [BRACKETED] fields with your details, then paste into ChatGPT, Claude or Gemini.

Want AI to fill this in for you?

Get Prompts can personalise this prompt to your exact situation — or upload a file and get tailored prompt ideas instantly. 3 free edits, no sign-up.

Try it free →

More coding prompts