Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions fern/products/cli-api-reference/pages/docs-commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ These commands build, preview, and publish a Fern documentation site, and valida
| [`fern docs theme download`](#fern-docs-theme-download) | Download a theme from Fern's registry into a local directory |
| [`fern docs link check`](#fern-docs-link-check) | Check for broken links on a live documentation site |
| [`fern docs theme list`](#fern-docs-theme-list) | List all themes for your organization |
| [`fern docs theme rebuild`](#fern-docs-theme-rebuild) | Rebuild sites built with an older version of a theme |
| [`fern mcp install`](#fern-mcp-install) | Connect a coding agent to your organization's Fern MCP server |

## Detailed command documentation
Expand Down Expand Up @@ -614,6 +615,44 @@ These commands build, preview, and publish a Fern documentation site, and valida

</Accordion>

<Accordion title="fern docs theme rebuild">

Use `fern docs theme rebuild` to rebuild every site in your organization that was built with an older version of a [theme](/learn/docs/customization/global-themes#updating-a-theme). Each site is rebuilt from its last publish with the latest uploaded theme, so child repositories don't need to publish again. Running it requires an organization admin.

<CodeBlock title="terminal">
```bash
fern docs theme rebuild [--name <name>] [--dry-run] [--org <org>]
```
</CodeBlock>

The command prints each site it rebuilds. Rebuilds run in the background, and each site picks up the theme when its build finishes.

### name

Use `--name` to only rebuild sites using one theme. Defaults to every theme in the organization.

```bash
fern docs theme rebuild --name my-theme
```

### dry-run

Use `--dry-run` to list the sites that would be rebuilt without rebuilding them.

```bash
fern docs theme rebuild --dry-run
```

### org

Use `--org` to override the organization ID from `fern.config.json`.

```bash
fern docs theme rebuild --org my-org
```

</Accordion>

<Accordion title="fern mcp install">

Use `fern mcp install` to register [your organization's Fern MCP server](/learn/docs/ai-features/fern-mcp-servers) with a coding agent, giving it Fern's own documentation and configuration reference alongside your live sites, deployments, analytics, and reader activity — the same tools [Fern Agent](/learn/docs/ai-features/fern-agent) works from.
Expand Down
7 changes: 7 additions & 0 deletions fern/products/docs/pages/customization/global-themes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ fern docs theme export
fern docs theme upload --name my-theme
```

To apply the update without waiting for each child repository to publish again, run [`fern docs theme rebuild`](/learn/cli-api-reference/cli-reference/docs-commands#fern-docs-theme-rebuild). It rebuilds every site in your organization that was built with an older version of the theme, using the content from that site's last publish. Running it requires an organization admin.

```bash
fern docs theme rebuild --name my-theme --dry-run
fern docs theme rebuild --name my-theme
```

## Self-hosted sites

A [self-hosted](/learn/docs/self-hosted/set-up#vendor-a-global-theme) container has no access to Fern's registry, so it resolves `global-theme` from a copy of the theme vendored into the image with [`fern docs theme download`](/learn/cli-api-reference/cli-reference/docs-commands#fern-docs-theme-download).
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Use this to see a change before it ships, or to ship it.
- `fern generate --docs` fails on any `fern check` rule set to `error`.
- In CI, set `FERN_TOKEN` and pass `--no-prompt`. See `automate`.
- Don't publish to production when the user asked for a preview.
- After `fern docs theme upload`, sites using that `global-theme` keep the old theme until they publish again. `fern docs theme rebuild` rebuilds them without a publish. It needs an org admin. Run `--dry-run` first to list the sites.

## Verify

Expand Down
Loading