Skip to content
Skills Library
Programming · Building & coding

cli-builder

/cli-builder

Build or refactor agent-facing CLI tools with non-interactive commands, stable --help and --json contracts, idempotent operations, and --dry-run previews. Use for CLI design, agent-friction refactors, output/exit-code debugging, or automation safety. Do not use for GUI/TUI design, conversational tools, MCP server design, or general API architecture; use api-design-and-evolution for the latter.

Licence
MIT
Last repository change
25.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
10
Scripts
1
HTML comments
0
URLs in SKILL.md
4
Deprecation

No signals detected. Repository changed on 25.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: templates/bash-cli-scaffold.sh

What it does and when to use it

Build or refactor agent-facing CLI tools with non-interactive commands, stable --help and --json contracts, idempotent operations, and --dry-run previews. Use for CLI design, agent-friction refactors, output/exit-code debugging, or automation safety. Do not use for GUI/TUI design, conversational tools, MCP server design, or general API architecture; use api-design-and-evolution for the latter.

Original author description

Build or refactor agent-facing CLI tools with non-interactive commands, stable --help and --json contracts, idempotent operations, and --dry-run previews. Use for CLI design, agent-friction refactors, output/exit-code debugging, or automation safety. Do not use for GUI/TUI design, conversational tools, MCP server design, or general API architecture; use api-design-and-evolution for the latter.

How it works

  1. When to Use
  2. One Workflow
  3. Core Contracts
  4. When Not to Use
  5. References
Original SKILL.md headings · 88 lines, 523 words
SKILL.md preview
---
name: cli-builder
description: >-
  Build or refactor agent-facing CLI tools with non-interactive commands, stable
  --help and --json contracts, idempotent operations, and --dry-run previews.
  Use for CLI design, agent-friction refactors, output/exit-code debugging, or
  automation safety. Do not use for GUI/TUI design, conversational tools, MCP
  server design, or general API architecture; use api-design-and-evolution for
  the latter.
license: MIT
compatibility: Requires bash, Python 3.8+, jq, and standard Unix CLI environment.
metadata:
  tags: cli, agent-tooling, design-patterns, automation
  sources: https://x.com/ericzakariasson/status/2036762680401223946, https://www.scalekit.com/blog/mcp-vs-cli-use,
    https://github.com/ComposioHQ/awesome-agent-clis, https://ronnierocha.dev/blog/dont-build-mcps-build-cli-tools
---

# CLI Builder

Treat a CLI as a contract between the tool and the agent. The contract includes
command names, `--help`, flags, output schemas, exit codes, stderr, and previews.
Keep this file as the workflow; load the linked references only when their
specialized guidance is needed.

## When to Use

- Build a new CLI that an agent will discover and call.
- Refactor prompts, ambiguous commands, parser-hostile output, or false success codes.
- Add or review `--json`, `--dry-run`, `--yes`, idempotency, or lazy authentication.

## One Workflow

### 1. Discover the real contract

Define one CLI per service (except services sharing vendor authentication). Inspect
real non-health read endpoints before coding, verify the actual authentication
header and response shape, and capture the command tree and failure cases. Do not
invent flags from API documentation alone. For HTTP clients, read
[the Python API client pattern](references/python-api-client.md).

Choose Bash for local wrappers and filesystem pipelines. Choose Python for HTTP,
JSON, authentication state, or three-level command trees.

### 2. Build a predictable surface

Use one consistent verb/resource convention. Every command should be non-interactive
and flag-driven, reject unknown flags, and provide useful subcommand help with
concrete examples. Make normal output human-readable, but support `--json` with a
stable curated schema, normalized types, deterministic ordering, and no other stdout.
Send diagnostics to stderr with truthful non-zero exit codes.

For any state change, implement `--dry-run` before data-fetching or mutation, and
require an explicit `--yes`/`--force` gate for destructive work. Guard creation,
updates, and deletion so reruns are safe. Authentication must be lazy: `--help` and
safe dry-runs work without credentials.

Use the [advanced patterns](references/advanced-patterns.md) for chained dry-runs,
third-party JSON, version-dependent behavior, and text matching. Use the
[Bash scaffold](templates/bash-cli-scaffold.sh) when a local shell wrapper is the
right fit.

