autodocs
Guide

Getting Started

Install autodocs and generate your first documentation site

Getting Started

Installation

Install autodocs as a dev dependency or use it directly with npx:

npm install --save-dev @cueframe/autodocs

You also need at least one AI CLI installed globally:

# Pick one (or more):
npm install -g @anthropic-ai/claude-code
npm install -g @openai/codex
npm install -g @google/gemini-cli

Autodocs uses these CLIs through your existing subscription — no separate API keys needed.

Initialize your project

Run init to create the configuration file and starter docs directory:

npx autodocs init

This will:

  1. Verify Node.js >= 18 is installed
  2. Check that at least one AI CLI (claude, codex, or gemini) is available on your PATH
  3. Create autodocs.config.json with default settings
  4. Create a docs/ directory with a starter index.mdx and meta.json
  5. Add .autodocs/ to your .gitignore (the build cache directory)

If a config file or docs/index.mdx already exists, they won't be overwritten.

Optionally, install tree for better codebase exploration during generation:

brew install tree    # macOS
apt install tree     # Linux

Generate documentation

Run the generate command to have your AI CLI read your source code and produce MDX documentation:

npx autodocs generate

The AI reads your source files (matching the include/exclude glob patterns in your config), then writes MDX files into the docs/ directory. Progress is streamed in real-time with a spinner showing which files are being read and written.

Incremental generation

By default, autodocs computes SHA-256 hashes of all source file contents and compares them against a local cache at .autodocs/cache/source-cache.json. Only files whose content has actually changed trigger a regeneration. If nothing changed, generation is skipped entirely:

No source files changed since last generation. Use --force to regenerate.

On incremental runs, the AI receives a list of changed files and updates only the affected documentation pages.

Force regeneration

To regenerate everything from scratch, ignoring the cache:

npx autodocs generate --force

Choose a specific CLI

If you have multiple AI CLIs installed, specify which one to use:

npx autodocs generate --cli claude
npx autodocs generate --cli codex
npx autodocs generate --cli gemini

Preview locally

Start a local dev server to preview your docs:

npx autodocs dev

This scaffolds a Fumadocs Next.js app inside .autodocs/, installs its dependencies (first run only), and starts the dev server at http://localhost:3000.

Build for deployment

Build a production-ready site:

npx autodocs build

The output is placed in .autodocs/.next/. Deploy it with any hosting provider that supports Next.js (Vercel, Netlify, etc.).

Deploy to Vercel

Build and deploy in one step:

npx autodocs deploy

This runs a full build first, then deploys to Vercel as a production deployment. On the first deploy, it runs vercel link to connect your project.

To deploy as a preview (non-production) instead:

npx autodocs deploy --preview

Prerequisites: Install the Vercel CLI (npm install -g vercel) and authenticate with vercel login before your first deploy.

CLI reference

autodocs init                         Create config and starter docs/
autodocs generate                     Generate docs (incremental by default)
autodocs generate --force             Regenerate all docs from scratch
autodocs generate --cli <name>        Use a specific AI CLI (claude, codex, gemini)
autodocs dev                          Start local preview at localhost:3000
autodocs build                        Build static site for deployment
autodocs deploy                       Build and deploy to Vercel (production)
autodocs deploy --preview             Deploy as preview (non-production)

On this page