> This page is for CLI 参考.

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

## 5.152.1

**`(fix):`** `fern sdk migrate --strict` no longer fails when local-file-system output internally requests
snippets for documentation generation without a user-configured `snippets.path`.

## 5.152.0

**`(feat):`** Add `--skip-api` to `fern docs dev`. API specs are not parsed, so large sites preview in seconds. API reference sections keep their overview page and hand-written pages and links, but endpoint and schema pages are left out. Broken-link checks and checks that read API spec files (such as OpenAPI example validation) are skipped in this mode; `fern check` still runs them.

**`(feat):`** Add `--skip-validation` to `fern docs dev`. Skips docs validation, which on large sites competes with the docs build and delays the preview. Docs errors are not reported in this mode.

**`(fix):`** Recognize `x-fern-availability: generally-available` in the OpenAPI v3 parser. Previously this value was
dropped, so those endpoints were treated as having no availability.

**`(feat):`** Route generation through sdk-gen-api based on the `use-sdk-gen-api` PostHog feature flag instead of the
`FERN_USE_SDK_GEN_API` environment variable and the `DEFAULT_USE_SDK_GEN_API` build default. The flag is
evaluated per organization and generator, with the organization, the generator name, the generator's language,
and the CLI release environment (`prod`, `pre-prod`, `beta`, `dev`, `local`) as targeting properties. This lets
one generator or language be routed or kept on Fiddle for every organization or for a single organization, and
lets an organization be kept off sdk-gen-api entirely. The flag is off when PostHog is unreachable or the flag is
not configured.

**`(chore):`** Tag every CLI telemetry event with `cliReleaseEnvironment` (`prod`, `pre-prod`, `beta`, `dev`, `local`) so
events from different CLI distributions can be told apart. On the `fern generate` event, `sdkGenApiEnabled` now
reflects the `use-sdk-gen-api` flag (true when at least one requested generator is routed), each
`requestedGenerators` entry carries its own `sdkGenApiEnabled`, and `fernUseSdkGenApiEnv` is removed.

**`(feat):`** Add a `sort-by-availability` option to API reference entries in `docs.yml`. Endpoints are ordered by
their `x-fern-availability`: listed values come first in the given order, followed by the rest in the
default order (`unset`, `generally-available`, `alpha`, `beta`, `preview`, `legacy`, `deprecated`).
Use `unset` to position endpoints that have no availability.
Endpoints with the same availability keep their order, or are alphabetized when `alphabetized` is true.

## 5.151.5

**`(chore):`** Enrich the `fern generate` telemetry event with the generators selected to run (including SDK Config targets)
and whether `FERN_USE_SDK_GEN_API` was set to `true` alongside the effective sdk-gen-api state.

## 5.151.4

**`(fix):`** Remote `fern generate` for `local-file-system` outputs now always requests snippets, so the
TypeScript, Java, C#, PHP and Ruby generators emit `README.md` and `reference.md` without a
`snippets: path:` entry in generators.yml (matching `--local`). The snippet JSON is still only
written to disk when `snippets.path` is configured.

## 5.151.3

**`(fix):`** When a Maven output omits `url`, default to the Sonatype Central Portal OSSRH Staging API
(`https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/`) instead of
the retired OSSRH hosts (`oss.sonatype.org` / `s01.oss.sonatype.org`). This applies to signed and
unsigned `maven` outputs in generators.yml and to Maven publish targets in fern.yml.

Maven Central only releases signed artifacts, so an unsigned Maven output without a `url` is uploaded
to the Central Portal staging service but never released. `fern check` now reports a warning for this
(printed with `--warnings` for generators.yml) and `fern generate` logs it for generators.yml
`output.location: maven` (with or without a `github` block) and for fern.yml `publish.maven` targets
delivered through git. Add `signature` to publish to Maven Central, or set `url` to publish to another
registry. The warning does not fail `fern check` or block generation, so existing configurations keep
working.

**`(fix):`** Reject direct RubyGems publishing before generation instead of failing at publish time with
"Method not implemented.". `fern check` now reports an error for a generators.yml `output.location: rubygems`
without a `github` block (and for an SDK Config target with `publish.registry: rubygems` that is not delivered
through GitHub), and remote `fern generate` rejects the selected generator before any work starts. Add a
`github` block so the gem is published by the generated GitHub Actions workflow. `fern generate --local`,
`--preview`, and `--lfs-override`, which do not publish, are unaffected.

**`(fix):`** Include the optional `detail` and `reason` that sdk-gen-api reports for a failed publication in the error message,
for example `sdk-gen-api publication failed (invalid_publish_request): <message>: <detail> [package_name_mismatch]`.
Credentials are redacted from the detail, and servers that omit these fields produce the same message as before.

**`(fix):`** Log a warning, instead of a debug message, when `FERN_USE_SDK_GEN_API=true` is set but a generator falls back to
legacy Fiddle generation because sdk-gen-api cannot handle its output (for example, direct NuGet publishing).

## 5.151.2

**`(fix):`** When SDK Config init is enabled (`FERN_USE_SDK_CONFIG=true`), `fern init` now also initializes the docs with the
API's spec, because the docs cannot read an `sdk-config.yml` API. `fern init` and `fern init --openapi <path-or-url>`
initialize both the API and the docs, `fern init --api` only the API, and `fern init --docs --openapi <path-or-url>`
only the docs. The docs read the same `openapi.json|yml` as the API's `sdk-config.yml`, and a later `fern init`
that moves the API into `apis/` updates the path in `docs.yml`. In a project that already has a `docs.yml`, the
spec is added to its first `api` entry, or to a new one, instead of only printing a warning. A spec that does not
live in the fern directory, such as a URL, is copied there as `openapi-1.json|yml` (and so on when the name is
taken), so an existing API's spec is never overwritten. A spec that `docs.yml` already reads from the fern directory is not overwritten by a later `fern init`, which gives it a free name instead. If `docs.yml` splits its navigation into tabs, it is left
unchanged and the command warns. Without the flag, behavior is unchanged.

## 5.151.1

**`(fix):`** `fern generate --package-only` now copies the generated `README.md` and `reference.md`
into `fern-dist/` before removing the SDK source, so they are kept for every language
instead of only those whose package format bundles root files (e.g. Ruby gems, Go source zips).

## 5.151.0

**`(feat):`** Add `experimental.robots-txt-on-instance-url` to `docs.yml`. When set to `true`, the custom
robots.txt configured in `agents.robots-txt` is also served on the site's Fern instance URL
(`<site>.docs.buildwithfern.com`), not only on custom domains. Pages on the instance URL keep
`X-Robots-Tag: noindex, nofollow`, so search engines still won't index them.
`fern check` warns if the flag is set without `agents.robots-txt`.

## 5.150.0

**`(feat):`** Add an optional `type` to inferred bearer auth schemes (`api-key` | `refresh-token`). With
`type: refresh-token`, the IR records the get-token endpoint's `grant_type` request property
(`InferredAuthSchemeTokenEndpoint.grantType`) so SDKs always send `grant_type=refresh_token`
and do not expose `grant_type` as a client option.

```yaml
auth-schemes:
  Bearer:
    scheme: bearer
    get-token: POST /authorize
    type: refresh-token
```