---
title: "Installation"
description: "Get up and running in minutes"
canonical_url: "https://docs.farming-labs.dev/docs/installation"
markdown_url: "https://docs.farming-labs.dev/docs/installation.md"
last_updated: "2018-10-20"
agent:
  tokenBudget: 1200
  task: "Install Farming Labs docs in an existing supported application."
  outcome: "The application renders its docs route locally with the selected theme and machine-readable agent routes."
  appliesTo:
    framework:
      - "nextjs"
      - "tanstackstart"
      - "sveltekit"
      - "astro"
      - "nuxt"
    version:
      - ">=0.2.60"
    package:
      - "@farming-labs/docs"
      - "@farming-labs/theme"
      - "@farming-labs/next"
      - "@farming-labs/tanstack-start"
      - "@farming-labs/svelte"
      - "@farming-labs/astro"
      - "@farming-labs/nuxt"
  prerequisites:
    - "Start in an existing Next.js, TanStack Start, SvelteKit, Astro, or Nuxt project."
    - "Install dependencies with the package manager already used by the project."
    - "Preserve the project's framework, path aliases, and global stylesheet location."
  files:
    - "package.json"
    - "docs.config.ts"
    - "docs.config.tsx"
    - "src/lib/docs.config.ts"
    - "app/docs/page.mdx"
    - "docs/page.mdx"
  commands:
    - run: "pnpm dlx @farming-labs/docs init"
      description: "Detect the current project and scaffold its docs configuration and routes."
    - run: "pnpm exec docs doctor --agent"
      description: "Validate the installed machine-readable docs surface."
  sideEffects:
    - "The initializer installs packages and creates or updates config, routes, styles, and sample docs pages."
  verification:
    - run: "pnpm exec docs doctor --agent"
      expect: "Config, public routes, discovery, Markdown, sitemap, robots, and MCP checks have no hard failures."
    - description: "Start the app and fetch the configured docs route and its .md representation."
      expect: "Both return HTTP 200 and the rendered page uses the selected theme styles."
  rollback:
    - "Restore package.json and the lockfile, then remove only the config, route, style, and sample files created by init."
  failureModes:
    - symptom: "The docs route returns 404."
      resolution: "Confirm the framework adapter route or config wrapper is installed and the configured entry matches the content path."
    - symptom: "The page renders without theme styles."
      resolution: "Import the CSS file for the exact selected theme from the framework's global stylesheet."
---

<!-- farming-labs:agent-contract:start -->
## Agent Contract

Task: Install Farming Labs docs in an existing supported application.
Outcome: The application renders its docs route locally with the selected theme and machine-readable agent routes.

### Applies To

- Framework: `nextjs`, `tanstackstart`, `sveltekit`, `astro`, `nuxt`
- Version: `>=0.2.60`
- Package: `@farming-labs/docs`, `@farming-labs/theme`, `@farming-labs/next`, `@farming-labs/tanstack-start`, `@farming-labs/svelte`, `@farming-labs/astro`, `@farming-labs/nuxt`

### Prerequisites

- Start in an existing Next.js, TanStack Start, SvelteKit, Astro, or Nuxt project.
- Install dependencies with the package manager already used by the project.
- Preserve the project's framework, path aliases, and global stylesheet location.

### Files

- `package.json`
- `docs.config.ts`
- `docs.config.tsx`
- `src/lib/docs.config.ts`
- `app/docs/page.mdx`
- `docs/page.mdx`

### Commands

- `pnpm dlx @farming-labs/docs init` — Detect the current project and scaffold its docs configuration and routes.
- `pnpm exec docs doctor --agent` — Validate the installed machine-readable docs surface.

### Side Effects

- The initializer installs packages and creates or updates config, routes, styles, and sample docs pages.

### Verification

- Run `pnpm exec docs doctor --agent`
  - Expected: Config, public routes, discovery, Markdown, sitemap, robots, and MCP checks have no hard failures.
- Start the app and fetch the configured docs route and its .md representation.
  - Expected: Both return HTTP 200 and the rendered page uses the selected theme styles.

### Rollback

- Restore package.json and the lockfile, then remove only the config, route, style, and sample files created by init.

### Failure Modes

- The docs route returns 404. — Recovery: Confirm the framework adapter route or config wrapper is installed and the configured entry matches the content path.
- The page renders without theme styles. — Recovery: Import the CSS file for the exact selected theme from the framework's global stylesheet.
<!-- farming-labs:agent-contract:end -->

# Installation

## Installation task

Task: Install Farming Labs docs in an existing supported application.

Expected result: The application renders its docs route locally with the selected theme and machine-readable agent routes.

Exact implementation:

```bash title="terminal"
        pnpm add @farming-labs/docs @farming-labs/theme @farming-labs/next
        ```
## Installation prerequisites

- Start in an existing Next.js, TanStack Start, SvelteKit, Astro, or Nuxt project.
- Install dependencies with the package manager already used by the project.
- Preserve the project's framework, path aliases, and global stylesheet location.
- Applies to framework nextjs, tanstackstart, sveltekit, astro, nuxt; version >=0.2.60; package @farming-labs/docs, @farming-labs/theme, @farming-labs/next, @farming-labs/tanstack-start, @farming-labs/svelte, @farming-labs/astro, @farming-labs/nuxt.

## Installation verification

- Run pnpm exec docs doctor --agent. Expected: Config, public routes, discovery, Markdown, sitemap, robots, and MCP checks have no hard failures.
- Start the app and fetch the configured docs route and its .md representation. Expected: Both return HTTP 200 and the rendered page uses the selected theme styles.
- Failure: The docs route returns 404.
- Recovery: Confirm the framework adapter route or config wrapper is installed and the configured entry matches the content path.
- Rollback: Restore package.json and the lockfile, then remove only the config, route, style, and sample files created by init.

## Installation agent guidance

You are an agent helping a user install @farming-labs/docs into an existing app.

Prefer the CLI path first unless the user explicitly wants manual setup.
Keep the framework-specific package names exact.
If the user already told you their framework, do not switch stacks.
When reading `/docs/installation.md` or the MCP page output, preserve the tabbed command variants and
the distinction between existing-project setup and fresh-template setup.
If more repo and product context would help, suggest installing the skills bundle with
`npx skills add farming-labs/docs`.
Once agent skills are available, prefer the `getting-started` and `cli` skills for install, init,
upgrade, and theme setup questions.

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
Docs-scoped sitemap: [/docs/sitemap.md](/docs/sitemap.md).
Well-known sitemap: [/.well-known/sitemap.md](/.well-known/sitemap.md).
