create-cli
Design CLI tools with consistent UX patterns.
When & Why to Use This Skill
This Claude skill streamlines the design and development of professional Command Line Interface (CLI) tools by enforcing consistent UX patterns and industry-standard conventions. It provides a structured framework for defining command syntax, flag usage, error handling, and multi-format output (JSON/Human), ensuring that developers can build intuitive, reliable, and script-friendly terminal applications that follow best practices like those found in clig.dev.
Use Cases
- Standardizing internal infrastructure tools: Establishing a unified set of CLI conventions across an engineering team to reduce the learning curve for internal DevOps and automation scripts.
- Designing robust open-source utilities: Building user-centric command-line tools with comprehensive help documentation, clear error messages, and predictable exit codes for public distribution.
- Implementing safe data operations: Integrating critical safety features like --dry-run, --force flags, and TTY confirmation prompts into tools that perform destructive or irreversible actions.
- Optimizing tools for automation and piping: Designing CLIs that support --json output and --quiet modes, allowing them to be easily integrated into CI/CD pipelines and complex shell workflows.
| name | create-cli |
|---|---|
| description | Design CLI tools with consistent UX patterns. |
Create CLI
Design CLI surface area: syntax, flags, output, error handling.
Conventions
- Long options preferred (
--fromnot-f) - stdout for data, stderr for progress/errors
- Exit codes: 0=success, 1=runtime error, 2=usage error
- Include
--help,--json,--quiet - Validate early, fail fast
Output
- Default: human-readable tables
--json: JSON output (implies quiet)--quiet: suppress progress- Respect
NO_COLORenv
Errors
<name>: <message>
Try '<name> --help'
Destructive Operations
- Confirm when stdin is TTY
--forceto skip confirmation--dry-runto preview
Help Format
<name> - <one-line description>
USAGE
<name> [OPTIONS] <ARGS>
OPTIONS
--option <VALUE> Description [default: X]
--help Show this help
EXAMPLES
<name> arg1 arg2
See references/node-js.md - Node.js with parseArgs See references/python-uv.md - Python with uv
See clig.dev for comprehensive guidelines.