2 min read

@document0/cli

The CLI is a plugin manager for document0. It installs components and plugins from the registry directly into your project and tracks installed versions in a lock file for upgrades.

Install

npm install -D @document0/cli

Or run commands directly with npx:

npx @document0/cli add document0/sidebar

Commands

add

Install one or more plugins or components from the registry.

document0 add document0/sidebar
document0 add document0/sidebar document0/breadcrumbs document0/toc

Files are copied into your project at the path defined by the registry item (e.g. components/document0/sidebar/). A document0.lock.json file is created or updated to track installed versions.

Dependencies declared by the plugin are auto-installed with your detected package manager (npm, pnpm, yarn, or bun).

update

Update installed components and plugins to the latest registry versions.

document0 update                    # update all installed items
document0 update document0/sidebar  # update a specific item

The command compares versions in document0.lock.json against the registry. If a newer version exists, the files are re-fetched and the lock file is updated.

list

List all available items in the registry.

document0 list

Search the registry by name, tag, or description.

document0 search sidebar
document0 search navigation

Lock file

When you run document0 add, a document0.lock.json file is created in your project root:

{
  "version": 1,
  "items": {
    "document0/sidebar": {
      "namespace": "document0",
      "name": "sidebar",
      "version": "0.1.0",
      "installPath": "components/document0/sidebar",
      "installedAt": "2026-03-29T00:00:00.000Z"
    }
  }
}

This file should be committed to your repository. It enables document0 update to detect when newer versions are available.

Registry

The CLI fetches from the public document0 registry on GitHub by default. Override the registry URL with the DOCUMENT0_REGISTRY environment variable:

DOCUMENT0_REGISTRY=https://my-registry.example.com document0 add my-org/my-plugin

Registry categories

CategoryInstall pathDescription
uicomponents/<namespace>/<name>/React components (sidebar, TOC, search dialog, etc.)
coreplugins/<namespace>/<name>/Framework-agnostic utilities (reading time, content graph)
mdxplugins/<namespace>/<name>/Remark/rehype plugins (admonitions, etc.)

Available plugins

NameCategoryDescription
document0/admonitionsmdxGitHub-style blockquote callouts
document0/reading-timecoreAdds reading time and word count
document0/content-graphcoreInternal link graph with backlinks and broken link detection
document0/sidebaruiCollapsible navigation sidebar
document0/tocuiTable of contents with scroll-spy
document0/breadcrumbsuiBreadcrumb navigation
document0/page-navigationuiPrevious/Next page links
document0/search-dialoguiCommand-palette search with keyboard navigation