### 3. Verify the contract

Run syntax checks, every command's `--help`, parse every `--json` response, check
missing arguments and unknown flags, confirm errors are on stderr, exercise dry-run
without credentials, and prove a second identical run is a no-op. Against a live
service, test a real authenticated read and dry-run each mutation. Use the
[agent-readiness checklist](references/agent-readiness-checklist.md) for the final
review.

### 4. Wrap and maintain

Keep the entry-point skill concise and put conditional detail in references. A
wrapper should explain what the CLI is for, setup, common commands, output meaning,
and gotchas, not duplicate every flag. See the
[skill-wrapper example](references/skill-wrapper-example.md). After real usage,
record failures and prioritize fixes with the [improvement cycle](references/improvement-cycle.md).

## Core Contracts

- `--help` is the discoverable schema and includes examples.
- `--json` is parseable on stdout alone; errors have stable machine-readable codes.
- `--dry-run` describes exact intended changes and performs no writes or prerequisite lookups.
- Mutations are explicitly authorized, idempotent, and report meaningful status.
- Exit status distinguishes success, usage failure, and runtime failure.

## When Not to Use

Do not use this skill for one-off interactive human commands, GUI/TUI or web UI
design, conversational agent tools, or MCP servers. Read
[the MCP-vs-CLI decision guide](references/mcp-vs-cli.md) for tool-boundary choices,
and route general API contract design to
[api-design-and-evolution](../api-design-and-evolution/SKILL.md).

## References

- [Python API client](references/python-api-client.md)
- [Advanced patterns](references/advanced-patterns.md)
- [Agent-readiness checklist](references/agent-readiness-checklist.md)
- [Skill wrapper example](references/skill-wrapper-example.md)
- [MCP vs CLI](references/mcp-vs-cli.md)
- [Improvement cycle](references/improvement-cycle.md)
- [Bash scaffold](templates/bash-cli-scaffold.sh)
Files in this package (10)
  • README.md 2 KB
  • SKILL.md 5 KB
  • evals/evals.json 8 KB
  • references/advanced-patterns.md 7 KB
  • references/agent-readiness-checklist.md 1 KB
  • references/improvement-cycle.md 2 KB
  • references/mcp-vs-cli.md 3 KB
  • references/python-api-client.md 10 KB
  • references/skill-wrapper-example.md 4 KB
  • templates/bash-cli-scaffold.sh 6 KB

Versions

RepositoryScoreLicence
This page · magnus919/agent-skills100MIT
luongnv89/skills100MIT

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version 28a525b59660 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100cli-for-agents
    Design or review CLIs so coding agents can run them reliably: non-interactive flags, fast actionable errors, idempotency, dry-run, layered --help. Use when building a CLI or adding commands.
  • 100cli-ux
    Use for packages/cli changes that affect command UX, prompts, help, output layout, progress, success, warnings, errors, JSON/stdout/stderr contracts, non-interactive/agent behavior, copy, or tests for those surfaces. Do not load for implementation-only refactors with unchanged CLI surface.
  • 100cli-for-agents
    Designing CLIs that AI agents will invoke — non-interactive flags, layered --help with examples, stdin/pipeline composition, actionable errors, idempotency, dry-run, destructive-action safety, and predictable command structure. Use when designing, building, or reviewing a…
  • 95cli-for-agent
    Design or review CLIs so coding agents can run them reliably: non-interactive flags, layered --help with examples, stdin/pipelines, fast actionable errors, idempotency, dry-run, and predictable structure. Use when building a CLI, adding commands, writing --help, or when the user…
  • 100cli-for-agents
    Designs or reviews CLIs so coding agents can run them reliably: non-interactive flags, layered --help with examples, stdin/pipelines, fast actionable errors, idempotency, dry-run, and predictable structure. Use when building a CLI, adding commands, writing --help, or when the…
  • 100cli-for-agents
    Designs or reviews CLIs so coding agents can run them reliably: non-interactive flags, layered --help with examples, stdin/pipelines, fast actionable errors, idempotency, dry-run, and predictable structure. Use when building a CLI, adding commands, writing --help, or when the…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.