Configuration reference
Early access
The CLI generator is in early access. Reach out to get started.
Configure the CLI generator in generators.yml. Options nested under config are specific to the CLI generator. The rest (output, github, audiences, smart-casing, metadata, api) behave the same way as for SDK generators.
config options
binaryName
Name of the compiled binary. Determines the executable filename, the Cargo [[bin]] target name, and the environment-variable prefix used for TLS, proxy, and logging settings.
When omitted, the generator derives the name from the API definition’s display name (kebab-cased). Multi-spec workspaces must set this field explicitly — there is no sensible auto-derivation when multiple specs are present.
The binary name contoso produces:
- Executable:
contoso - Env-var prefix:
CONTOSO(e.g.CONTOSO_CA_BUNDLE,CONTOSO_LOG)
customCommands
Controls whether the generator produces the custom command infrastructure alongside the CLI binary. When enabled, the output includes:
- A
<binaryName>-typeslibrary crate (typed serde structs) - A
<binaryName>-sdklibrary crate (HTTP client accessible viactx.client()) - Scaffolding files for user-authored command handlers
Set to false to produce a spec-only CLI with no custom command support.
userAgentSuffixFlag
Renames the global flag (and its derived environment variable) that a downstream consumer uses to append a product token to the generated CLI’s User-Agent. Provide the flag’s long name without the leading --. It must be a kebab identifier matching ^[a-z][a-z0-9-]*$ and can’t collide with a built-in flag name.
Any kebab identifier is accepted except the CLI’s built-in flag names (params, output, json, format, dry-run, base-url, page-all, page-limit, page-delay, no-pager, no-extract, no-retry, no-stream, quiet, query, help, debug, schema). The default user-agent-suffix exposes --user-agent-suffix and <NAME>_USER_AGENT_SUFFIX. For example, setting via exposes --via and <NAME>_VIA instead (the environment variable is <NAME>_ followed by the flag uppercased with hyphens converted to underscores):
A consumer of the generated contoso CLI then appends its product token with the renamed flag:
Publishing & delivery
output
Configures where to publish the generated CLI. The CLI generator supports npm and local-file-system output locations. For the full publishing workflow (OIDC auth, CI builds, Homebrew tap), see Publishing. For Docker-based generation on your own machine, see Self-hosted generation.
npm
Publish the CLI as an npm package. Users install with npm install -g @myorg/my-cli or npx @myorg/my-cli.
Local file system
Write the generated Rust project to a local directory for manual building and distribution.
github
Specifies how generated CLI code is delivered to your repository. Supports the same modes as SDKs: release, pull-request, and push.
Command generation
audiences
Filter which API endpoints are included in the generated CLI based on audience tags. Only endpoints tagged with the specified audiences in your API spec (via x-fern-audiences) produce commands. Without this filter, all endpoints generate commands.
smart-casing
Enables intelligent case conversion that preserves numbers and common programming patterns in generated command and flag names.
api
Override authentication settings at the generator level. This uses the same schema as the SDK generator-level api.auth to control which auth schemes the CLI uses.
metadata
Attach package metadata to the generated CLI for use in published artifacts.