Global options

Explore Fern CLI global options.

Quick Reference

OptionDescriptionExample
--helpShow command help and optionsfern --help
--log-levelSet logging verbosityfern generate --log-level debug
--apiTarget specific APIfern generate --api public-api
--groupTarget specific generator groupfern generate --group php-sdk
--versionSpecify the SDK version numberfern generate --version 1.2.3

When troubleshooting:

  • Use --log-level debug to see detailed output when encountering issues
  • When using --api, ensure the API name matches exactly with the directory name in your fern/apis/ folder

The following sections describe each global option in detail.

help

Use the --help option with any Fern CLI command to see an explanation and available options.

$fern add --help
>fern add <generator>
>
>Add a code generator to generators.yml
>
>Positionals:
> generator [string] [required]
>
>Options:
> --help Show help [boolean]
> --log-level [choices: "debug", "info", "warn", "error"] [default: "info"]
> --api Only run the command on the provided API [string]
> --group Add the generator to the specified group [string]

log-level

Use the --log-level option to set the verbosity of Fern’s logging output. The default level is info.

Available levels (from most to least verbose):

  • debug: Debug messages, informational messages, warnings, and errors
  • info: Informational messages, warnings, and errors
  • warn: Warnings and errors only
  • error: Error messages only
$fern generate --log-level debug

api

Use the --api option to target a specific API. This is particularly useful when your project contains multiple API definitions. The API name should match the directory name in your fern/apis/ folder.

$# Generate SDKs for only the "payments-api"
>fern generate --api payments-api

group

Use the --group option to target a specific generator group.

$# Generate only the Ruby SDK group
>fern generate --group ruby-sdk

version

Use the --version option to specify the SDK version number, typically following semantic versioning (semver) format (MAJOR.MINOR.PATCH). This is particularly useful in CI/CD pipelines when publishing SDK releases.

$# Generate Python SDK the payments API with version 1.2.3
>fern generate --api payments-api --group python-sdk --version 1.2.3
>
># Generate TypeScript SDK for the auth API with version 0.1.0
>fern generate --api auth --group ts-sdk --version 0.1.0
Built with