跳到导航

Fern instructions

以 Markdown 格式查看

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 or the docs MCP server at https://buildwithfern.com/learn/_mcp/server.

Core

TopicWhen to use
overviewStart here: how a Fern project is laid out, which file controls what, facts agents get wrong
new-siteNew project, fern init, no account, --guest for docs and SDKs, claiming a guest session, fern login, fern whoami
troubleshootAn error from fern check or fern generate, a failed publish, or output that looks wrong

Docs

TopicWhen to use
docs writeBefore creating a page or writing more than a few sentences; frontmatter, snippets, changelogs
docs write componentsCallouts, cards, steps, tabs, accordions, code blocks, endpoint snippets, Mintlify-style components
docs configureChanging docs.yml: title, colors, logo, favicon, layout, theme
docs configure navigationSections, pages, folders, tabs, versions, products, moving or renaming pages
docs configure customizationCustom CSS and JavaScript, React components, banner, hiding content, search, header and footer
docs configure seoMetadata, slugs, redirects, robots.txt
docs configure localizationAdding a language or updating translations
docs api-referenceAPI Reference pages for REST, webhooks, WebSocket, gRPC, GraphQL, OpenRPC; layout, audiences, API Explorer
docs publishLocal preview, preview links, fern generate --docs, checking whether a change is live
docs publish domainCustom domain, /docs subpath, reverse proxy, multi-source docs
docs accessPrivate docs: password, SSO, JWT, OAuth, RBAC, API key injection
docs aillms.txt, Markdown access, agent directives, Ask Fern, the site’s MCP server and skills
docs analyticsPostHog, Google, Segment, Mixpanel, Intercom, analytics events

API definitions

TopicWhen to use
specGetting an OpenAPI spec ready for Fern: operationId, tags, $ref schemas, examples, errors
spec extensionsAny x-fern-* extension: names, ignore, pagination, audiences, availability, retries, idempotency
spec overridesChanging a spec you can’t edit: overlays versus overrides
spec authSecurity schemes, servers, environments, multiple base URLs
spec syncKeeping the spec current: fern api update, the sync-openapi GitHub Action
spec formatsAsyncAPI, gRPC, OpenRPC, and Fern Definition specifics

SDKs

TopicWhen to use
sdksAdding 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 publishnpm, PyPI, Maven Central, NuGet, RubyGems, Packagist, crates.io; GitHub output modes; Autorelease
sdks custom-codeKeeping hand-written code: .fernignore versus Replay
sdks featuresAuth, global headers, pagination, retries, idempotency, WebSockets, SSE, webhook verification
sdks localLocal generation with Docker, local previews, testing, self-hosted generation
sdks migrateMajor generator upgrades and breaking configuration changes

CI and other products

TopicWhen to use
automateCI: pin the CLI, FERN_TOKEN, fern check on pull requests, preview per pull request, publish on merge, SDK release on tag
access teamDashboard members, permissions, organization tokens, SSO, Git repository connection
migrateMoving docs to Fern from Mintlify, ReadMe, or another platform
cli-generatorGenerating a command-line tool from an API definition