Command-line reference

docsbot [command] [SOURCE] [flags]

SOURCE is a directory (./docs), a single file, or a URL (https://docs.example.com). When it is left out, the current folder is used.

Run docsbot <command> --help for the same information in the terminal.

Exit codes

Code Meaning
0 success
1 findings over the threshold: --fail-level, --fail-under, gaps found, or a draft blocked
2 bad input or a failure

Global flags

These work with every command. Flags override the configuration file.

Flag Default Description
-c, --config ./docsbot.yml if present configuration file
--base-url live site URL for a local repo: absolute links to it count as internal, and agent-ready check runs AFDocs on it
--content-dir auto-detect content root inside a local repo (content/, docs/ …)
--include only pages matching these globs (path relative to the content root, or URL path)
--exclude skip pages matching these globs
--max-pages 2000 stop after this many pages
--no-follow live sites: only read pages listed in llms.txt and the sitemap
--concurrency 8 maximum concurrent HTTP requests
--delay 100ms minimum delay between requests to one host
--timeout 20s per-request timeout
--no-cache don’t read or write the HTTP cache
-f, --format text output format: text or json. check also takes github, sarif, junit; graph view and graph export take their own
-o, --output stdout write output to a file
-q, --quiet no progress output on stderr
-v, --version print the version
-h, --help help for any command

Commands

Command Purpose
check validate links, images, navigation, structure and front matter
links links and images only
rules list every check rule
graph build, explore and export the knowledge graph
audit structure and findability scores, with a fix-first list
agent-ready score and improve how well AI agents can use the docs
convert AsciiDoc to Markdown
draft cited drafts and their review
agent the documentation agent
mcp serve serve docs over the Model Context Protocol
serve development helper: serve a folder as a live site
completion generate a shell completion script (bash, zsh, fish, powershell)

docsbot check

Validate a docs set and report findings with file, line and a hint. Never edits files.

docsbot check [SOURCE] [flags]
Flag Default Description
--only all groups rule groups to run: links, images, structure, metadata, drafts
--rule override a rule’s severity, for example --rule page-orphan=off (repeatable)
--fail-level error lowest severity that exits 1: error, warning, info, off
--offline don’t fetch external URLs
--external-anchors also check #fragments on external pages
--changed-only report only on files changed against --base. Needs a local directory
--base origin/main git ref to compare against with --changed-only

Formats: text, json, github, sarif, junit.

docsbot check docs --only links --offline
docsbot check --changed-only --base origin/main -f github
docsbot check -f sarif -o docsbot.sarif

Shortcut for docsbot check --only links,images. Takes the same flags as check except --only.

docsbot links [SOURCE] [flags]

docsbot rules

List every check rule with its group and default severity. See the rules reference.

docsbot rules

docsbot graph

Build, explore and export the docs knowledge graph. All subcommands take --db.

Flag Default Description
--db docsbot-graph.db, or graph.db in the config graph file to read or write

docsbot graph build

Read SOURCE and write the knowledge graph to a SQLite file.

docsbot graph build SOURCE [flags]

docsbot graph stats

Orphans, dead ends, hubs, clusters, depth, broken edges and naming problems.

docsbot graph stats [SOURCE] [flags]
Flag Default Description
--top 10 items per list

docsbot graph explain

Show what the docs say about one entity, with file and line for each claim.

docsbot graph explain ENTITY [flags]
Flag Default Description
--limit 10 sources per list in text output

docsbot graph view

Draw the graph.

docsbot graph view [SOURCE] [flags]

Formats (-f): html (default; self-contained viewer with search, type filters and a detail panel), mermaid, dot, mindmap (Mermaid mind map around --root), outline (the same tree as a Markdown outline).

Flag Default Description
--root start from this node: an entity, page, tag or ID
--entity this entity and the pages around it
--section pages under this path (for example guide/) and what they touch
--tag pages with this tag and what they touch
--depth 1, or 2 with --root hops from --root, --entity, --tag or --section
--type node types or entity kinds to keep: page, section, entity, tag, content-type, audience, version, owner, repository, partial, missing, command, config-key …
--inferred true include inferred related-to and overlaps-with edges
--max-nodes 2000 keep the most connected nodes (0 for no limit)

docsbot graph export

Export the graph. Takes the same filters as graph view; --max-nodes defaults to 0 (no limit).

docsbot graph export [SOURCE] [flags]

Formats (-f): json (default; nodes, edges and reviews), graphml (Gephi, yEd, Cytoscape, NetworkX), csv (two files, PREFIX.nodes.csv and PREFIX.edges.csv, with PREFIX from -o, default graph), jsonld (each edge reified so its provenance survives), cypher (Neo4j or Memgraph), mermaid, dot.


docsbot audit

Score structure and findability, and write a Markdown report (or JSON with -f json). Exits 1 when the score is below --fail-under.

docsbot audit [SOURCE] [flags]
docsbot audit structure [SOURCE] [flags]
docsbot audit findability [SOURCE] [flags]
Flag Default Description
--tasks findability tasks file (format)
--query-log search query log, CSV (format)
--items 10 items listed per dimension in the Markdown report (0 for all)
--fail-under exit 1 when the score is below this

docsbot audit architecture is reserved: an information architecture review, deferred until there is a rubric to apply.


docsbot agent-ready

docsbot agent-ready check

Score how well AI agents can discover, navigate and read the docs: AFDocs checks plus docsbot’s whole-site checks. Exits 1 when the score is below --fail-under.

docsbot agent-ready check [SOURCE] [flags]
Flag Default Description
--site base_url live URL to run AFDocs against, for a local repo. Without it, a local preview is used
--sample 50 pages sent to AFDocs’ page-level checks, spread across sections (0: every page)
--afdocs auto run AFDocs: auto (when npx is available), on (required), off
--afdocs-arg extra argument passed to AFDocs (repeatable)
--fail-under exit 1 if the overall score is below this

docsbot agent-ready generate

Write llms.txt, llms-full.txt, Markdown copies of pages, a copy-as-Markdown script and discovery snippets. Never changes the docs.

docsbot agent-ready generate [DIR] [flags]
Flag Default Description
--out build/agent-ready output folder; must be outside the content root
--title home page title llms.txt title
--summary home page description llms.txt summary
--no-directive don’t start each Markdown copy with a pointer to llms.txt
--dry-run list what would be written without writing

docsbot convert

Convert AsciiDoc to Markdown in a separate folder, and write convert-report.md and convert-report.json there.

docsbot convert SOURCE --out DIR [flags]
Flag Default Description
--out (required) output folder; must not be the source folder
--target gfm Markdown flavour of the target site: gfm, mkdocs, docusaurus, hugo, commonmark
--anchor-style github heading anchor style of the target site: github, mkdocs, kramdown, sphinx
-a, --attr attribute value, name=value (repeatable); overrides the documents
--unknown keep conditionals that can’t be evaluated: keep or drop (both are reported)
--h1 also write the document title as a level-1 heading (it is always in the front matter)
--check check links and images in the converted Markdown, offline
--dry-run report what would be converted without writing anything

docsbot draft

docsbot draft write

Write a cited draft from the repository’s docs, code and configuration. Writes draft.md, claims.json and review.md.

docsbot draft write TOPIC [SOURCE] [flags]
Flag Default Description
--out drafts/<topic> output folder; never inside the knowledge base
--title the topic page title
--template built-in Markdown template (format)
--kb more local sources: folders or files of Markdown, AsciiDoc, reST or text (repeatable)
--transcript local transcript: .vtt, .srt or .txt (repeatable)
--no-repo don’t use the repository; only --kb and --transcript
--passages 5 source passages per section
--provider config, else none model provider: none, ollama, openai, anthropic
--model config model name
--endpoint config provider endpoint
--allow-remote allow sending source passages to an endpoint off this machine
--force replace an existing draft and its review record

docsbot draft verify

Record a review decision on claims, then rewrite review.md. With no --claim, it only matches the ledger to draft.md and lists what is left.

docsbot draft verify DIR [flags]
Flag Default Description
--claim claim IDs, for example C3 or C3,C4
--status verified verified, rejected, needs-change or unverified
--by $USER reviewer name
--note what was checked, or what must change. Required to verify a claim without a citation

docsbot draft status

Show what is left to review in a draft.

docsbot draft status DIR

docsbot agent

docsbot agent gaps

List what the code defines that the docs miss or describe out of date. Exits 1 when there are gaps.

docsbot agent gaps [SOURCE] [flags]
Flag Default Description
--since git ref: also report items changed or removed since it (for example origin/main, v1.4.0)

docsbot agent run

Find gaps, fetch context over MCP, draft, validate and evaluate. Exits 0 when every draft passed the gate, 1 when a draft is blocked or failed.

docsbot agent run [SOURCE] [flags]
Flag Default Description
--out drafts/agent run folder; never inside the docs
--group draft these groups (IDs from agent gaps) instead of the top --max-drafts
--max-drafts 3 groups to draft, highest priority first
--since git ref: also draft fixes for items changed or removed since it
--min-score 80 evaluation gate, 0–100
--judge also score each draft with the model provider
--no-mcp don’t use the MCP servers in the config
--external-links check external links in the drafts over HTTP
--provider config model provider: none, ollama, openai, anthropic
--model config model name
--endpoint config provider endpoint
--allow-remote allow sending source passages to a model endpoint off this machine
--force replace existing drafts and their review records

docsbot agent eval

Validate and score a draft again, after editing it. Approval needs an evaluation of the current draft.md.

docsbot agent eval DIR [flags]
Flag Default Description
--min-score 80 evaluation gate, 0–100
--judge also score the draft with the model provider
--external-links check external links over HTTP
--provider config model provider for the judge
--model config model name
--endpoint config provider endpoint
--allow-remote allow sending the draft to a model endpoint off this machine

docsbot agent approve

Record a person’s approval of a draft. Refused unless eval.json is an evaluation of the current draft.md, the gate passed, and every claim is verified.

docsbot agent approve DIR [flags]
Flag Default Description
--by $USER approver’s name
--publish write an approved new page into the docs
--force with --publish, replace a page that exists

docsbot mcp serve

Run an MCP server with the read-only tools search_docs and get_passage, over stdio by default.

docsbot mcp serve [SOURCE] [flags]
Flag Default Description
--kb folders or files of Markdown, AsciiDoc, reST or text to serve (repeatable)
--no-repo serve only --kb, not the repository’s pages
--http serve Streamable HTTP on this local address instead of stdio

docsbot serve

Development helper: serve a folder as a live site, so live-site mode and AFDocs can be tried without deploying. Not listed in docsbot --help.

docsbot serve DIR [flags]
Flag Default Description
--addr 127.0.0.1:8484 listen address