Local-first repository documentation with grounded claim→evidence alignment
DocForge Local (docforge-local) generates repository documentation from real implementation evidence, writes Markdown artifacts, and publishes a local MkDocs Material site.
It is local-first and deterministic by default, so the primary workflow works without LLM credentials.
DocForge Local:
- scans a local repository;
- extracts implementation-grounded facts;
- generates documentation pages in Markdown;
- builds a browsable local site;
- optionally runs LLM-assisted generation when explicitly enabled.
Stable user-facing workflows:
doctorgenerate-docsupdate-docsconfig
Stable generated page surface includes:
project_snapshotoverviewarchitecturecode_structureruntime_entrypointsreference_alignmentagent_instruction_alignmentreadme_claim_alignment
Install from PyPI:
uv tool install docforge-localOr run from source:
uv sync
uv run docforge-local --helpGenerate docs in deterministic mode (default):
docforge-local generate-docs --project-root /path/to/repoCheck environment, paths, and optional reference/LLM readiness.
docforge-local doctor --project-root /path/to/repo
docforge-local doctor --project-root /path/to/repo --privacyRun end-to-end generation and local site publishing.
docforge-local generate-docs --project-root /path/to/repoRun the update workflow against an existing documentation set.
docforge-local update-docs --project-root /path/to/repoInteractive configuration management (line-oriented terminal UX).
docforge-local config --project-root /path/to/repoUseful helpers:
docforge-local config --project-root /path/to/repo --show-effective
docforge-local config --project-root /path/to/repo --show-sources
docforge-local config --project-root /path/to/repo --validateLLM mode is opt-in and requires valid OpenAI-compatible settings.
export REPO_AUTODOCS_ENABLE_LLM=true
export REPO_AUTODOCS_MODEL_NAME=gpt-4.1-mini
export REPO_AUTODOCS_BASE_URL=https://api.openai.com/v1
# optional when your endpoint requires auth
export REPO_AUTODOCS_API_KEY_ENV_VAR=OPENAI_API_KEY
export OPENAI_API_KEY=your_api_key_here
docforge-local generate-docs --project-root /path/to/repo --use-llmReliability note: LLM calls use a streaming-first transport. Retries only happen before meaningful streamed output starts. If a stream is interrupted after meaningful output begins, that section fails instead of auto-resending the same prompt.
Precedence:
CLI overrides > environment variables > project config > user config > defaults
Common config files:
- project config:
<project_root>/docforge.toml - user config: platform-specific user config path (override with
REPO_AUTODOCS_USER_CONFIG_FILE)
Secrets:
api_key_mode=env: read key from environment variable;api_key_mode=keyring: set/delete key through keyring-backed flows.
DocForge Local keeps implementation analysis and external-reference analysis separate.
For implementation evidence, DocForge-owned/tool-owned artifacts are excluded by default, including:
docforge.toml.docforge-local/- configured docs/output/site paths when those paths are inside the target repository
This keeps implementation conclusions grounded in project implementation sources rather than DocForge runtime artifacts.
External references can be supplied explicitly (--reference-path, repeatable) and/or discovered through configured defaults.
Routed alignment pages are separate by intent:
reference_alignment— general referencesagent_instruction_alignment— AI-agent instruction filesreadme_claim_alignment— README claims
Default output locations:
- docs root:
<project_root>/.docforge-local/docs/ - generated pages:
<project_root>/.docforge-local/docs/generated/ - built site:
<project_root>/.docforge-local/site/
Markdown artifacts are the source of truth, with MkDocs Material used for local HTML publishing.
Generated section pages can include a Structured Output Diagnostics section when normalization/recovery logic had to intervene.
- a compact summary is shown first;
- detailed events are available in a collapsible
<details>block; - this is a transparency/debug aid and does not automatically mean generation failed.
Debug artifacts remain opt-in:
docforge-local generate-docs --project-root /path/to/repo --debug-artifacts
docforge-local update-docs --project-root /path/to/repo --debug-artifacts- Python 3.12+ is required.
uvis the supported dependency/environment manager.- Deterministic generation is the default baseline.
- LLM mode is optional and explicit.
- Keyring availability depends on host OS/runtime backend support.
