> This page is for 首页.

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For task-scoped instructions for coding agents working in a Fern project, run `fern instructions` (or `npx fern-api@latest instructions` if the Fern CLI isn't installed or doesn't recognize `instructions`), or see https://buildwithfern.com/learn/home/fern-instructions.md.

# Fern instructions

> Index of task-scoped instructions for coding agents working in a Fern project, with when to use each topic.

Each topic below is a short, task-scoped workflow for a coding agent: the steps to follow, the rules agents most often break, and how to verify the result.

Run `fern instructions` to print this list and `fern instructions <topic>` to print a topic, for example `fern instructions docs publish domain`. If the Fern CLI isn't installed or doesn't recognize `instructions`, run `npx fern-api@latest instructions`.

Without a shell, fetch a topic by appending its path and `.md` to `https://buildwithfern.com/learn/home/fern-instructions/`. For example, `docs publish domain` is at `https://buildwithfern.com/learn/home/fern-instructions/docs/publish/domain.md`.

Start with `overview` when you're new to a Fern project. For anything a topic doesn't cover, search the full docs through the [page index](https://buildwithfern.com/learn/llms.txt) or the docs MCP server at `https://buildwithfern.com/learn/_mcp/server`.

## Core

| Topic          | When to use                                                                                                              |
| -------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `overview`     | Start here: how a Fern project is laid out, which file controls what, facts agents get wrong                             |
| `new-site`     | New project, `fern init`, no account, `--guest` for docs and SDKs, claiming a guest session, `fern login`, `fern whoami` |
| `troubleshoot` | An error from `fern check` or `fern generate`, a failed publish, or output that looks wrong                              |

## Docs

| Topic                          | When to use                                                                                                |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------- |
| `docs write`                   | Before creating a page or writing more than a few sentences; frontmatter, snippets, changelogs             |
| `docs write components`        | Callouts, cards, steps, tabs, accordions, code blocks, endpoint snippets, Mintlify-style components        |
| `docs configure`               | Changing `docs.yml`: title, colors, logo, favicon, layout, theme                                           |
| `docs configure navigation`    | Sections, pages, folders, tabs, versions, products, moving or renaming pages                               |
| `docs configure customization` | Custom CSS and JavaScript, React components, banner, hiding content, search, header and footer             |
| `docs configure seo`           | Metadata, slugs, redirects, `robots.txt`                                                                   |
| `docs configure localization`  | Adding a language or updating translations                                                                 |
| `docs api-reference`           | API Reference pages for REST, webhooks, WebSocket, gRPC, GraphQL, OpenRPC; layout, audiences, API Explorer |
| `docs publish`                 | Local preview, preview links, `fern generate --docs`, checking whether a change is live                    |
| `docs publish domain`          | Custom domain, `/docs` subpath, reverse proxy, multi-source docs                                           |
| `docs access`                  | Private docs: password, SSO, JWT, OAuth, RBAC, API key injection                                           |
| `docs ai`                      | `llms.txt`, Markdown access, agent directives, Ask Fern, the site's MCP server and skills                  |
| `docs analytics`               | PostHog, Google, Segment, Mixpanel, Intercom, analytics events                                             |

## API definitions

| Topic             | When to use                                                                                        |
| ----------------- | -------------------------------------------------------------------------------------------------- |
| `spec`            | Getting an OpenAPI spec ready for Fern: `operationId`, tags, `$ref` schemas, examples, errors      |
| `spec extensions` | Any `x-fern-*` extension: names, ignore, pagination, audiences, availability, retries, idempotency |
| `spec overrides`  | Changing a spec you can't edit: overlays versus overrides                                          |
| `spec auth`       | Security schemes, servers, environments, multiple base URLs                                        |
| `spec sync`       | Keeping the spec current: `fern api update`, the `sync-openapi` GitHub Action                      |
| `spec formats`    | AsyncAPI, gRPC, OpenRPC, and Fern Definition specifics                                             |

## SDKs

| Topic              | When to use                                                                                                        |
| ------------------ | ------------------------------------------------------------------------------------------------------------------ |
| `sdks`             | Adding an SDK, `generators.yml` groups and config, `fern generate`, upgrading generators                           |
| `sdks <language>`  | Language-specific setup and config: `typescript`, `python`, `go`, `java`, `csharp`, `php`, `ruby`, `swift`, `rust` |
| `sdks publish`     | npm, PyPI, Maven Central, NuGet, RubyGems, Packagist, crates.io; GitHub output modes; Autorelease                  |
| `sdks custom-code` | Keeping hand-written code: `.fernignore` versus Replay                                                             |
| `sdks features`    | Auth, global headers, pagination, retries, idempotency, WebSockets, SSE, webhook verification                      |
| `sdks local`       | Local generation with Docker, local previews, testing, self-hosted generation                                      |
| `sdks migrate`     | Major generator upgrades and breaking configuration changes                                                        |

## CI and other products

| Topic           | When to use                                                                                                                  |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `automate`      | CI: pin the CLI, `FERN_TOKEN`, `fern check` on pull requests, preview per pull request, publish on merge, SDK release on tag |
| `access team`   | Dashboard members, permissions, organization tokens, SSO, Git repository connection                                          |
| `migrate`       | Moving docs to Fern from Mintlify, ReadMe, or another platform                                                               |
| `cli-generator` | Generating a command-line tool from an API definition                                                                        |