Generate enterprise-ready, agent-first CLIs from OpenAPI or Swagger specifications. Use this skill whenever the user wants to "generate a CLI from an OpenAPI spec", "turn a Swagger API into a CLI", "scaffold an enterprise REST CLI", "create a CLI wrapper around a REST API", "derive a machine-readable CLI from an API description", "generate auth-aware commands from an OAS file", "build a deterministic CLI for this service", "create an agent-friendly CLI from this API", or mentions "api-anything", "OpenAPI CLI", "Swagger CLI", "REST CLI generator", "OAS to CLI", or "API CLI scaffold" in the context of generating CLI code from an API specification. Also triggers when the user provides an OpenAPI/Swagger spec file and asks to build a command-line tool from it, even if they don't use the exact term "CLI". Does NOT trigger for generic API discussion, SDK generation, client library generation, API debugging, or consuming an existing CLI.
From api-anythingnpx claudepluginhub thomasrohde/marketplace --plugin api-anythingThis skill uses the workspace's default tool permissions.
references/auth-patterns.mdreferences/cli-manifest-contract.mdreferences/examples.mdreferences/normalization-guide.mdreferences/output-contract.mdreferences/validation-strategy.mdProvides demand forecasting, safety stock optimization, replenishment planning, and promotional lift estimation for multi-location retailers managing 300-800 SKUs.
Creates consistent pitch decks, one-pagers, investor memos, financial models, accelerator apps, and fundraising materials from a single source of truth.
Provides expertise on electricity/gas procurement, tariff optimization, demand charge management, renewable PPA evaluation, hedging, load profiling, and multi-facility energy strategies.
Transform an OpenAPI / Swagger specification into a production-grade, agent-first CLI.
Every CLI produced by this skill must conform to the CLI-MANIFEST — the normative design contract for agent-first CLIs. The full manifest is embedded in references/cli-manifest-contract.md. Read it before generating any CLI code.
The manifest defines 23 principles across 5 parts (Foundations, Read & Discover, Safe Mutation, Transactional Workflows, Multi-Agent Coordination). It covers the output envelope, error taxonomy, exit codes, read/write separation, guide command, LLM=true handling, mutation safety, and transactional workflow patterns that the generated CLI must implement.
Execute these phases in order. Each phase produces artifacts the next phase consumes. Do not skip phases — the pipeline prevents the common failure mode of generating ad-hoc code directly from a raw spec.
Accept the spec from URL, local file path, or raw pasted content. Support both OpenAPI 3.x and Swagger 2.0.
$ref references where possibleIf the spec is invalid or critically incomplete, stop and present the issues to the user before continuing.
Build a canonical internal representation. Read references/normalization-guide.md for detailed guidance on this step.
kebab-case for commands, snake_case for flags, consistent pluralization--id style flags--data flag or stdin JSONDerive the command tree from the normalized model. Prefer resource-oriented verbs:
mycli customer list [--status active] [--limit 50]
mycli customer get --id 123
mycli customer create --data '{"name": "Acme"}'
mycli customer update --id 123 --data '{"name": "Acme Corp"}'
mycli customer delete --id 123 [--dry-run] [--force]
Not raw path mirroring like mycli get-api-v1-customers-by-id.
Define these introspection commands for every generated CLI:
mycli guide — machine-readable usage guide for agents (structured JSON explaining all commands, flags, auth, and workflows)mycli spec — dump the embedded API spec or command metadatamycli --help / mycli <command> --help — human-readable helpmycli --version — version and schema_versionDefine the output contract. Read references/output-contract.md for the envelope spec. Every command returns:
{
"schema_version": "1.0.0",
"request_id": "uuid",
"ok": true,
"command": "customer.get",
"result": { ... },
"error": null,
"meta": { "duration_ms": 142 }
}
Define the error taxonomy with stable error codes (not just HTTP status codes). Read references/output-contract.md for the error code registry pattern.
Read references/auth-patterns.md for the complete auth pattern catalog.
Key principles:
securitySchemes and security requirementsconfig.yaml or .myclirc that lets operators patch auth settings without modifying codetest, syst, prod with different base URLs, scopes, certs, token endpoints. When the user provides multiple endpoints, generate a --env flag (accepting test, syst, prod) that selects the target environment at runtime. Always generate the CLI from the production spec's perspective — prod is the canonical source of truth for command shapes, schemas, and contracts. Non-prod environments may have subset functionality or relaxed auth, but the CLI surface should reflect prod.Generate auth configuration that handles:
For every write operation, apply the CLI-MANIFEST mutation safety model:
--dry-run — preview what would happen without executing--force — skip confirmation for high-risk operations (require explicit opt-in)low, medium, high, criticalFor high-risk operations, implement the transactional workflow:
mycli <resource> <action> --plan — generate an execution planmycli <resource> <action> --validate — validate the plan against current statemycli <resource> <action> --apply — execute with confirmationmycli <resource> <action> --verify — confirm the mutation took effectAdd operational concerns:
--limit, --offset or --cursor flags; handle API pagination transparentlyRetry-After headers, implement backoff, report limits in stderrProduce a complete, buildable project. Typical structure:
mycli/
├── README.md # Usage, installation, examples
├── ARCHITECTURE.md # How the CLI is structured internally
├── AGENTS.md # Guide for coding agents working on this codebase
├── src/
│ ├── main.{ext} # Entry point
│ ├── commands/ # One module per resource family
│ ├── auth/ # Auth provider implementations
│ ├── client/ # HTTP client with retry, rate-limit, pagination
│ ├── config/ # Profile and environment management
│ ├── output/ # Envelope formatting, error codes
│ └── guide/ # Guide command implementation
├── config/
│ └── default.yaml # Default configuration template
├── tests/
│ ├── unit/ # Normalization, config parsing, output formatting
│ ├── integration/ # Mock server tests
│ ├── subprocess/ # CLI invocation tests
│ └── fixtures/ # Test specs, mock responses
├── package.json / pyproject.toml / go.mod
└── .github/
└── workflows/
└── ci.yaml
Choose the tech stack based on user preference, or default to:
Read references/validation-strategy.md for the complete 7-layer validation framework.
At minimum, generate tests covering:
After validation, produce a validation report stating:
If the source spec is ambiguous, incomplete, or contradictory:
spec-patches.yaml overlay file where operators can correct assumptions without modifying generated codeThe generated CLI must be usable by a weak coding agent (Haiku-class) with no improvisation. That means:
Read these when you need detailed guidance during specific phases:
| File | When to read |
|---|---|
references/cli-manifest-contract.md | Before Phase 3 — understand the full CLI contract |
references/normalization-guide.md | During Phase 2 — how to normalize specs into commands |
references/auth-patterns.md | During Phase 4 — enterprise auth pattern catalog |
references/output-contract.md | During Phase 3 — JSON envelope and error taxonomy |
references/validation-strategy.md | During Phase 7 — multi-layered validation framework |
references/examples.md | When generating examples or guide content |