> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. # CLI generator > Generate a production CLI from your API definition that's built for AI agents and human developers. #### Early access The CLI generator is in early access. [Reach out](https://buildwithfern.com/book-demo?type=cli) to get started. Fern's CLI generator produces a fully functional command-line tool from the same API spec you already use for SDKs. It ships alongside your Docs and SDKs as a single binary with no runtime dependencies, serving AI agents that need deterministic output and runtime-introspectable schemas as well as human developers who script, debug, and explore. Building a CLI by hand is a multi-quarter project — commands, auth, pagination, retries, output formatting, cross-platform builds, shell completions, and keeping it all in sync as the API evolves. The generator handles that automatically. ## How it works #### Supported API definitions Generate a CLI from an OpenAPI spec or a GraphQL introspection schema. The CLI generator plugs into the same Fern workflow as your Docs and SDKs. When your spec changes, Fern opens a PR against your CLI repo with the generated source. On release, Fern automatically [publishes the CLI](/learn/cli-generator/get-started/publishing) to npm, Homebrew, and GitHub Releases so your users can install it with their package manager of choice. The CLI stays in sync with your Docs and SDKs, and you never need to write CLI code by hand. For organizations that need to keep generation on their own infrastructure, the generator also supports [self-hosted generation via Docker](/learn/cli-generator/get-started/local-generation). The output is a single statically linked Rust binary. Users drop it onto their PATH and run it. There's no language runtime and no dependencies. ## Built for agents and humans #### [Runtime introspection](/learn/cli-generator/get-started/features#machine-readable-schema) Schema and help available as structured JSON. #### Input validation Double-encoded URLs and other malformed inputs are caught before any request is sent. #### Interactive output Colored help, tabular output, and shell completions. #### Dry-run mode Preview a request without sending it. #### Version-pinned Each release maps to a specific API version. ## Next steps #### [Quickstart](/learn/cli-generator/get-started/quickstart) Generate a working CLI binary from an OpenAPI spec in five steps. #### [Features](/learn/cli-generator/get-started/features) Output formatting, retries, pagination, dry-run, TLS configuration. #### [Configuration](/learn/cli-generator/get-started/configuration) Generator-specific and shared options in generators.yml. #### [Publishing](/learn/cli-generator/get-started/publishing) Publish to npm, Homebrew, and GitHub Releases. > Generate a production CLI from your API definition that's built for AI agents and human developers.