doc0

CLI reference

Every top-level doc0 command.

Browsing

doc0 <id> routes based on what <id> is: a URL opens the URL TUI / read / search path, anything else is resolved against the registry or installed bundles.

doc0 ls                          # list installed bundles + registry entries
doc0 <id>                        # open the TUI on a registered source or installed bundle
doc0 <id> ls                     # list pages in that source
doc0 <id> search <query...>      # full-text search inside that source
doc0 <id> read <slug> [--raw]    # read one page as Markdown (or JSON with --json)
doc0 browse <id>                 # explicit TUI launcher; same as `doc0 <id>` for non-URLs

For a URL anywhere a source is expected:

doc0 <url>                       # browse
doc0 read <url>                  # read a single page
doc0 search <url> <query...>     # search across discovered pages
doc0 ls <url>                    # discover + list pages without installing

Adding docs

doc0 add <folder>                # synthesize a bundle from any markdown folder
doc0 add --local <folder>        # install an existing bundle dir (one with d0.json)
doc0 add <registry-id>           # install a registry entry with sourceType=bundle
doc0 remove <id>                 # uninstall

Updating the CLI

doc0 update self-updates the global binary from npm:

doc0 update           # check npm for a newer version; install if available
doc0 update --check   # just report current + latest; don't install
doc0 update --json    # machine-readable status (for scripts / CI)

Under the hood this runs npm install -g doczero@latest, so it respects your npm prefix and registry.

Authoring bundles

doc0 init <dir> --name @acme/docs                           # scaffold a new bundle
doc0 build [dir]                                            # validate + compile d0.json
doc0 import <src> --name @acme/... [--out ./imported-bundle] # convert a Markdown dir/file into a bundle

Ingestion (optional)

doc0 ingest pre-populates ~/.d0/docs-store so grep_docs has a local index:

doc0 ingest url <url> [--external] [--max-pages 50000]
doc0 ingest bundle <installed-bundle>

Configuration

Your per-user config lives at ~/.d0rc (YAML or JSON). doc0 config gives you four things: the path, the effective resolved config (file + env merged), an editor launch, and a safe first-run template:

doc0 config path                 # print ~/.d0rc and whether it exists
doc0 config show                 # effective config (file + env + defaults)
doc0 config show --json          # same, as JSON
doc0 config edit                 # open in $VISUAL / $EDITOR (fallback: notepad / vi)
doc0 config edit --editor "code --wait"
doc0 config edit --print         # create the file if missing; print the path (no editor)

On first run, edit writes a commented YAML template covering every option (theme, outputFormat, registryUrl, defaultBundles, keybindings). Env vars like D0_REGISTRY_URL always win over the file — see the registry docs for precedence.

Registry + health

doc0 registry status             # show the configured registryUrl + cache state
doc0 registry sync               # force-refresh the community registry cache
doc0 doctor                      # verify every entry (bundles exist, URLs reachable)
doc0 suggest [dir]               # scan ./package.json and show which deps have coverage

MCP

doc0 mcp                                   # start MCP server on stdio
doc0 mcp --installed-only                  # hide community + seed entries
doc0 mcp install                           # interactive picker (Cursor today; Claude Code / Windsurf soon)
doc0 mcp install --cursor                  # skip the prompt; write ~/.cursor/mcp.json
doc0 mcp install --cursor --project        # write ./.cursor/mcp.json in the current repo
doc0 mcp install --cursor --dry-run        # print merged JSON; write nothing
doc0 mcp install --cursor --yes            # replace an existing mcpServers.d0
doc0 mcp install --list                    # print supported + planned clients

Environment

Every env var is documented on the Configuration page, alongside the ~/.d0rc schema.

Experimental

doc0 browse-opentui              # alternate TUI powered by OpenTUI (requires Bun)

Heads up — experimental. browse-opentui is a second TUI implementation we're prototyping against OpenTUI. It's not feature-complete: no full-text search, no MCP cache integration, no bundle-vs-URL unified routing, no keybinding config, no save-state. Use the default doc0 browse for anything real; browse-opentui exists for anyone curious about the alternate renderer.