Skip to content
Skills Library
Programming · Building & coding

cli-for-agent

/cli-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 mentions agent-friendly CLIs.

Licence
MIT
Last repository change
16.10.2026

Assessment and security

95/ 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.
Content30 / 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
2
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

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

Licence

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

What it does and when to use it

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 mentions agent-friendly CLIs.

Original author description

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 mentions agent-friendly CLIs.

How it works

  1. Non-interactive First
  2. Discoverability Without Dumping Context
  3. --help That Works
  4. Stdin, Flags, and Pipelines
  5. Fail Fast With Actionable Errors
  6. Idempotency
  7. Destructive Actions
  8. Predictable Structure
  9. Success Output
Original SKILL.md headings · 66 lines, 272 words
SKILL.md preview
---
name: "cli-for-agent"
description: "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 mentions agent-friendly CLIs."
---

# CLI for Agents

Human-oriented CLIs often block agents: interactive prompts, huge upfront docs, and help text without copy-pasteable examples. Prefer patterns that work headlessly and compose in pipelines.

## Non-interactive First

Every input should be expressible as a flag. Do not require arrow keys, menus, or timed prompts. If flags are missing, fall back to interactive — not the other way.

**Bad:** `mycli deploy` → `? Which environment? (use arrow keys)`
**Good:** `mycli deploy --env staging`

## Discoverability Without Dumping Context

Agents discover subcommands incrementally: `mycli`, then `mycli deploy --help`. Do not print the entire manual on every run.

## `--help` That Works

Every subcommand has `--help`. Every `--help` includes **Examples** with real invocations.

```
Options:
  --env     Target environment (staging, production)
  --tag     Image tag (default: latest)
  --force   Skip confirmation

Examples:
  mycli deploy --env staging
  mycli deploy --env production --tag v1.2.3
```

## Stdin, Flags, and Pipelines

Accept stdin where it makes sense. Avoid odd positional ordering. Support chaining.

## Fail Fast With Actionable Errors

On missing required flags: exit immediately with a clear message and a correct example invocation.

```
Error: No image tag specified.
  mycli deploy --env staging --tag <image-tag>
```

## Idempotency

Agents retry often. The same successful command run twice should be safe (no-op or explicit "already done").

## Destructive Actions

Add `--dry-run` so agents can preview plans. Offer `--yes` / `--force` to skip confirmations.

## Predictable Structure

Use consistent patterns: `resource` + `verb`. If `mycli service list` exists, `mycli deploy list` should follow the same shape.

## Success Output

Return machine-useful data on success: IDs, URLs, durations.

```
deployed v1.2.3 to staging
url: https://staging.myapp.com
deploy_id: dep_abc123
```
Files in this package (2)
  • SKILL.md 2 KB
  • plugin.json 1 KB

Versions

The database has no other skills named cli-for-agent.

Database snapshot: 13.11.2026 · package version 38b61535d716 (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
    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…
  • 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…
  • 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-agent-friendly-audit
    Audit a CLI tool against the agent-friendliness checklist from Zbigniew Sobiecki's "Building Agent-Friendly CLIs". Use when the user says "quality-cli-agent-friendly-audit", "cli-agent-friendly-audit", "audit this cli", "is my cli agent-friendly", or asks to check a CLI for agent ergonomics.
  • 100create-cli
    Design command-line interface parameters and UX: arguments, flags, subcommands, help text, output formats, error messages, exit codes, prompts, config/env precedence, and safe/dry-run behavior. Use when you’re designing a CLI spec (before implementation) or refactoring an…

Feedback and reports

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