Code
Build a CLI tool
A small command-line tool with help, flags, tests and a README.
Fill it in
Input, output, and the flags it needs.
Which language.
Cover the argument parsing and the happy path.
Your prompt
Build a Python CLI. [your what it does] Get the interface right before the implementation. A CLI is used from memory, so the flags should read as English at the call site, the defaults should be what you want 90% of the time, and `--help` should be enough to use it without reading anything else. Read from stdin and write to stdout when it makes sense, so it composes with other tools. Errors and progress go to stderr; a tool that mixes them cannot be piped. Exit non-zero on failure. A script that always exits 0 breaks every CI job it is ever put in, silently. Test the argument parsing and the happy path. Argument parsing is where CLIs actually break.
Use Build a CLI toolOpens with everything above already filled in.
Why this works
A CLI is used from memory, so the interface matters more than the implementation: flags that read as English, defaults that are right 90% of the time, and a --help that is enough on its own. It also exits non-zero on failure, which is what stops a script silently passing every CI job it is put in.
Questions
- Which languages?
- Python, Node, Go or Bash.