CLI generation
Alpha · Enterprise Only
CLI generation is currently in alpha and available exclusively to early access customers. Features and configuration may change. Contact us for access.
Speakeasy can generate a fully functional command-line interface (CLI) from your OpenAPI specification. The generated CLI is written in Go using Cobra and provides a per-operation command structure, multiple output formats, built-in authentication, and cross-platform distribution tooling.
Getting started
- Generate a CLI — Create a CLI from your OpenAPI document using
speakeasy quickstart - Customize a CLI — Configure command naming, environment variables, custom code regions, and more
- Distribute a CLI — Distribute your CLI using GoReleaser, install scripts, or
go install - Configuration reference — Full
gen.yamlconfiguration reference for theclitarget
Key features
- Per-operation commands with smart grouping and stutter removal
- Multiple output formats — pretty, JSON, YAML, table, and TOON (token-oriented output for LLM consumption)
- Built-in jq filtering via
--jq - Flexible input — individual flags,
--bodyJSON, or stdin piping - 4-tier authentication — flags → environment variables → OS keychain → config file
- Shell completions for bash, zsh, fish, and PowerShell
- Pagination with
--alland--max-pages - SSE and JSONL streaming
- Retries with configurable exponential backoff
- Diagnostics —
--dry-runand--debugwith automatic secret redaction - AI agent mode — automatically detected for coding assistants like Claude Code, Cursor, and others
- Cross-platform release — GoReleaser config, install scripts, and GitHub Actions workflow
Last updated on