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.
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.
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).