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/autodocsYou 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-cliAutodocs 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 initThis will:
- Verify Node.js >= 18 is installed
- Check that at least one AI CLI (
claude,codex, orgemini) is available on your PATH - Create
autodocs.config.jsonwith default settings - Create a
docs/directory with a starterindex.mdxandmeta.json - 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 # LinuxGenerate documentation
Run the generate command to have your AI CLI read your source code and produce MDX documentation:
npx autodocs generateThe 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 --forceChoose 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 geminiPreview locally
Start a local dev server to preview your docs:
npx autodocs devThis 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 buildThe 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 deployThis 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 --previewPrerequisites: 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)