fern generate

Use fern generate to run the Fern compiler for creating SDKs or documentation for your API. By default, Fern runs generators in the cloud in isolated, containerized environments.

Command flags

For SDKs

For Documentation

Command flags explained


Type: string Description: Filter to a specific group within generators.yml. Required unless you have a default-group declared in generators.yml.



Type: string Description: Specify a version for SDKs and documentation. Adherance to semantic versioning is advised.



Requirement: Docker Desktop must be installed and running on your machine.

Type: boolean Description: Use the --local option to generate code locally. This downloads the Docker Image and runs it on your machine.

Running a Docker locally supports outputting files. It does not support publishing to package managers.

Keep Docker

Requirement: Docker Desktop should be ready on your local machine.

Type: boolean Description: Use the --keepDocker option to keep the Docker container running after the generation is complete. This is useful for debugging.

Instance URL

Type: string Description: Use the instance option to specify an instance URL to generate documentation for. This is useful if you have multiple instances of your API.

Debugging logs

Type: choices "debug", "info", "warn", "error" Default: info

To see more information about what Fern is doing, use the --log-level option.

  • info: Informational messages, warnings, and errors are logged.
  • debug: Debug messages, informational messages, warnings, and errors are logged.
  • error: Only error messages are logged.
  • warn: Warning messages and above (i.e., warnings and errors) are logged.