Skip to content

CLI

A usage error prints this summary. Each command’s page describes its arguments and flags, with examples and its exit codes.

Usage:
archidocs version [--format text|json]
archidocs init [--skill [--workspace <dir>]]
archidocs guide [topic] [--skill <id>]
archidocs check [--format text|json|github] [--strict]
archidocs gaps [--project <id>] [--owner <team>] [--json]
archidocs build [--out <dir>] [--bundle-only] [--keep <n|all>]
archidocs build --preview [--base <branch>] [--out <dir>]
archidocs dev [--workspace <dir>] [--port <n>] [--host <host>]
archidocs export <view-id> [--format svg|png] [--out <file>] [--direction TB|BT|LR|RL] [--theme light|dark] [--label <text>]
archidocs export --all-saved --out <dir> [--format svg|png] [--direction TB|BT|LR|RL] [--theme light|dark] [--label <text>]
archidocs diff <from> [<to>] [--format text|json|markdown]
archidocs history build [--since <ref|date|time>]
archidocs mcp [--workspace <dir> | --bundle <url|path>] [--viewer-url <url>] [--check]
archidocs mcp --http [--host <loopback>] [--port <n>] [--allow-writes] [--workspace <dir> | --bundle <url|path>] [--viewer-url <url>]
Command What it does
archidocs version Print the CLI’s version and the Bundle schemaVersion it writes.
archidocs init Set up a Workspace in this repo and install the agent skill, or with --skill install only the skill in a code repo. Safe to re-run.
archidocs guide Print an agent skill’s full guide, or one of its task topics. With no --skill, the authoring guide.
archidocs check Validate the Workspace found from the current folder and print each issue with its file, line and rule.
archidocs gaps List what the Model leaves empty, grouped by Project and Owner Team: the gaps an agent’s fill-gaps interview works through.
archidocs build Write the static viewer site with the Workspace’s Bundle and past Revisions, or a PR preview site.
archidocs dev Serve the viewer locally and reload it when a .yaml or .md file in the Workspace changes.
archidocs export Render a View, or every Saved View, to an SVG or PNG picture.
archidocs diff Show what changed in the Model between two points in the Workspace’s history.
archidocs history build Build and cache the Bundle of every past Revision, so later builds and diffs don’t have to. Safe to re-run.
archidocs mcp Serve the Model to AI agents over MCP, from a Workspace checkout or a published Bundle, on stdio or local HTTP.

A Workspace’s root is the folder that holds workspace.yaml. A command that needs a Workspace looks for that file in this order, and the first one it finds wins:

  1. In the current folder: ./workspace.yaml.
  2. In the current folder’s archidocs/ folder: ./archidocs/workspace.yaml.
  3. In the folder above and then that folder’s archidocs/ folder, and so on for each folder above, up to the root of the file system.

So a command finds the Workspace from the root of a repo that keeps it in archidocs/, from the Workspace’s own folder, and from any folder inside it, such as a Project’s. The search does not stop at the root of the git repo, and it looks nowhere else: a Workspace in a folder beside the current one is not found.

When the search finds nothing, the command exits 2 with this message, and the usage summary after it:

archidocs: No workspace.yaml found in this folder, its archidocs/ folder, or any folder above.

--workspace <dir> changes only where the search starts. <dir> is searched the same way: the folder itself, its archidocs/ folder, then each folder above. So it can name the Workspace’s folder, the repo that holds it in archidocs/, or any folder inside the Workspace. A relative <dir> is read from the current folder.

Command Where the search starts
archidocs version It reads no Workspace.
archidocs init The current folder. If the search finds nothing, init does not fail: it writes archidocs/workspace.yaml at the root of the git repo, or in the current folder outside git. With --skill it does not search, and --workspace <dir> is only the path it prints in the MCP command.
archidocs guide It reads no Workspace.
archidocs check The current folder.
archidocs gaps The current folder.
archidocs build The current folder. With --preview, the Workspace must also be in a git repo.
archidocs dev The current folder, or --workspace <dir> when given.
archidocs export The current folder.
archidocs diff The current folder. The Workspace must also be in a git repo.
archidocs history build The current folder. The Workspace must also be in a git repo.
archidocs mcp The current folder, or --workspace <dir> when given. With --bundle it does not search: it serves the published Bundle.

Under the Workspace’s root, a command reads every .yaml file, as the Model, and every .md file, as an ADR, in any folder. It skips any folder or file whose name starts with ., such as .git, and any node_modules folder. It reads no other file: a .yml, .json or .txt file is not part of the Workspace.

archidocs check, archidocs build, archidocs export, archidocs mcp and archidocs dev all read the same files. dev reloads the page only when one of them changes.

Code Meaning
0 The command did what it was asked.
1 The Workspace has errors. Only archidocs check, archidocs gaps, archidocs build and archidocs export exit 1.
2 The command could not run. The reason is printed to stderr as archidocs: <message>, and after most mistakes in the command line, the usage summary above.

Each command’s page says what its exit codes mean for it.

Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.