home / skills / michalvavra / agents / create-cli
This skill guides you design CLI tools with consistent UX, robust options, clear help, and safe error handling.
npx playbooks add skill michalvavra/agents --skill create-cliReview the files below or copy the command above to add this skill to your agents.
---
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 (`--from` not `-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_COLOR` env
## Errors
```
<name>: <message>
Try '<name> --help'
```
## Destructive Operations
- Confirm when stdin is TTY
- `--force` to skip confirmation
- `--dry-run` to 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](references/node-js.md) - Node.js with parseArgs
See [references/python-uv.md](references/python-uv.md) - Python with uv
See [clig.dev](https://clig.dev/) for comprehensive guidelines.
This skill helps design command-line interfaces with consistent UX patterns for shell-based tools. It captures conventions for syntax, flags, output formats, error handling, and destructive operation safeguards to produce predictable, user-friendly CLIs. It is focused on practical rules you can apply across languages and runtimes.
The skill inspects a proposed CLI surface and enforces conventions: prefer long options, separate data (stdout) from progress/errors (stderr), and apply standard exit codes. It specifies help layout, default human-readable output with an optional --json mode, and behavior for quiet and non-interactive runs. It also defines confirmation and dry-run behavior for destructive commands.
What should --json include versus human output?
--json must provide structured data representing the core result (no progress text). Human output can be formatted tables; --json implies --quiet so only the machine-readable payload is emitted.
When to require confirmation and when to use --force?
Require interactive confirmation when stdin is a TTY for destructive actions. Provide --force to skip confirmation and --dry-run to preview changes; CI should use --force in controlled contexts.