Create CLI
Design CLI surface area (syntax + behavior), human-first, script-friendly.
Do This First
Clarify (fast)
Ask, then proceed with best-guess defaults if user is unsure:
- Command name + one-sentence purpose.
- Primary user: humans, scripts, or both.
- Input sources: args vs stdin; files vs URLs; secrets (never via flags).
- Output contract: human text,
--json, --plain, exit codes.
- Interactivity: prompts allowed? need
--no-input? confirmations for destructive ops?
- Config model: flags/env/config-file; precedence; XDG vs repo-local.
- Platform/runtime constraints: macOS/Linux/Windows; single binary vs runtime.
Deliverables (what to output)
When designing a CLI, produce a compact spec the user can implement:
- Command tree + USAGE synopsis.
- Args/flags table (types, defaults, required/optional, examples).
- Subcommand semantics (what each does; idempotence; state changes).
- Output rules: stdout vs stderr; TTY detection;
--json/--plain; --quiet/--verbose.
- Error + exit code map (top failure modes).
- Safety rules:
--dry-run, confirmations, --force, --no-input.
- Config/env rules + precedence (flags > env > project config > user config > system).
- Shell completion story (if relevant): install/discoverability; generation command or bundled scripts.
- 5–10 example invocations (common flows; include piped/stdin examples).
Default Conventions (unless user says otherwise)
-h/--help always shows help and ignores other args.
--version prints version to stdout.
- Primary data to stdout; diagnostics/errors to stderr.
- Add
--json for machine output; consider --plain for stable line-based text.
- Prompts only when stdin is a TTY;
--no-input disables prompts.
- Destructive operations: interactive confirmation + non-interactive requires
--force or explicit --confirm=....
- Respect
NO_COLOR, TERM=dumb; provide --no-color.
- Handle Ctrl-C: exit fast; bounded cleanup; be crash-only when possible.
Templates (copy into your answer)
CLI spec skeleton
Fill these sections, drop anything irrelevant:
- Name:
mycmd
- One-liner:
...
- USAGE:
mycmd [global flags] <subcommand> [args]
- Subcommands:
mycmd init ...
mycmd run ...
- Global flags:
-h, --help
--version
-q, --quiet / -v, --verbose (define exactly)
--json / --plain (if applicable)
- I/O contract:
- Exit codes:
0 success
1 generic failure
2 invalid usage (parse/validation)
- (add command-specific codes only when actually useful)
- Env/config:
- env vars:
- config file path + precedence:
- Examples:
Notes
- Prefer recommending a parsing library (language-specific) only when asked; otherwise keep this skill language-agnostic.
- If the request is “design parameters”, do not drift into implementation.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: chriskjaer-agents-create-cli3description: Create CLI4---56# Create CLI78Design CLI surface area (syntax + behavior), human-first, script-friendly.910## Do This First1112- Read `agents/skills/create-cli/references/cli-guidelines.md` and apply it as the default rubric.13- Upstream/full guidelines: https://clig.dev/ (propose changes: https://github.com/cli-guidelines/cli-guidelines)14- Ask only the minimum clarifying questions needed to lock the interface.1516## Clarify (fast)1718Ask, then proceed with best-guess defaults if user is unsure:1920- Command name + one-sentence purpose.21- Primary user: humans, scripts, or both.22- Input sources: args vs stdin; files vs URLs; secrets (never via flags).23- Output contract: human text, `--json`, `--plain`, exit codes.24- Interactivity: prompts allowed? need `--no-input`? confirmations for destructive ops?25- Config model: flags/env/config-file; precedence; XDG vs repo-local.26- Platform/runtime constraints: macOS/Linux/Windows; single binary vs runtime.2728## Deliverables (what to output)2930When designing a CLI, produce a compact spec the user can implement:3132- Command tree + USAGE synopsis.33- Args/flags table (types, defaults, required/optional, examples).34- Subcommand semantics (what each does; idempotence; state changes).35- Output rules: stdout vs stderr; TTY detection; `--json`/`--plain`; `--quiet`/`--verbose`.36- Error + exit code map (top failure modes).37- Safety rules: `--dry-run`, confirmations, `--force`, `--no-input`.38- Config/env rules + precedence (flags > env > project config > user config > system).39- Shell completion story (if relevant): install/discoverability; generation command or bundled scripts.40- 5–10 example invocations (common flows; include piped/stdin examples).4142## Default Conventions (unless user says otherwise)4344- `-h/--help` always shows help and ignores other args.45- `--version` prints version to stdout.46- Primary data to stdout; diagnostics/errors to stderr.47- Add `--json` for machine output; consider `--plain` for stable line-based text.48- Prompts only when stdin is a TTY; `--no-input` disables prompts.49- Destructive operations: interactive confirmation + non-interactive requires `--force` or explicit `--confirm=...`.50- Respect `NO_COLOR`, `TERM=dumb`; provide `--no-color`.51- Handle Ctrl-C: exit fast; bounded cleanup; be crash-only when possible.5253## Templates (copy into your answer)5455### CLI spec skeleton5657Fill these sections, drop anything irrelevant:58591. **Name**: `mycmd`602. **One-liner**: `...`613. **USAGE**:62 - `mycmd [global flags] <subcommand> [args]`634. **Subcommands**:64 - `mycmd init ...`65 - `mycmd run ...`665. **Global flags**:67 - `-h, --help`68 - `--version`69 - `-q, --quiet` / `-v, --verbose` (define exactly)70 - `--json` / `--plain` (if applicable)716. **I/O contract**:72 - stdout:73 - stderr:747. **Exit codes**:75 - `0` success76 - `1` generic failure77 - `2` invalid usage (parse/validation)78 - (add command-specific codes only when actually useful)798. **Env/config**:80 - env vars:81 - config file path + precedence:829. **Examples**:83 - …8485## Notes8687- Prefer recommending a parsing library (language-specific) only when asked; otherwise keep this skill language-agnostic.88- If the request is “design parameters”, do not drift into implementation.8990---91> Converted and distributed by [TomeVault](https://tomevault.io/claim/chriskjaer) — claim your Tome and manage your conversions.92<!-- tomevault:4.0:skill_md:2026-04-14 -->