CLI version policy
Keep every project in your organization on a consistent Fern CLI version.
Admins can set an organization-level CLI version policy to bound the Fern CLI version that every project in your organization runs. Set a minimum, a maximum, or an exact version. A policy lives on your organization, and applies to every project without a change to any fern.config.json.
By default, no policy is set, and each project runs the version it pins in fern.config.json. Those pins can diverge across repositories, leaving the same API definition to compile against a different CLI in each one.
Which version runs
Each time you run a Fern CLI command in your project, Fern compares the version pinned in fern.config.json against your organization’s bounds and runs the nearest allowed version.
A version already inside the range prints nothing. When the version changes, the CLI names the bound that applied before the command proceeds:
A policy never blocks a command. When the CLI can’t read your organization’s bounds, such as when it isn’t authenticated or can’t reach Fern, the project runs its own pinned version.
Set the policy
fern org set cli-version writes the bounds. It requires an organization admin and an authenticated session from fern login. The organization is read from fern.config.json; pass --org to target a different one.
Each bound is an exact published version of the fern-api package, such as 5.45.0 or 5.45.0-rc0.
--min and --max update only the bound you pass. Setting --min 5.40.0 on an organization already pinned to 5.45.0 leaves the maximum at 5.45.0, turning the pin into the range 5.40.0 to 5.45.0.
Read the policy
fern org get prints the policy in one line — Fern CLI must be between 5.40.0 and 5.50.0, or the equivalent for a minimum, maximum, or exact pin — and reports when no policy is set. --json returns the raw cliVersionMin and cliVersionMax fields instead.
Clear the policy
fern org unset cli-version clears the bounds, and like setting them it requires an organization admin.
Interaction with fern upgrade
A policy changes the version that runs, not the version on disk, so a project stays out of range until it’s upgraded. fern upgrade brings the file itself into range: it applies the bounds to the upgrade target before writing it.
A plain fern upgrade resolves to the latest release, which is never below the minimum, so only the maximum changes what it writes. The minimum applies when you request an older version with --version: the bounds win over the version you asked for.
fern downgrade is the exception: it writes whatever version you pass, including one below the minimum. The policy then overrides that pin the same way it overrides any other out-of-range pin, so the project’s commands keep running the minimum.
Running a newer CLI doesn’t apply the migrations that fern upgrade performs. Raising the minimum across a major version therefore still requires each project to run fern upgrade.