The Fern Folder
Configuring fern starts with the fern
folder. The fern folder contains your API definitions,
generators, and your CLI version.
Directory structure
When you run fern init
, your Fern folder will be initialized with the following files:
If you want to intialize Fern with an OpenAPI Specification, run fern init --openapi path/to/openapi
instead.
fern.config.json
Every fern folder has a single fern.config.json
file. This file stores the organization and
the version of the Fern CLI that you are using.
Every time you run a fern CLI command, the CLI downloads itself at the correct version to ensure determinism.
fern upgrade
. This will update the version field in fern.config.json
generators.yml
The generators.yml
file can include information about where your API specification is located, along with which generators you are using, where each package gets published, as well as configuration specific to each generator.
Multiple APIs
The Fern folder is capable of housing multiple API definitions. Instead of placing your API definition at the top-level, you can nest them within an apis
folder. Be sure to include a generators.yml
file within each API folder that specifies the location of the API definition.