# Nimbus > Docs for the agentic web. Index: https://nimbus-docs.com/llms.txt # Quickstart > Run a Nimbus docs site on your machine in five minutes. Source: https://nimbus-docs.com/quickstart/ · Markdown: https://nimbus-docs.com/quickstart/index.md By the end you'll have a docs site running locally, with a page you've edited. ## Prerequisites - Node 22.23.4 or later (`node --version`) ## Steps 1. **Create the site** ```sh npm create @cloudflare/nimbus-docs@latest -- my-docs --yes yarn create @cloudflare/nimbus-docs my-docs --yes pnpm create @cloudflare/nimbus-docs@latest my-docs --yes bun create @cloudflare/nimbus-docs@latest my-docs --yes ``` 2. **Start the dev server** ```sh cd my-docs ``` ```sh npm run dev yarn run dev pnpm run dev bun run dev ``` 3. **Edit the home page** Open `src/content/docs/index.mdx`, change the title, and save. ## You should see ```text astro v ready in ms ┃ Local http://localhost:4321/ ┃ Network use --host to expose ``` Open `http://localhost:4321/`: your site, with your new title and a sidebar. The scaffolder wrote the layouts, components and styles into `my-docs/`, and they're yours to change. [Search](https://nimbus-docs.com/navigation/search) reads an index the build writes, so it answers once you run `npm run build`, then `npm run preview`. ## Next step [Pages and routing](https://nimbus-docs.com/writing/pages-and-routing): add your first real page. Also: [Deploy to Cloudflare](https://nimbus-docs.com/deploy/cloudflare) · [Project structure](https://nimbus-docs.com/project-structure) # Why Nimbus > Some of the opinions behind Nimbus, what we believe documentation should look like in a world where humans and agents are both creators and consumers. Source: https://nimbus-docs.com/why-nimbus/ · Markdown: https://nimbus-docs.com/why-nimbus/index.md ## You own all your code Layouts, components, content, styles — every visible piece of your site lives in your repo. The scaffolder writes them once and steps back. From there, the project is yours: edit any file, restructure any directory, change any default. No upstream API to wait on, no opinionated theme to fork around. Coding agents work the same way you do. When nothing important hides behind an import boundary, an agent can reason about the repo far better. [Project structure](https://nimbus-docs.com/project-structure) maps every file. ## Interactive content, fully yours Documentation worth reading often needs to *show* mechanism — how a request flows, how state nests, where a wire docks. Either you adopt a pre-styled component library and inherit its look, or you build the interactive bits from scratch. Nimbus splits the problem. `nimbus-docs/react` ships a headless `` wrapper plus composable hooks — `usePhase`, `useMeasure`, `useTabIndicator`, `useDiagram`. The wrapper owns the things that are tedious to get right: off-screen pausing, reduced-motion respect, keyboard shortcuts, error boundaries, cross-island coordination. It renders nothing visible itself. The smallest meaningful example, a two-step diagram with its code, is on [Diagrams and interactive content](https://nimbus-docs.com/writing/interactive-content). Action bars, tabs, and play/pause controls install on demand into `src/components/react/diagram/` — edit, restyle, or replace freely; the hooks keep working. Sites that never author an interactive card pay nothing. ## Human and agent first Documentation is no longer read only by people, and as a result every Nimbus site ships several machine-readable formats alongside the HTML: - A Markdown version of every page at `//index.md` - A site-level index at `/llms.txt`, naming every page - JSON-LD in every page's head, giving search and agent tools enough structured data to recognise what they're looking at ```text # Nimbus A way to build documentation sites on top of Astro. ## Pages - [Quickstart](https://nimbus-docs.com/quickstart/index.md) - [Why Nimbus](https://nimbus-docs.com/why-nimbus/index.md) - [CLI](https://nimbus-docs.com/cli/index.md) ``` These formats are defaults, not add-ons. The cost of being a dead end on the agent web is real, and it grows. ## Agentic authoring You add components and features with `nimbus-docs add`: - **Components and utilities** are copied into your repo as files, with their dependencies. - **Features** are recipes: Markdown your coding agent reads, adapts to your project, and applies. ```sh npx @cloudflare/nimbus-docs add 404-page yarn nimbus-docs add 404-page pnpm nimbus-docs add 404-page bunx @cloudflare/nimbus-docs add 404-page ``` The split between the two modes is the one question that matters: which kind of change actually wants a coding agent in the loop, and which is better as a file copy. ## Authoring quality is first-class A docs site whose content drifts in quality undermines its own product. Nimbus treats authoring quality the way a code linter treats source — a layered set of validators, each catching a different class of mistake. Pre-build validators run automatically and gate the build only when the issue would actually break the site: - **Config validation** — `defineConfig` is checked for shape and required fields; errors echo the offending value back to you - **Frontmatter schema validation** — Zod-typed schemas catch missing or malformed fields per collection, with editor-friendly error messages - **MDX component validation** — a pre-build content pass catches lowercase usages, unregistered components, and missing imports - **Registry validation** — `src/components.ts` is parsed and checked against actual MDX usage at build time The lint engine adds an on-demand authoring-quality layer. Rules have stable identifiers like `nimbus/single-h1` and `nimbus/bare-url`, configured in `astro.config.ts` alongside the rest of your Nimbus integration. Run `nimbus-docs lint` for human output, `--format json` for diagnostics an agent can read, `--fix` to apply auto-fixes. The build is never gated by lint findings — drafts still render, warnings stay loud but unblocking. ```ts title="astro.config.ts" {6-9} import { defineConfig } from "astro/config"; export default defineConfig({ integrations: [ nimbus(nimbusConfig, { rules: { "nimbus/single-h1": "error", "nimbus/bare-url": "warn", }, }), ], }); ``` ## Readable is the floor Every Nimbus site already ships the formats agents read — a Markdown version of each page, an `llms.txt` index, and structured data in the head. A year ago that set a docs tool apart; today it's table stakes. The interesting line sits further out. *Everyone made docs readable by agents. Nimbus makes docs writable, maintainable, and operable by them — end to end, on a codebase you fully own.* This depends on the first principle on this page. When every file lives in your repo, an agent can change your docs safely, not just read them, because it sees everything it's touching. An agent can scrape a vendor's themed runtime, but it can't rewrite one. That's why features arrive as recipes. When `nimbus-docs add` runs inside a coding agent, it hands over a recipe: check whether the feature is already there, discover the project, confirm a plan, apply it, and *verify the build still passes*. Your agent owns the install from start to finish. ```sh # inside a coding agent, the recipe pipes straight in npx @cloudflare/nimbus-docs add new-version yarn nimbus-docs add new-version pnpm nimbus-docs add new-version bunx @cloudflare/nimbus-docs add new-version ``` ```sh # from a human shell, hand it to the agent of your choice npx @cloudflare/nimbus-docs add new-version --print | claude yarn nimbus-docs add new-version --print | claude pnpm nimbus-docs add new-version --print | claude bunx @cloudflare/nimbus-docs add new-version --print | claude ``` ## Provenance is a primitive The moment agents start drafting pages, the question stops being *can a machine read this* and becomes *who wrote this, and has a human checked it.* Because you own the content collections, the answer lives in the schema you control — provenance is a few `schemaFields` away, not a convention bolted on top. The starter ships one such field. Pages are assumed to be for agents too, so `audience: "human"` marks a page written first for people. You add more fields the same way. This site adds `aiGenerated` for pages an agent drafted and no one has reviewed, and shows an "awaiting review" label until someone signs off: ```ts title="src/content.config.ts" import { z } from "astro/zod"; docsCollection({ schemaFields: { audience: z.literal("human").optional(), aiGenerated: z.boolean().optional(), // shows "awaiting review" until cleared }, }) ``` With the field registered, the origin and review state of every page travel with the page itself: ```yaml title="src/content/docs/new-endpoint.mdx" --- title: New endpoint aiGenerated: true # drafted by an agent — shows "awaiting review" until a human clears it --- ``` Provenance only pays off if drift gets caught. The lint engine emits versioned JSON carrying character-precise fixes that `--fix` applies in place, and the scaffolded `AGENT.md` ships an audit recipe with a fixed diagnostic format — so an agent can sweep the whole site and report back in a shape another tool can parse: ```text - [error] src/content/docs/cli.mdx:42 — broken internal link "/instal" — did you mean "/quickstart"? - [warn] src/content/docs/registry.mdx:8 — link text "here" isn't meaningful out of context. Summary: 1 error, 1 warning. ``` The docs become something an agent can keep correct over time — maintained and operable, not just published — on a repo that's yours, not a vendor's. ## The tree is the truth There's no second config to keep in step with your content. The folders under `src/content/` are both the URLs and the sidebar: move a file and its entry moves, delete it and the entry goes. Frontmatter handles the details, such as order, badges and drafts. The result is a single source of truth for what pages exist. The site can't drift from its own contents, because its contents are the site. ## Versions are just collections Most docs tools bolt versioning on as a special case — parallel filesystems, URL rewrites, custom routing. Nimbus does it with a primitive it already has: multi-collection content. Each version is its own content collection, with the same schema. A `docs-v2/` collection is a v2 site; a `docs-v3/` collection is v3. Routes and sidebars pick up each version independently. The version picker is a thin layer on top. - src/content/ - docs/ - docs-v2/ - docs-v3/ The same primitive handles per-product splits (a `docs-api/` collection sits next to `docs-cli/`). When you need versions, you already have most of what you need; you didn't pay for it earlier. # Project structure > What the scaffolder writes into your repo, the line between your files and the framework, and how the tree becomes the site. Source: https://nimbus-docs.com/project-structure/ · Markdown: https://nimbus-docs.com/project-structure/index.md A scaffolded Nimbus project is a regular Astro project. Everything visible lives in your repo as real files; the framework ships the plumbing as a dependency. ## What lands in your repo - my-docs/ - public/ - src/ - components/ - ui/ - content/ - docs/ - layouts/ - lib/ - pages/ - styles/ - globals.css - components.ts - content.config.ts - AGENT.md - CLAUDE.md - astro.config.ts - nimbus.json - package.json - tsconfig.json - pnpm-workspace.yaml - wrangler.jsonc - **`src/components/`** — UI components, yours to edit or replace. - **`src/content/docs/`** — your MDX content. The tree here is the site (see below). - **`src/layouts/`** — page shells (`BaseLayout`, `DocsLayout`). - **`src/pages/`** — routes, including the docs catch-all, alternate Markdown/MDX versions, and `llms.txt` indexes. - **`src/styles/globals.css`** — design tokens and Tailwind layers. - **`src/components.ts`** — the [MDX globals registry](https://nimbus-docs.com/writing/markdown-and-mdx). - **`src/content.config.ts`** — your content collections. - **`AGENT.md`** — the guide for coding agents working in the project. `CLAUDE.md` points to it. - **`nimbus.json`** — a committed record of what your project is made of (see below). - **`pnpm-workspace.yaml`** — pnpm only, for its dependency build-script settings. Yarn sites get `.yarnrc.yml` instead. - **`wrangler.jsonc`** — only when you deploy to Cloudflare. A site with an API reference also has its spec at `src/api/`, its route at `src/pages/api/[...slug].astro`, and the reference components in `src/components/ui/`, recorded in `nimbus.json` like components from `nimbus-docs add`. A site that is only the reference has no `src/content/docs/`, and its route is `src/pages/[...slug].astro`. See [API reference](https://nimbus-docs.com/api-reference/) to configure it. ## `nimbus.json` — the provenance record Alongside your files the scaffolder writes a small, CLI-managed **`nimbus.json`**. It records: - `version` and `templatesTag`: the `create-nimbus-docs` version and the `templates-v*` tag your starter came from. - `lastReviewedNimbusVersion`: the last Nimbus version whose upgrade steps the site has reviewed with [`nimbus-docs migrate`](https://nimbus-docs.com/cli). - `templatesTagByFile`: the tag each file taken with `nimbus-docs diff --apply` came from. - `install.root`: where components install. - `components`: one entry per component you [`add`](https://nimbus-docs.com/cli), with its source registry, the registry release it shipped in, and a content hash. You write your site's behavior, such as versions and the sidebar, in `astro.config.ts`. **`nimbus.json`** is the CLI's half: [`nimbus-docs add`](https://nimbus-docs.com/cli) writes to it, and [`nimbus-docs init`](https://nimbus-docs.com/cli) creates it for a project without one. **Commit it**: it's how upgrades know what you own. (`.nimbus/` is different: gitignored build scratch.) ## The framework boundary The `nimbus-docs` package is the invisible half — the Astro integration, data helpers (`getSidebar`, `getPrevNext`, `getTOC`), content schemas, and helpers for alternate Markdown/MDX versions and `llms.txt` indexes. You import it; you don't fork it. Everything else is yours. There is no upstream theme to override and no API to break — coding agents reason about the repo more easily when nothing important hides behind an import boundary. ## The tree is the truth The directory structure under `src/content/docs/` is the URL structure **and** the sidebar. Move a file and its route and sidebar entry move with it; delete a file and both disappear. Frontmatter handles the fine grain — order, badges, draft state — but the shape of the site comes from the filesystem. - src/content/docs/ - introduction.mdx - guides/ - styling.mdx - deploying.mdx - reference/ - api.mdx There is no second navigation config to keep in sync. The site can't drift from its own contents, because its contents are the site. See [Pages and routing](https://nimbus-docs.com/writing/pages-and-routing) for the details. # CLI > Every nimbus-docs command, with its flags and what it changes. Source: https://nimbus-docs.com/cli/ · Markdown: https://nimbus-docs.com/cli/index.md The `nimbus-docs` CLI lists what's in the registry, installs it, records what you own in [`nimbus.json`](https://nimbus-docs.com/project-structure), shows what's fallen behind upstream, and lints your MDX content. | Command | What it does | | --- | --- | | [`list`](#nimbus-docs-list) | Lists what the registry has. | | [`add `](#nimbus-docs-add-slug) | Installs a component, utility, feature or server adapter. | | [`add source `](#nimbus-docs-add-source-nameurl) | Hands your coding agent a guide for a content source. | | [`init`](#nimbus-docs-init) | Writes `nimbus.json` for a project that lacks one. | | [`migrate`](#nimbus-docs-migrate) | Applies package API migrations and lists upgrade reviews. | | [`outdated`](#nimbus-docs-outdated) | Lists starter files, components and package API work that changed upstream. | | [`diff [file]`](#nimbus-docs-diff-file) | Shows, or takes, the upstream change to a starter file. | | [`check`](#nimbus-docs-check) | Checks the project's setup, config and content without a build. | | [`lint`](#nimbus-docs-lint) | Runs the authoring rules you've turned on. | ## `nimbus-docs list` Lists every installable component, utility, feature and content source. ```sh npx @cloudflare/nimbus-docs list yarn nimbus-docs list pnpm nimbus-docs list bunx @cloudflare/nimbus-docs list ``` Filter by type: ```sh npx @cloudflare/nimbus-docs list --type ui yarn nimbus-docs list --type ui pnpm nimbus-docs list --type ui bunx @cloudflare/nimbus-docs list --type ui ``` ```sh npx @cloudflare/nimbus-docs list --type lib yarn nimbus-docs list --type lib pnpm nimbus-docs list --type lib bunx @cloudflare/nimbus-docs list --type lib ``` ```sh npx @cloudflare/nimbus-docs list --type feature yarn nimbus-docs list --type feature pnpm nimbus-docs list --type feature bunx @cloudflare/nimbus-docs list --type feature ``` ```sh npx @cloudflare/nimbus-docs list --type source yarn nimbus-docs list --type source pnpm nimbus-docs list --type source bunx @cloudflare/nimbus-docs list --type source ``` Running `nimbus-docs add` with no slug shows the same list. ## `nimbus-docs add ` Registry entries use two install modes based on their type. Special `adapter-` slugs use a third flow that rewrites project configuration. ### Components and utilities For `registry:ui` and `registry:lib` slugs, the CLI resolves dependencies, copies files into your repo, and installs any npm packages they need. ```sh npx @cloudflare/nimbus-docs add badge yarn nimbus-docs add badge pnpm nimbus-docs add badge bunx @cloudflare/nimbus-docs add badge ``` 1. **Resolve dependencies** Walks the slug's `registryDependencies` and any npm `dependencies` it needs. 2. **Copy files** Drops each file into the right path under `src/components/ui/`, `src/lib/`, or wherever the entry declares. 3. **Update package.json** Adds npm dependencies if they're not already present. #### Already installed `add` never overwrites files you own. It adds missing files, keeps files that differ from the registry, and lists both. A component that already matches the registry is reported as up to date. #### Replace your copy `--overwrite` replaces files that differ with the registry version, and lists each one. In a terminal, it asks first if you've edited the component or its dependencies. Without a terminal, such as an agent, CI or a pipe, edited components are kept, listed with the command that replaces them, and the command exits `1`. `--overwrite --yes` replaces them and says how many had edits. `add` finds your edits from the install record in `nimbus.json`. For a component that came with the starter, it compares against your starter release, downloaded from GitHub. If that download is rate-limited, set `GIGET_AUTH` to a GitHub token, or pass `--template-dir ` to use a local checkout. With neither, it asks in a terminal and otherwise keeps the files. Commit first, run it, and review the change with `git diff`: ```sh npx @cloudflare/nimbus-docs add badge --overwrite yarn nimbus-docs add badge --overwrite pnpm nimbus-docs add badge --overwrite bunx @cloudflare/nimbus-docs add badge --overwrite ``` For `add`, `--yes` assents to prompts such as dependency installs but still keeps existing files. Use `--overwrite` when you actually mean "replace my files," and `--overwrite --yes` only when you've decided to discard your edits. Once installed, the component is yours to edit; there's no upstream API to break. Each `add` records it in [`nimbus.json`](https://nimbus-docs.com/project-structure) with its slug, registry, release and a content hash, so upgrades can tell what you changed. ### Features For `registry:feature` slugs, there's nothing to copy. The recipe is a markdown prompt the agent reads, adapts to your project, and applies. ```sh npx @cloudflare/nimbus-docs add 404-page yarn nimbus-docs add 404-page pnpm nimbus-docs add 404-page bunx @cloudflare/nimbus-docs add 404-page ``` If the CLI detects a coding agent in the environment, it prints the recipe to stdout for the agent to consume. Otherwise it prints pipe instructions you can run yourself: ```sh npx @cloudflare/nimbus-docs add 404-page --print | claude yarn nimbus-docs add 404-page --print | claude pnpm nimbus-docs add 404-page --print | claude bunx @cloudflare/nimbus-docs add 404-page --print | claude ``` ```sh npx @cloudflare/nimbus-docs add 404-page --print | codex yarn nimbus-docs add 404-page --print | codex pnpm nimbus-docs add 404-page --print | codex bunx @cloudflare/nimbus-docs add 404-page --print | codex ``` Use `--print` to force the markdown output, skipping detection. #### Recipes from a URL `add ` hands the Markdown recipe at any https URL to your agent the same way. It isn't from the Nimbus registry: read it before your agent follows it. A note above the recipe tells your agent where it came from, including the host a redirect led to, with a digest of what was served, and to ask you before it changes CI, deploy config, secrets, environment files, git hooks or package scripts. The [community recipes showcase](https://nimbus-docs.com/community-recipes/showcase) lists recipes other people maintain. ```sh npx @cloudflare/nimbus-docs add https://raw.githubusercontent.com/someone/mcp-chat/main/RECIPE.md yarn nimbus-docs add https://raw.githubusercontent.com/someone/mcp-chat/main/RECIPE.md pnpm nimbus-docs add https://raw.githubusercontent.com/someone/mcp-chat/main/RECIPE.md bunx @cloudflare/nimbus-docs add https://raw.githubusercontent.com/someone/mcp-chat/main/RECIPE.md ``` `add source ` is a different command: it adds a provider's documentation as a [content source](https://nimbus-docs.com/content-sources). ### Server adapters Add the adapter for the host you deploy to: `adapter-cloudflare`, `adapter-netlify`, `adapter-node` or `adapter-vercel`. The CLI installs the Astro adapter and rewrites the marked `output` block in `astro.config`. It refuses to replace a different adapter or a non-literal `output` value. ```sh npx @cloudflare/nimbus-docs add adapter-cloudflare yarn nimbus-docs add adapter-cloudflare pnpm nimbus-docs add adapter-cloudflare bunx @cloudflare/nimbus-docs add adapter-cloudflare ``` `adapter-cloudflare` also does two things: - **Rendering policy.** It adds request rendering when the Nimbus config has none. An existing policy is kept, and an imported or ambiguous config gets a coding-agent handoff instead. - **`wrangler.jsonc`.** It writes a server-compatible one when none exists, or replaces an unchanged static one from Nimbus. A customized `wrangler.jsonc`, or a JSON or TOML config, is left alone. After completing the adapter install, expect: ```ts const nimbusConfig = defineNimbusConfig({ rendering: { default: "request" }, // ... }); export default defineConfig({ output: "server", adapter: cloudflare({ prerenderEnvironment: "node" }), integrations: [nimbus(nimbusConfig)], }); ``` A coding agent running an adapter command gets the same edits as a shell. Sometimes `adapter-cloudflare` can't edit the config safely: there's no marked `output` block, `output` isn't a literal, the config is CommonJS or a symlink, the write fails, or the Nimbus config is imported. It then says why, prints a recipe for your agent to finish the job, and exits `0`. `--print` prints that recipe without changing anything: ```sh npx @cloudflare/nimbus-docs add adapter-cloudflare --print | claude yarn nimbus-docs add adapter-cloudflare --print | claude pnpm nimbus-docs add adapter-cloudflare --print | claude bunx @cloudflare/nimbus-docs add adapter-cloudflare --print | claude ``` Always run the project’s production build afterward. See [Rendering policy](https://nimbus-docs.com/reference/rendering) for per-collection build/request overrides. The equivalent long form is `nimbus-docs add server-output --adapter `. ## `nimbus-docs add source ` Adds a content source: part of the site built from another git repository, a Notion database, or any provider. See [Content from other sources](https://nimbus-docs.com/content-sources/git). ```sh npx @cloudflare/nimbus-docs add source github --print | claude yarn nimbus-docs add source github --print | claude pnpm nimbus-docs add source github --print | claude bunx @cloudflare/nimbus-docs add source github --print | claude ``` | Name | Source | |---|---| | `git`, `github`, `gitlab`, `bitbucket` | Another git repository. The aliases print the same guide with the host's values. | | `notion` | A Notion database. The agent installs `@notionhq/client` and `notion-to-md` and writes `src/loaders/notion.ts`. | | a URL | A provider's documentation: a guide for writing its loader, starting from that URL. | `add source` alone lists them. Like a feature, the guide goes to your coding agent, and the agent writes any code the source needs; `add source` itself writes no files. A source's name on its own, such as `add notion`, points you to `add source notion`. ## `nimbus-docs init` Writes a [`nimbus.json`](https://nimbus-docs.com/project-structure) for a project that lacks one — a repo scaffolded before the record existed, an existing Astro site adopting Nimbus, or a deleted record. Fresh scaffolds already have one, so `init` is the on-ramp for everything else. ```sh npx @cloudflare/nimbus-docs init yarn nimbus-docs init pnpm nimbus-docs init bunx @cloudflare/nimbus-docs init ``` It scans your installed components, matches each against the registry, and writes what it can recover — marking, never guessing: - **matched** — byte-identical to the registry copy. - **modified** — you've edited it; the record keeps the source identity so upgrades can still compare. - **hand-authored** — yours, from no registry. The starter version, `templates-v*` tag, and previously reviewed Nimbus version can't be recovered from the repo alone, so they're left blank (and flagged `reconstructed`). Use `migrate --from ` to establish the upgrade range. ```sh # scan a nested package (monorepo) npx @cloudflare/nimbus-docs init --root packages/docs yarn nimbus-docs init --root packages/docs pnpm nimbus-docs init --root packages/docs bunx @cloudflare/nimbus-docs init --root packages/docs ``` ```sh # rebuild an existing record npx @cloudflare/nimbus-docs init --force yarn nimbus-docs init --force pnpm nimbus-docs init --force bunx @cloudflare/nimbus-docs init --force ``` ## Keeping up to date These commands keep a site current. [Upgrade Nimbus](https://nimbus-docs.com/publish/upgrading) puts them in order for a release. ### `nimbus-docs migrate` Composes every declared breaking change between the project's `lastReviewedNimbusVersion` and the installed Nimbus version. It shows complete diffs for statically proven edits and bounded review tasks for everything else. Customized or ambiguous code is never forced. Existing projects without a reviewed baseline must provide the exact Nimbus version whose migrations they last completed: ```sh pnpm nimbus-docs migrate --from PREVIOUS_VERSION ``` | Flag | Effect | |---|---| | `--dry-run`, `--diff` | Show the plan without changing files. | | `--yes --json` | Apply and report as JSON, for agents. | | `--print` | Print the remaining work as one Markdown handoff for an agent. | | `--src-dir ` | Name Astro's `srcDir` when the config computes it. | The output lists the version range, required reviews, planned diffs, blockers and errors. Files outside the reported scan aren't claimed as checked. Optional upgrade entries come after required work. They never stop a build, but read each one: some describe a change the release makes on its own, such as newly published files. `migrate --yes` records them as reviewed. After completing all reported work, explicitly confirm it and advance the committed reviewed baseline: ```sh pnpm nimbus-docs migrate --from PREVIOUS_VERSION --yes ``` Pass `--from` only when the project has no recorded baseline. In a terminal, `migrate` asks before recording the reviewed version in `nimbus.json`; without one, it records it only with `--yes`. It never records it while a migration remains. A pending required review also stops `astro dev`. With `astro dev --background`, the server only reports that it exited, so run `nimbus-docs check` to see which review. Next, run `outdated`, then `nimbus-docs check`, `astro check` and the production build. ### `nimbus-docs outdated` The read-only "am I behind?" overview across package APIs, starter files, and registry components: ```sh npx @cloudflare/nimbus-docs outdated yarn nimbus-docs outdated pnpm nimbus-docs outdated bunx @cloudflare/nimbus-docs outdated ``` - **Package APIs** — pending migrations and reviews, which `migrate` handles. It also says when a newer Nimbus release is on npm. Reviews about API reference pages are skipped when `src/content.config.*` clearly doesn't use `apiCollection`. - **Registry components** — components that changed upstream, and npm dependencies older than a component needs, with the command to update them. Updates stay review-only, because overwriting can change dependencies too. - **Starter files** — your `src/` files, `AGENT.md`, `CLAUDE.md` and `tsconfig.json`, compared with the upstream `templates-v*` tag. `git diff` can't show this, because that tag was never in your history. Content files are hidden unless you pass `--all`. Files every site rewrites, such as `package.json`, `wrangler.jsonc` and `nimbus.json`, aren't compared. `--json` gives agent-readable findings. `summary.packageApis` counts every migration and review, and `summary.requiredPackageApis` the required ones. A `starter-needs-newer-package` warning means the newer starter needs a newer package than you have, and it blocks `diff --apply`. Without a complete `nimbus.json`, you still get the package API results, marked as partial. ### `nimbus-docs diff [file]` Read-only detail for starter files — what you changed, and what changed upstream: ```sh # every changed starter file npx @cloudflare/nimbus-docs diff yarn nimbus-docs diff pnpm nimbus-docs diff bunx @cloudflare/nimbus-docs diff ``` ```sh # one file npx @cloudflare/nimbus-docs diff src/components/ui/aside/Aside.astro yarn nimbus-docs diff src/components/ui/aside/Aside.astro pnpm nimbus-docs diff src/components/ui/aside/Aside.astro bunx @cloudflare/nimbus-docs diff src/components/ui/aside/Aside.astro ``` | Status | Meaning | |---|---| | clean to pull | Upstream changed it; you didn't. | | added or removed upstream | The file is new upstream, or gone. | | hand-merge | You both changed it. | | your changes | You changed it; upstream didn't. Nothing to pull. | For a clean update, addition or removal, the CLI can apply the change for one file: ```sh npx @cloudflare/nimbus-docs diff src/components/ui/aside/Aside.astro --apply yarn nimbus-docs diff src/components/ui/aside/Aside.astro --apply pnpm nimbus-docs diff src/components/ui/aside/Aside.astro --apply bunx @cloudflare/nimbus-docs diff src/components/ui/aside/Aside.astro --apply ``` `--apply` works one file at a time and never merges: it rechecks that the file is still unedited, then writes. It records the tag in `nimbus.json` (`templatesTagByFile`), so later diffs start from there. Review with `git diff` afterward. Starter route files are compared in your site's rendering mode, so a route updated by `check --fix` doesn't show as your change. `--to ` compares against a specific tag, and `--template-dir ` against a local checkout. ## `nimbus-docs check` A build-free preflight. It checks the environment, project structure, pending migrations, authoring rules, and types, then reports whether the site can build: ```sh pnpm nimbus-docs check ``` Pass `--env`, `--structure`, `--migrations`, `--lint`, or `--types` to run only those categories. `--fix` applies the fixes it can make safely and asks before any fix that needs a value or installs a dependency. Without a terminal it skips the questions and installs only with `--yes`. `--quiet` shows errors only. `check` reports each route file Nimbus manages whose mode disagrees with [`rendering`](https://nimbus-docs.com/reference/rendering) (`nimbus/route-file-mode`). Without `rendering`, that's building each of them ahead of time. `--fix` updates the file and lists every file it wrote. For a route it can't fully edit, it makes the changes it can and lists what's left. `--types` type-checks your `.ts` and `.tsx` files with your own TypeScript. It doesn't read `.astro` files; run `astro check` for those. `check` exits `1` when an error-severity finding remains, and `0` otherwise. Warnings, informational findings, and checks that couldn't run never change the exit code. Pass `--json` for agent-readable output. `status` is `passed`, `failed`, or `partial` (some checks couldn't run), and `readiness` is `buildable`, `blocked`, or `unknown`. Each finding has one of three severities: | Severity | Meaning | |---|---| | `error` | Must be fixed. Counted in `summary.errors` and sets the exit code to `1`. | | `warn` | Advisory, such as the placeholder `site` URL. Counted in `summary.warnings`. | | `info` | Informational only, such as an optional upgrade entry from `migrate`. Not counted in the summary. | Checks that couldn't run are listed as `notes` on their scope rather than as findings, each with the reason it was skipped. In the terminal, a scope with notes shows `◐ ok, partly checked`. `check` checks links only when an earlier `astro build` left `.nimbus/routes.json`; without it, link checking is a note, not an error. To gate CI on links, run `astro build` and then `nimbus-docs lint`; see [Check links](https://nimbus-docs.com/writing/linting#check-links). ## `nimbus-docs lint` Runs the authoring rules you've turned on over `src/content/`, and over collections that load from elsewhere, such as [content sources](https://nimbus-docs.com/content-sources/git). It exits non-zero when an `error` finding remains. Lint never blocks the build. ```sh npx @cloudflare/nimbus-docs lint yarn nimbus-docs lint pnpm nimbus-docs lint bunx @cloudflare/nimbus-docs lint ``` Flags — combine with `lint`: | Flag | Effect | |---|---| | `--format=json` | agent-readable diagnostics | | `--rule=nimbus/single-h1` | run one rule only | | `--fix` | apply auto-fixes in place | | `--quiet` | errors only, suppress warnings | You set rules in the integration (`nimbus(config, { rules })`), and `astro build`, `astro dev` or `astro sync` writes them to `.nimbus/lint.json`. Without that file, `lint` exits `1` and asks you to build first, unless `--rule` names a rule. If the rules changed since, it asks you to run `astro sync`. `nimbusDisableRules` frontmatter and inline comments turn rules off in one file, with no config. `nimbus/internal-link` and `nimbus/redirected-link` need `astro build` to run first. Without the route list the build writes, lint exits `1` with an error on `.nimbus/routes.json`. ## Help and version ```sh npx @cloudflare/nimbus-docs --help yarn nimbus-docs --help pnpm nimbus-docs --help bunx @cloudflare/nimbus-docs --help ``` ```sh npx @cloudflare/nimbus-docs --version yarn nimbus-docs --version pnpm nimbus-docs --version bunx @cloudflare/nimbus-docs --version ``` # Registry > Where nimbus-docs add finds installable components, utilities, features, and content sources. Source: https://nimbus-docs.com/registry/ · Markdown: https://nimbus-docs.com/registry/index.md The registry is what `nimbus-docs add` reads from. Four types of entries: components and utilities copy as files; features and content sources hand off a guide to a coding agent. ## Four types - **`registry:ui`** — UI components. Copied into `src/components/ui//`. Examples: Badge, Card, Steps. - **`registry:lib`** — Standalone utilities. Copied to specific paths. Example: `cn` → `src/lib/cn.ts`. - **`registry:feature`** — Agent-handoff recipes. Nothing copies; the CLI prints markdown the agent reads, adapts to your project, and applies. Example: 404-page. - **`registry:source`** — Content sources, added with `nimbus-docs add source `. A guide for the agent, which writes any code the source needs into your site. Examples: `github`, `notion`. ## Anatomy of an entry ```ts badge: { type: "registry:ui", title: "Badge", description: "Small status / category pill.", registryDependencies: ["cn"], }, ``` - **`type`** — `registry:ui`, `registry:lib`, `registry:feature`, or `registry:source`. - **`registryDependencies`** — other slugs the CLI must install first. Walked transitively. - **`dependencies`** — npm packages added to `package.json`. ## Install graph When you run `npx @cloudflare/nimbus-docs add accordion`, the CLI walks the slug's dependency graph: ``` accordion ├── collapsible └── cn ``` It installs `collapsible` and `cn` before `accordion`. Each lands at the path declared in the manifest. Duplicates are skipped. Features don't have an install graph — the recipe is self-contained markdown the agent applies inside your existing layout. ## Features A feature is an agent-handoff recipe — nothing copies as files. Install any with `npx @cloudflare/nimbus-docs add `; the CLI prints a brief your coding agent adapts to your project and applies. - `pagefind-search` — static full-text search and the Nimbus search dialog. - `ai-native` — `llms.txt` indexes, alternate Markdown/MDX versions, `robots.txt`, and an `AgentDirective`. - `mermaid` — lazy, theme-aware Mermaid diagrams with a full-screen expand. - `404-page` — a brand-matched 404 page for your docs. - `lint-prose-textlint` — textlint with write-good, alex, and terminology rules. - `changelog` — a dated `/changelog` feed with tags, RSS, and permalinks. - `component-showcase` — a `/components` grid and per-component pages for your UI. - `new-collection` — a non-version content tree: blog, API, or glossary. - `api-reference` — mount an OpenAPI spec as generated reference pages with alternate Markdown versions, styled with the owned `api-layout` / `api-sidebar` / `api-field-row` / `api-code-rail` components. - `try-it` — let readers send requests from API reference pages, direct or through the site's proxy, with the owned `api-try-it` panel. - `new-version` — wire a new docs version end-to-end, with a switcher. For recipes other people maintain, see the [community recipes showcase](https://nimbus-docs.com/community-recipes/showcase). ## Sources A source builds part of the site from somewhere other than `src/content`. Add one with `npx @cloudflare/nimbus-docs add source `: - `git` (also `github`, `gitlab`, `bitbucket`) — pages from another git repository, checked out at build time. - `notion` — pages from a Notion database; the agent writes `src/loaders/notion.ts` from the guide. - a URL — a guide for writing a loader for any other provider, from its docs. See [Content from other sources](https://nimbus-docs.com/content-sources/git). ## Content recipes Templates for writing one page of a given shape — the agent scaffolds the structure for you to fill in. Same command: `npx @cloudflare/nimbus-docs add `. - `content-overview` — orient in one paragraph, then route onward. - `content-quickstart` — the shortest honest path to one working result. - `content-tutorial` — numbered parts that build one real project. - `content-how-to` — numbered steps from a goal to a verified outcome. - `content-concept` — what a thing is, why, and where its edges are. - `content-reference` — a complete, neutral, templated lookup page. - `content-example` — runnable code to copy whole, prose where needed. - `content-troubleshooting` — symptoms, causes, and fixes, titled by search terms. - `content-changelog` — dated, categorized records that flag breakage. # Pages and routing > How the filesystem under src/content/docs becomes your routes and sidebar. Source: https://nimbus-docs.com/writing/pages-and-routing/ · Markdown: https://nimbus-docs.com/writing/pages-and-routing/index.md A page is a `.md` or `.mdx` file under `src/content/docs/`. Its path on disk is its URL and its place in the [sidebar](https://nimbus-docs.com/navigation/sidebar) — there is no separate routing or navigation config. ## File to URL | File | URL | |---|---| | `src/content/docs/guides/install.mdx` | `/guides/install/` | | `src/content/docs/guides/styling.mdx` | `/guides/styling/` | | `src/content/docs/guides/index.mdx` | `/guides/` | The URLs end in a slash with Astro's default `trailingSlash` and `build.format`; see [Links and trailing slashes](https://nimbus-docs.com/reference/configuration#links-and-trailing-slashes). Slugs are lowercased and folder `index` files collapse to the directory URL. A directory's `index.mdx` becomes the landing page for that section. - src/content/docs/ - introduction.mdx - guides/ - index.mdx - styling.mdx ## Custom Astro routes Files you add under `src/pages/` use Astro's native routing and rendering semantics. In a server-output project, a page or endpoint renders on request by default; set Astro's `prerender` export when you want to make the choice explicit: ```astro title="src/pages/status.astro" --- export const prerender = false; ---

