Zero-Config Mode
docmd features a high-intelligence auto-detection engine. This allows you to generate professional documentation for any project without writing a single line of configuration.
Usage
Simply add the -z or --zero-config flag to your command.
# Start dev server
docmd dev -z
# Build static site
docmd build -z
How It Works
When running in Zero-Config mode, docmd performs the following steps:
- Smart Directory Detection: It scans your project for one of these documentation folders:
docs/,src/docs/,documentation/, orcontent/. If none are found,docmdwill gracefully exit with a helpful message. - Automatic Index Fallback: If no
index.mdorREADME.mdis found in your documentation folder,docmdautomatically designates the first file it finds as the temporary record for your root domain. No more 404s on fresh projects! - Automatic Titling: It reads your
package.json. If found, it automatically sets your sitetitleanddescriptionto match your npm package metadata. - Recursive Routing: It scans all folders and Markdown files to build a nested navigation sidebar.
- Sensible Defaults: It applies the
defaulttheme with system-aware light/dark mode and enables thesearchplugin.
Safety & Performance
Zero-Config is engineered for safety and predictability:
- Context Awareness: By limiting execution to specific folders,
docmdavoids accidentally indexing your entire project root (which might contain thousands of unrelated files like logs or build artifacts). - Recursion Limit: The engine ignores
node_modulesand hidden folders (like.git) and restricts depth to prevent infinite loops. - Bail-out Logic: If no candidate directory is found, or if the directory contains no Markdown files,
docmdwill immediately stop and provide a clean CLI warning rather than hanging.
Zero-config is excellent for AI Agents. Because the structure is predictable and derived from the filesystem, an AI can easily predict where files will be located and update documentation without needing to parse complex configuration schemas.