a documentation
that just work with AI.

AI-native, agent-optimized docs with Ask AI, MCP, llms.txt, search adapters, and zero boilerplate.

Get Started
AI-native runtime

Built for humans first, but ready for AI and agents out of the box.

Keep your docs source simple, then layer in Ask AI, MCP delivery, llms.txt, and index-backed search without leaving the same runtime.

# Human + agent ready

AI-native content

Write Markdown and MDX that stays clean for humans while remaining structured enough for AI tools and agents to read, cite, and update confidently.


MarkdownMDXFrontmatterPage actionsReadable sourceAgent-friendly

# Retrieval layer

Ask AI + indexed search

Mix built-in Ask AI with search adapters for simple, Typesense, Algolia, MCP, or custom retrieval so you can keep the indexing flow that fits your stack.


Ask AISimple searchTypesenseAlgoliaMCP searchCustom adapters

# Agent optimized

Agent-optimized delivery

Ship docs to IDEs, agents, and humans from the same source with MCP, llms.txt, API reference, changelogs, and a docs runtime that stays open and portable.


MCPllms.txtAPI referenceChangelogDocs APIOpen runtime
Agent score

How agent-ready are your docs?

Run a public readiness check for llms.txt, markdown routes, OpenAPI discovery, MCP, sitemap, robots, structure, access, and cache hygiene, then compare your docs on the leaderboard.

Quick Start

Up and running in minutes

Easily scaffold your docs with the CLI. It auto-detects your framework and scaffolds everything.

Setup beautiful documentation in seconds

Or set up manually
1

Install

Add the core packages to your Next.js project.

shell
Terminal
pnpm add @farming-labs/docs @farming-labs/theme @farming-labs/next
2

Configure

One file. Theme, metadata, components, icons — everything.

docs.config.ts
Config
import { defineDocs } from "@farming-labs/docs";
import { pixelBorder } from "@farming-labs/theme/pixel-border";

export default defineDocs({
  entry: "docs",
  theme: pixelBorder(),
  metadata: {
    titleTemplate: "%s – My Docs",
  },
});
3

Next Config

Wrap your config with withDocs(). Handles MDX, routing, and search.

next.config.ts
Next Config
import { withDocs } from "@farming-labs/next/config";

export default withDocs({});
4

Root Layout

Wrap your app with RootProvider for search, theme switching, and AI.

app/layout.tsx
Root Layout
import { RootProvider } from "@farming-labs/theme";
import "./global.css";

export default function RootLayout({ children }) {
  return (
    <html lang="en" suppressHydrationWarning>
      <body>
        <RootProvider>{children}</RootProvider>
      </body>
    </html>
  );
}

In app/global.css, import your theme's CSS so docs styling applies (e.g. @import "@farming-labs/theme/default/css"; — use the path that matches your theme).

5

Write docs

Create MDX files under app/docs/. Frontmatter for metadata. That's it.

app/docs/getting-started/page.mdx
MDX Page
---
title: "Getting Started"
description: "Set up in 5 minutes"
icon: "rocket"
---

# Getting Started

Write your content in **MDX** with
frontmatter for metadata.

```ts title="auth.ts"
export const auth = betterAuth({
  database: { provider: "postgresql" },
});
```

See the full installation walkthrough for all generated files and options.

Themes

More themes. Your choice.

Pick a preset or build your own with createTheme(). Override any styles from config.


Default


Clean, neutral palette with standard border radius

@import "@farming-labs/theme/default/css";

Darksharp


All-black, sharp corners, no rounded edges

@import "@farming-labs/theme/darksharp/css";

Pixel Border


Inspired by better-auth.com — refined dark UI

@import "@farming-labs/theme/pixel-border/css";

Colorful


Faithful clone of the fumadocs default neutral theme

@import "@farming-labs/theme/colorful/css";

Shiny


Clerk docs-inspired — clean, polished purple accents

@import "@farming-labs/theme/shiny/css";

Ledger


Stripe Docs-inspired product docs shell with navy code panels

@import "@farming-labs/theme/ledger/css";

DarkBold


Pure monochrome design — clean, bold, minimal

@import "@farming-labs/theme/darkbold/css";

GreenTree


Mintlify-inspired — emerald green, Inter font, modern

@import "@farming-labs/theme/greentree/css";

Hardline


Original hard-edge preset with square corners and strong borders

@import "@farming-labs/theme/hardline/css";

Concrete


Louder brutalist variant with offset shadows and poster-style contrast

@import "@farming-labs/theme/concrete/css";

Command Grid


Mono-first paper-grid preset inspired by the better-cmdk landing page

@import "@farming-labs/theme/command-grid/css";
docs.config.ts
Custom Colors
theme: pixelBorder({
  ui: {
    colors: {
      primary: "oklch(0.72 0.19 149)",     // green
      accent: "hsl(220 80% 60%)",          // blue
    },
  },
}),
Configuration

One file. Full control.

docs.config.ts
Full Example
import { defineDocs } from "@farming-labs/docs";
import { pixelBorder } from "@farming-labs/theme/pixel-border";
import { Rocket, BookOpen, Code } from "lucide-react";

export default defineDocs({
  entry: "docs",
  theme: pixelBorder({
    ui: {
      colors: { primary: "oklch(0.72 0.19 149)" },
      typography: {
        font: {
          h1: { size: "2.25rem", weight: 700 },
          body: { size: "0.975rem", lineHeight: "1.8" },
        },
      },
    },
  }),

  nav: {
    title: <div style={{ display: "flex", gap: 8 }}>
      <Rocket size={14} /> My Docs
    </div>,
  },

  icons: {
    rocket: <Rocket size={16} />,
    book: <BookOpen size={16} />,
    code: <Code size={16} />,
  },
  sidebar: {
    banner: (
      <div>
        <h2>Welcome to the docs</h2>
        <p>This is a banner</p>
      </div>
    ),
    flat: false,
    collapsible: true,  
    footer: (
      <div>
        <p>This is a footer</p>
      </div>
    ),
  },
  components: { MyCustomCallout },

  breadcrumb: { enabled: true },
  themeToggle: { enabled: false, default: "dark" },
  ai: {
    enabled: true,
    mode: "floating",
    floatingStyle: "full-modal",
    apiKey: process.env.OPENAI_API_KEY,
    maxResults: 5,
    aiLabel: "DocsBot",
    suggestedQuestions: [
      "How do I get started?",
      "What themes are available?",
      "How do I create a custom component?",
      "How do I configure the sidebar?",
    ],
    model: {
      models: [
        { id: "gpt-4o-mini", label: "GPT-4o mini (fast)" },
        { id: "gpt-4o", label: "GPT-4o (quality)" },
      ],
      defaultModel: "gpt-4o-mini",
    },
  },
  pageActions: {
    copyMarkdown: { enabled: true },
    openDocs: {
      enabled: true,
      providers: [
        { name: "ChatGPT", urlTemplate: "https://chatgpt.com/?q={url}" },
      ],
    },
  },

  metadata: {
    titleTemplate: "%s – Docs",
    description: "My documentation site",
  },
});