Service status

``` ```ts title="src/pages/api/ping.ts" export const prerender = false; export function GET() { return new Response("pong"); } ``` Use `export const prerender = true` to emit a custom route as static output during the build. No Nimbus route registration or allowlist is required. This boundary is not limited to `prerender`. Dynamic segments, endpoint methods, redirects and responses, and other native Astro route behavior remain controlled by the route itself. Nimbus only intervenes when a route claims the exact pattern of a configured canonical content route, package-injected infrastructure, an active feature, or a published content entry. Nimbus's `rendering` configuration controls the routes it manages: each collection's catch-all route, and the scaffolded `llms.txt` and Markdown routes that call a Nimbus factory. Those files are yours to edit, but `rendering` decides how they render; `nimbus-docs check --fix` keeps them in step. Other files under `src/pages/`, such as Open Graph images and `robots.txt`, use Astro's native rendering behavior like any other route. ## Page modes Every page renders inside `DocsLayout` by default — sidebar, table of contents, breadcrumbs, prev/next. Opt a page out of all chrome with `mode`: ```yaml --- title: Welcome mode: custom --- ``` `mode: custom` is for landing pages and bespoke layouts. Per-column toggles (`sidebar: false`, `tableOfContents: false`) turn off individual pieces without going fully custom — see [Layouts](https://nimbus-docs.com/styling/layouts). ## Drafts `draft: true` keeps a page out of production builds and the `llms.txt` indexes, while still rendering under `astro dev` (treated as `noindex`). Use it for work in progress. ```yaml --- title: Experimental feature draft: true --- ``` ## Collections `src/content/docs/` is the primary collection, served at the site root. To add another, such as a blog, see [Collections](https://nimbus-docs.com/writing/collections). For route and URL helpers, see [Package API](https://nimbus-docs.com/styling/package-api#urls). # Collections > Add a collection beside your docs, such as a blog or an SDK guide, and choose the URL it's served at. Source: https://nimbus-docs.com/writing/collections/ · Markdown: https://nimbus-docs.com/writing/collections/index.md ## Add a collection `src/content/docs/` is the primary collection, mounted at the site root. Additional collections (a `blog`, an `api`, a versioned `docs-v2`) are served at their own URL: where their route file is, or `/` by default (see [Collection URLs](#collection-urls)). Register them in `src/content.config.ts` with the factories from `@cloudflare/nimbus-docs/content`. Nimbus's `docsCollection()`, `partialsCollection()`, and `componentsCollection()` factories prepare content for links, alternate Markdown/MDX versions, `llms-full.txt`, and partial headings automatically. If you register a loader that stores Markdown bodies directly, wrap it with `withNimbusMarkdown()`: ```ts title="src/content.config.ts" import { defineCollection } from "astro:content"; import { glob } from "astro/loaders"; import { withNimbusMarkdown } from "@cloudflare/nimbus-docs/content"; export const collections = { blog: defineCollection({ loader: withNimbusMarkdown( glob({ base: "./src/content/blog", pattern: "**/*.{md,mdx}" }), ), }), }; ``` The wrapper preserves the loader's methods and lifecycle. Use it when a loader stores entries with a Markdown `body`. A page collection's files can live anywhere. For content in another repository or a CMS, see [Content from another repository](https://nimbus-docs.com/content-sources/git). - **A folder outside `src/`**, such as a shared folder in a monorepo, works exactly like a page under `src/content`. - **A loader with no files**, such as a CMS, gets routes, the sidebar, citations, links, Markdown versions, `llms.txt` and search. Its pages are Markdown only, so no callouts or components, and lint skips it. It must reject duplicate ids itself, because without files Nimbus can't tell a collision from an update. Two files with the same slug fail the build. A collection made with `docsCollection()`, `componentsCollection()` or a `withNimbusMarkdown()` loader becomes pages: routed, and included in search, the sitemap, `llms.txt` and Markdown versions. `apiCollection()` does the same for API references, with Nimbus's renderer. Every other collection is plain Astro data. Nimbus leaves it alone, and `getCollection()` works as usual. Collection names carry no meaning. ## Collection URLs A collection is served where its route file is. Put the route at `src/pages/products/sdk/[...slug].astro` and the `sdk` collection is served at `/products/sdk/…`: pages, the sidebar, breadcrumbs, Markdown versions, `llms.txt`, the sitemap, search, social cards and, for an API, `openapi.json` and the API catalog. There is no config key; moving a section is moving its folder. ```astro title="src/pages/products/sdk/[...slug].astro" --- import DocsLayout from "../../../layouts/DocsLayout.astro"; import { getCollectionPage, getCollectionStaticPaths } from "@cloudflare/nimbus-docs/runtime"; export const getStaticPaths = getCollectionStaticPaths("sdk"); const page = await getCollectionPage(Astro, "sdk"); if (page instanceof Response) return page; const { entry, Content, headings, markdownUrl, ogImageUrl } = page; // The rest matches your root src/pages/[...slug].astro: sidebar, previous and next, layout. --- ``` `nimbus-docs add new-collection` writes the whole route for you. Relative imports such as the layout's grow one `../` per folder level. Nimbus reads the collection from the route's exported `getStaticPaths`: `getCollectionStaticPaths("…")`, `getApiStaticPaths("…")` or `getDocsStaticPaths`, assigned directly (`export const getStaticPaths = …`), or returned from `export async function getStaticPaths()`. Every collection route also names the collection in its page helper: `getCollectionPage(Astro, "sdk")`, and likewise `getCollectionPageProps`, `getApiRoute` and `getApiPage`. That's what a route rendered on request, which has no `getStaticPaths`, needs, and naming it on built routes too keeps the file the same in either mode. The names must match. Docs routes use `getDocsPage(Astro)`, whose name says the collection. Pass the collection name as a string literal, or an exported const holding one. Astro runs `getStaticPaths` apart from the rest of the frontmatter, so anything it uses at the top level must be imported or exported (`export const name = "sdk"`); `export { getStaticPaths }` doesn't compile. A route Nimbus can't read, such as a wrapper imported from another module, keeps the collection at its default URL. The build and `check` warn about one in a nested folder (`nimbus/collection-unread-route`), and its pages fail the build when they render, naming the route. The rules: - `docs` is served at the site root, and a docs version (`docs-v1`) at `/v1`. A docs route away from the root isn't supported yet; for a site that is all docs under one path, set Astro's `base` (`base: "/docs"`). - Any other collection with a route is served at the route's folder, the root included. Without one, it's served at `/`, as before. - One route file serves one collection. A route under a dynamic folder (`src/pages/[locale]/sdk/[...slug].astro`) doesn't set a URL; a collection other than `docs` served only from routes like that is an error. Rendered on request, such a route finds its collection by the URL segment before the page, so it serves only collections at a one-segment URL (`/sdk`). - Several static routes for one collection: the one at its default URL serves it. The others still build their pages (or serve them, for a collection rendered on request), which duplicate the collection's in the sitemap and search, so the build and `check` warn (`nimbus/collection-alias-route`); delete them or redirect them. With none at the default, it's an error. - A collection a route moved owns everything below its URL. Another collection's page under `/products/sdk` is an error, except under a collection nested deeper (`/products/sdk/cli` is its own). A collection at its default URL (`/sdk`) leaves pages under it as they were. - An API collection can be served at the site root, for a site that is only an API reference: put its route at `src/pages/[...slug].astro` and leave out `docs`. `nimbus-docs check` lists where each collection is served when a route moves one, and `check --json` always includes the list as `collections`. To link to a collection from a component, use `getCollectionUrl`, which returns the URL without `base`. A name that isn't a page collection fails the build: ```astro --- import { getCollectionUrl, withBase } from "@cloudflare/nimbus-docs/runtime"; const sdkHref = withBase(await getCollectionUrl("sdk"), import.meta.env.BASE_URL); --- ``` Moving a route moves every URL in that collection, so add a [redirect](https://nimbus-docs.com/navigation/redirects) from the old URLs. Until you do, `nimbus-docs lint` reports links to them as broken and suggests the new URL. Afterwards, [`nimbus/redirected-link`](https://nimbus-docs.com/writing/linting) finds links still going through the redirect. In `astro dev`, moving a route file restarts the server and logs the redirect to add. After that restart, restart the dev server yourself if content edits stop showing. A collection nested inside a docs folder appears inside that folder in the sidebar, breadcrumbs and previous and next links; see [Show a collection inside a folder](https://nimbus-docs.com/navigation/sidebar#show-a-collection-inside-a-folder). A nested collection's own `llms.txt` needs the starter's `src/pages/[...section]/llms.txt.ts` route. With a `[section]` route instead, the root `llms.txt` lists the collection's pages. The build and `nimbus-docs check` report collection routing mistakes with the file and the fix. See [Build and check findings](https://nimbus-docs.com/reference/lint-rules#build-and-check-findings) for every code. # Markdown and MDX > Write content in Markdown or MDX, use components without imports, and let the build catch broken tags. Source: https://nimbus-docs.com/writing/markdown-and-mdx/ · Markdown: https://nimbus-docs.com/writing/markdown-and-mdx/index.md Content is Markdown (`.md`) or MDX (`.mdx`). MDX lets you drop components straight into prose — cards, tabs, steps, asides, and anything you build. ## The components registry Components listed in `src/components.ts` are available in every MDX file **without an import**: ```ts title="src/components.ts" import { Aside } from "./components/ui/aside"; import { Card } from "./components/ui/card"; import { CardGrid } from "./components/ui/card-grid"; export const components = { Aside, Card, CardGrid, }; ``` ```mdx Built on Astro. ``` Anything not in the registry must be imported at the top of the file: ```mdx import { FileTree } from "@/components/ui/file-tree"; - src/ ``` ## Build-time validation A pre-build content pass checks every PascalCase tag in `src/content/**/*.mdx` against the registry plus per-file imports. Unknown components, lowercase usages, and missing imports **fail the build** instead of silently rendering as literal text on the deployed page. Opt out with `validateMdx: false` in the integration options. ## Admonitions In `.mdx` files, Sätteri parses fenced `:::` directives and Nimbus renders them with `