# CLI generation

Speakeasy can generate a fully functional command-line interface (CLI) from an OpenAPI specification. The generated CLI is written in Go using [Cobra](https://cobra.dev/), wraps a generated Go SDK, and ships with human-friendly and automation-friendly interfaces out of the box.

## Getting started

- [**Generate a CLI**](/docs/cli-generation/create-cli) — Create a CLI from an OpenAPI document using `speakeasy quickstart`
- [**Customize a CLI**](/docs/cli-generation/customize-cli) — Configure command naming, environment variables, interactive features, release artifacts, and more
- [**Distribute a CLI**](/docs/cli-generation/distribute-cli) — Distribute a CLI using GoReleaser, install scripts, or `go install`
- [**Configuration reference**](/docs/speakeasy-reference/generation/cli-config) — Full `gen.yaml` configuration reference for the `cli` target

## What the generated CLI includes

## Key features

- **Per-operation commands** with smart grouping and stutter removal
- **Multiple output formats** — pretty, JSON, YAML, table, and [TOON](https://github.com/alpkeskin/gotoon)
- **Built-in jq filtering** via `--jq`
- **Flexible input** — individual flags, `--body`, stdin, and bytes fields with `file:` / `b64:` input
- **4-tier authentication** — flags → environment variables → OS keychain → config file
- **Interactive mode** — auto-prompting for unresolved fields, `explore`, `configure`, and auth forms
- **Agent mode** — auto-detected for Claude Code, Cursor, Codex, Aider, and similar environments
- **Pagination** with `--all` and `--max-pages`
- **SSE and JSONL streaming**
- **Retries and timeouts**
- **Response headers** via `--include-headers`
- **Binary downloads** with `--output-file` and `--output-b64`
- **Shell completions** for Bash, Zsh, Fish, and PowerShell
- **Machine-readable usage output** via `--usage`
- **Cross-platform release** — GoReleaser config, install scripts, and GitHub Actions workflow
