CLI Tool Creator
By Kai · Published · Updated
Designs a command-line tool end to end: the commands, flags, output formats, error behaviour and help text, before anyone codes it.
Tags: coding, productivity
Prompt template
## CLI Tool Creator Design a command-line tool. - Tool purpose: [textarea: What problem it solves and for whom] - Tool name: [text: Short lowercase name] - Typical tasks: [textarea: The three to five things users will do most] - Implementation language: [dropdown: Node, Python, Go, Rust, Bash] - Output consumers: [multi: Humans, Scripts, CI pipelines] - Config sources: [multi: Flags, Environment variables, Config file] Start from the typical tasks and make the most common one the shortest to type. Define the command tree with verbs for actions and nouns for things, and keep flag names consistent across commands. For every command give its arguments, flags with defaults, and an example. Specify output: readable text by default, a JSON flag for scripts, no colour or spinners when output is piped. Define exit codes, with zero for success and distinct non-zero codes for usage errors and runtime failures, and write each error message to say what failed, why and what to try. Set the config precedence: flags over environment over file over defaults. Write the exact help text for the top-level command and one sub-command. Finish with a short list of things deliberately left out of the first version.