OpenAPI extensions
Early access
The CLI generator is in early access. Reach out to get started.
The CLI generator reads several Fern OpenAPI extensions to shape the generated CLI. You can add these extensions directly in your spec or apply them through overlays.
Command structure
x-fern-sdk-group-name
Determines the subcommand group hierarchy. Each list element becomes a nested subcommand, with names converted from camelCase to kebab-case.
Produces: cli scheduled-events invitees list-event-invitees
x-fern-sdk-method-name
Sets the leaf command name (used as-is).
Produces: cli get-current-user (or nested under a group if x-fern-sdk-group-name is also set).
If neither extension is present, the CLI falls back to the operationId.
See SDK method names for more details.
Command group help
A command group’s help text comes from the root-level tags[] entry attributed to it: the first sentence of the tag description becomes the short line in the parent command’s table, and the full description becomes the group’s --help body.
Produces plants Browse and water the plants in your greenhouse. in the top-level command table.
A tag is attributed to a group when its name matches the group name, or when it’s exclusive to the group and covers at least half of the group’s operations. Colon-scoped tag names (access:all) and tags shared across groups are ignored, leaving the fallback Operations on '<name>'.
x-fern-groups
Overrides the derived help for a group. summary sets the short line, which is capped at 80 characters; description sets the long help and also supplies the short line when summary is absent or only restates the command name (Plants for plants).
Filtering
x-fern-ignore
Excludes operations or parameters from the generated CLI. An ignored operation produces no command; an ignored parameter produces no flag.
At the parameter level:
See Ignoring elements for more details.
Availability badges
x-fern-availability
Adds a status badge next to the command in --help output.
OpenAPI’s standard deprecated: true is also honored and maps to [Deprecated] when x-fern-availability isn’t set.
See Availability for more details.
Parameter naming
x-fern-parameter-name
Overrides the CLI flag name derived from a parameter. By default, parameter names are converted to kebab-case for use as flags.
Produces --api-version instead of --x-api-version.
See Customize parameter names for more details.
Global parameters
x-fern-global-parameters
Registers a value that’s configured once and injected into every applicable command, rather than passed on each invocation. Each declared parameter becomes a top-level --<flag-name> flag with its environment-variable fallback and client-side default, injected at the declared location (body, query, header, or path).
The value resolves from the first available source: the CLI flag, then the environment variable, then the default. A per-operation parameter with the same target overrides the global.
An apply: auto parameter applies to every command whose request contains the target; an apply: explicit parameter applies only to operations that opt in with x-fern-global-parameter.
See Global parameters for the full field reference and resolution order.
Pagination
x-fern-pagination
Enables auto-pagination for an endpoint. When present, the CLI recognizes --page-all, --page-limit, and --page-delay flags for that command.
See Pagination for all supported pagination schemes (offset, cursor, URI, and path).