CmdocsCmdocs
Configuration

docs.json Reference

The single source of truth for your cmdocs site — name, theme, navigation, navbar, and SEO.

docs.json

Every cmdocs project has one docs.json file at its root. It defines what your site is called, how it looks, and how its pages are organized.

docs.json
index.mdx
quickstart.mdx
setup.mdx

Minimal example

The smallest valid docs.json only needs a name and a navigation object:

docs.json
{
  "name": "My Docs",
  "navigation": {
    "tabs": [
      {
        "label": "Documentation",
        "path": "documentation",
        "groups": [
          {
            "label": "Getting Started",
            "pages": [
              { "file": "index" },
              { "file": "quickstart" }
            ]
          }
        ]
      }
    ]
  }
}

Top-level fields

Prop

Type

Favicon

Use a single file for every theme, or supply separate light and dark variants. When both are set, the browser tab icon follows the user's system theme via prefers-color-scheme.

docs.json — single favicon
{
  "favicon": "/favicon.svg"
}
docs.json — light/dark pair
{
  "favicon": {
    "light": "/logo/favicon-light.svg",
    "dark": "/logo/favicon-dark.svg"
  }
}

Paths are resolved against the project root (/favicon.svg reads from public/favicon.svg). dark is optional — if you omit it, the light icon is used in both themes.

Theme

Customize colors and appearance through the theme field. See Theme Configuration for the full reference.

docs.json
{
  "theme": {
    "preset": "neutral",
    "colors": {
      "primary": "#2563EB"
    },
    "darkMode": true,
    "breadcrumb": true,
    "lastUpdated": true
  }
}

The navbar holds your title, logo, GitHub link, and any custom links. See Navigation Configuration for navbar link types.

docs.json
{
  "navbar": {
    "title": "My Project",
    "logo": {
      "light": "/logo/light.svg",
      "dark": "/logo/dark.svg",
      "display": "logo-only"
    },
    "github": "https://github.com/owner/repo",
    "transparent": false,
    "homeUrl": "/",
    "links": [
      {
        "text": "Dashboard",
        "href": "https://app.example.com",
        "icon": "LayoutDashboard",
        "external": true
      }
    ]
  }
}

Prop

Type

The logo field controls what appears at the top-left of the navbar. There are three ways to use it.

As a string

A simple icon (square, ~24×24) shown next to your site title:

{
  "navbar": {
    "title": "My Project",
    "logo": "/logo/icon.svg"
  }
}

With light/dark variants (icon + title)

{
  "navbar": {
    "title": "My Project",
    "logo": {
      "light": "/logo/light-logo-only.svg",
      "dark": "/logo/dark-logo-only.svg"
    }
  }
}
{
  "navbar": {
    "logo": {
      "light": "/logo/light.svg",
      "dark": "/logo/dark.svg",
      "display": "logo-only",
      "width": 140,
      "height": 36
    }
  }
}

The title field is hidden in logo-only mode — your image should already contain the brand name.

light.svg
dark.svg
light-logo-only.svg
dark-logo-only.svg
FilePurposeShape
light.svg / dark.svgFull brand logo (icon + text)Rectangular, ~140×36
light-logo-only.svg / dark-logo-only.svgIcon onlySquare, ~24×24

Logo props

Prop

Type

Provide either src (single image) or both light and dark (theme variants).

The navigation field defines your sidebar. It uses a tabs → groups → pages hierarchy. See Navigation Configuration for the full reference.

docs.json
{
  "navigation": {
    "tabMode": "auto",
    "tabs": [
      {
        "label": "Documentation",
        "path": "documentation",
        "groups": [
          {
            "label": "Getting Started",
            "pages": [
              { "file": "index" },
              { "file": "quickstart" },
              { "file": "installation" }
            ]
          },
          {
            "label": "Guides",
            "pages": [
              { "file": "guides/setup" },
              { "file": "guides/advanced" }
            ]
          }
        ]
      }
    ]
  }
}
docs.json
{
  "footer": {
    "text": "Built with cmdocs",
    "copyright": "© 2026 My Company",
    "links": [
      { "text": "GitHub", "href": "https://github.com/owner/repo" },
      { "text": "Privacy", "href": "/privacy" }
    ],
    "socials": {
      "twitter": "https://twitter.com/handle",
      "discord": "https://discord.gg/invite"
    }
  }
}

Prop

Type

SEO

docs.json
{
  "seo": {
    "title": "My Docs",
    "titleTemplate": "%s — My Docs",
    "description": "Documentation for my project",
    "ogImage": "/og-image.png",
    "canonical": true,
    "robots": "index, follow"
  }
}

The titleTemplate uses %s as a placeholder for each page's title — for example, "%s — My Docs" produces "Quickstart — My Docs".

Prop

Type

Search is on by default and uses Orama for client-side full-text indexing.

docs.json
{
  "search": {
    "enabled": true,
    "provider": "orama"
  }
}

Prop

Type

Set enabled: false to remove the search box and disable indexing entirely.

AI

Generate machine-readable documentation files for LLMs and AI agents.

docs.json
{
  "ai": {
    "llmsTxt": true,
    "llmsFullTxt": true
  }
}

Prop

Type

Both files are produced at the root of your built site (e.g. https://docs.example.com/llms.txt). They follow the llms.txt convention.

OpenAPI

Render OpenAPI specs as API reference pages.

docs.json
{
  "openapi": {
    "specs": [
      { "path": "openapi/api.yaml" }
    ]
  }
}

Prop

Type

Each spec entry has a single field:

Prop

Type

i18n

Configure internationalization. Locale codes follow the BCP 47 format.

docs.json
{
  "i18n": {
    "defaultLocale": "en",
    "locales": ["en", "fr", "ja"]
  }
}

Prop

Type

Validation

cmdocs validates your docs.json against a JSON schema on every build. To get autocomplete and inline errors in your editor, add the $schema field at the top:

docs.json
{
  "$schema": "https://cmdocs.sh/schema/docs.json",
  "name": "My Docs"
}

Full example

A complete docs.json with every common option:

docs.json
{
  "$schema": "https://cmdocs.sh/schema/docs.json",
  "name": "My Project",
  "description": "Documentation built with cmdocs",
  "favicon": "/logo/icon.svg",
  "baseUrl": "https://docs.example.com",
  "theme": {
    "preset": "neutral",
    "colors": { "primary": "#2563EB" },
    "darkMode": true,
    "breadcrumb": true,
    "lastUpdated": true
  },
  "navbar": {
    "title": "My Project",
    "logo": {
      "light": "/logo/light.svg",
      "dark": "/logo/dark.svg",
      "display": "logo-only"
    },
    "github": "https://github.com/owner/repo",
    "links": [
      { "text": "Dashboard", "href": "https://app.example.com", "external": true }
    ]
  },
  "navigation": {
    "tabs": [
      {
        "label": "Documentation",
        "path": "documentation",
        "groups": [
          {
            "label": "Getting Started",
            "pages": [
              { "file": "index" },
              { "file": "quickstart" }
            ]
          },
          {
            "label": "Guides",
            "pages": [{ "file": "guides/setup" }]
          }
        ]
      }
    ]
  },
  "footer": {
    "text": "Built with cmdocs",
    "copyright": "© 2026 My Company"
  },
  "seo": {
    "title": "My Project Docs",
    "titleTemplate": "%s — My Project",
    "ogImage": "/og-image.png"
  }
}

How is this guide?

On this page