CLI Reference
Every public dotbrain command, grouped by task. Run any command with --help for the same information in the terminal.
Human reports group changes and problems by target, shorten home paths to ~, and use tables for catalogs and project inspection. Empty lists, previews, and skipped work are explicit. Doctor shows problems and warnings first; use doctor -v to include every healthy check. Troubleshooting lists doctor's drift warnings and their fixes. Runtime activation and session uncertainty are informational, shown with doctor -v and in JSON; they do not count as passed checks. Missing registered hook files and failed plugin checks remain warnings. With --all, a project whose shared .repo checkout is absent on this machine is reported as skipped, not failed; a missing .repo.local checkout or an explicit --project still fails. Colors follow terminal capabilities; redirected output stays plain.
Finite reports support --json: stdout contains one result with command, overall status, per-target results, and errors. Finding severities are info, warning, and error; warnings alone do not cause failure. Exit codes are 0 for success, 1 for operational failure or a partially failed batch, and 2 for invalid invocation or selection.
JSON consumers must replace checks for severity: advisory with severity: warning. The old severity is no longer emitted; other result fields and exit codes are unchanged.
Commands at a Glance
| Command | Does |
|---|---|
bootstrap | Prepare this machine for dotbrain: global skill and subagent links. |
detach | Remove dotbrain's machine-wide delivery from a runtime. |
doctor | Read-only health check of machine readiness and selected project setup. |
wire | Create a Brainspace or attach a checkout, including a linked worktree. |
refresh | Repair setup while preserving project declarations and content. |
unwire | Remove a checkout's wiring while retaining its Brainspace and tracker databases. |
projects list | List every registered project using local declarations and wiring. |
projects show | Inspect the current wired project or a named project's registered checkout. |
skills list | Discover locally available skills. |
skills link | Reconcile selected skills in project or explicit global scope, selecting ENTRIES first. |
skills unlink | Remove ENTRIES from the project or global selection, then reconcile, pruning their links. |
skills add | Add a skill repository to ~/dotbrain/skills as a submodule of the home and commit it. |
skills update | Move skill repositories to their remote's latest commit, commit each move, and relink. |
skills remove | Deselect a skill repository's skills everywhere, remove it, commit, and relink. |
subagents list | Discover locally available custom subagents. |
subagents link | Reconcile selected custom subagents in project or explicit global scope. |
beads sync | Sync declared local tracker bindings and pull configured remotes; never push. |
beads migrate | Migrate embedded trackers to a server, keeping history and rollback backups. |
beads list-db | List remote database identifiers, including databases without a Brainspace. |
beads drop-db | Explicitly delete a remote database; never infer it from the current project. |
sync | Record uncommitted home changes as sync commits, integrate the upstream, and push. |
hook session-start | Sync the home (waiting at most 10 s), then emit a wired repo's Brain context. |
hook stop | Start a detached push-only home sync and return at once. |
hook session-end | Start a detached full home sync and return at once. |
hook run | Handle a session event for any runtime adapter, without reading a hook payload. |
hook antigravity | Read an Antigravity hook payload and emit a JSON response. |
Setup
Prepare a machine and check its health. See Getting started.
dotbrain bootstrap
Prepare this machine for dotbrain: global skill and subagent links.
dotbrain bootstrap [OPTIONS]| Option | Default | Description |
|---|---|---|
--home path | — | Override the private data root. |
--runtime text | all | Filter runtimes: claude, codex, hermes, opencode, pi, cursor, antigravity, or all. |
--json | — | Emit one structured result. |
dotbrain detach
Remove dotbrain's machine-wide delivery from a runtime.
dotbrain detach [OPTIONS]| Option | Default | Description |
|---|---|---|
--runtime text | — | Filter runtimes: claude, codex, hermes, opencode, pi, cursor, antigravity, or all. |
--home path | — | Override the private data root. |
--json | — | Emit one structured result. |
dotbrain doctor
Read-only health check of machine readiness and selected project setup.
dotbrain doctor [OPTIONS]| Option | Default | Description |
|---|---|---|
--home path | — | Override the private data root. |
--project text | — | Select a named Brainspace. |
--all | — | Inspect every registered project. |
--verbose, -v | — | Include healthy checks and informational context. |
--json | — | Emit one structured result. |
Projects
Connect code repos to Brainspaces and keep them in sync. See Wiring.
dotbrain wire
Create a Brainspace or attach a checkout, including a linked worktree.
dotbrain wire [OPTIONS]| Option | Default | Description |
|---|---|---|
--repo path | — | Checkout to attach; defaults to the current Git checkout. |
--project text | — | Select a named Brainspace. |
--skip-beads | — | Create without a tracker. |
--remote text | — | Dolt remote for initial tracker creation. |
--server-host text | — | Dolt server host; defaults to config. |
--server-port text | — | Dolt server port; defaults to config. |
--server-user text | — | Dolt server user; defaults to config. |
--database text | — | Tracker database; defaults to project name. |
--home path | — | Override the private data root. |
--json | — | Emit one structured result. |
dotbrain refresh
Repair setup while preserving project declarations and content.
dotbrain refresh [OPTIONS]| Option | Default | Description |
|---|---|---|
--project text | — | Select a named Brainspace. |
--all | — | Refresh all registered projects. |
--home path | — | Override the private data root. |
--runtime text | all | Filter runtimes: claude, codex, hermes, opencode, pi, cursor, antigravity, or all. |
--json | — | Emit one structured result. |
dotbrain unwire
Remove a checkout's wiring while retaining its Brainspace and tracker databases.
dotbrain unwire [OPTIONS]| Option | Default | Description |
|---|---|---|
--repo path | — | Checkout whose wiring to remove. |
--project text | — | Select a named Brainspace. |
--home path | — | Override the private data root. |
--json | — | Emit one structured result. |
dotbrain projects list
List every registered project using local declarations and wiring.
dotbrain projects list [OPTIONS]| Option | Default | Description |
|---|---|---|
--home path | — | Override the private data root. |
--json | — | Emit one structured result. |
dotbrain projects show
Inspect the current wired project or a named project's registered checkout.
dotbrain projects show [OPTIONS]| Option | Default | Description |
|---|---|---|
--project text | — | Select a named Brainspace. |
--home path | — | Override the private data root. |
--json | — | Emit one structured result. |
Skills and subagents
Manage the skill library and link skills and custom vendor-native subagents into agent runtimes. See Skills.
dotbrain skills list
Discover locally available skills.
dotbrain skills list [OPTIONS]| Option | Default | Description |
|---|---|---|
--home path | — | Override the private data root. |
--runtime text | all | Filter runtimes: claude, codex, hermes, opencode, pi, cursor, antigravity, or all. |
--project text | — | Show selections for a named Brainspace. |
--json | — | Emit one structured result. |
dotbrain skills link
Reconcile selected skills in project or explicit global scope, selecting ENTRIES first.
dotbrain skills link [OPTIONS] [ENTRIES]| Argument | Description |
|---|---|
ENTRIES | Skills or bundles under ~/dotbrain/skills to add to the scope's selection first. |
| Option | Default | Description |
|---|---|---|
--home path | — | Override the private data root. |
--runtime text | all | Filter runtimes: claude, codex, hermes, opencode, pi, cursor, antigravity, or all. |
--scope text | project | Delivery scope: project or global. |
--project text | — | Select a named Brainspace. |
--repo path | — | Select a wired checkout; defaults to the current checkout. |
--all | — | Reconcile every registered project. |
--json | — | Emit one structured result. |
dotbrain skills unlink
Remove ENTRIES from the project or global selection, then reconcile, pruning their links.
dotbrain skills unlink [OPTIONS] ENTRIES| Argument | Description |
|---|---|
ENTRIES | Selected skills or bundles to remove from the scope's selection. |
| Option | Default | Description |
|---|---|---|
--home path | — | Override the private data root. |
--runtime text | all | Filter runtimes: claude, codex, hermes, opencode, pi, cursor, antigravity, or all. |
--scope text | project | Delivery scope: project or global. |
--project text | — | Select a named Brainspace. |
--repo path | — | Select a wired checkout; defaults to the current checkout. |
--json | — | Emit one structured result. |
dotbrain skills add
Add a skill repository to ~/dotbrain/skills as a submodule of the home and commit it.
dotbrain skills add [OPTIONS] URL| Argument | Description |
|---|---|
URL | Git URL of the skill repository. |
| Option | Default | Description |
|---|---|---|
--name text | — | Folder under ~/dotbrain/skills; defaults to the repository name. |
--ref text | — | Tag, branch or commit to pin instead of the default branch. |
--home path | — | Override the private data root. |
--json | — | Emit one structured result. |
dotbrain skills update
Move skill repositories to their remote's latest commit, commit each move, and relink.
dotbrain skills update [OPTIONS] [NAMES]| Argument | Description |
|---|---|
NAMES | Skill repositories to update; defaults to all. |
| Option | Default | Description |
|---|---|---|
--ref text | — | Move one repository to this tag, branch or commit, including an older one. |
--home path | — | Override the private data root. |
--json | — | Emit one structured result. |
dotbrain skills remove
Deselect a skill repository's skills everywhere, remove it, commit, and relink.
dotbrain skills remove [OPTIONS] NAME| Argument | Description |
|---|---|
NAME | Skill repository under ~/dotbrain/skills. |
| Option | Default | Description |
|---|---|---|
--home path | — | Override the private data root. |
--json | — | Emit one structured result. |
dotbrain subagents list
Discover locally available custom subagents.
dotbrain subagents list [OPTIONS]| Option | Default | Description |
|---|---|---|
--home path | — | Override the private data root. |
--runtime text | all | Filter runtimes: claude, codex, hermes, opencode, pi, cursor, antigravity, or all. |
--project text | — | Show selections for a named Brainspace. |
--json | — | Emit one structured result. |
dotbrain subagents link
Reconcile selected custom subagents in project or explicit global scope.
dotbrain subagents link [OPTIONS]| Option | Default | Description |
|---|---|---|
--home path | — | Override the private data root. |
--runtime text | all | Filter runtimes: claude, codex, hermes, opencode, pi, cursor, antigravity, or all. |
--scope text | project | Delivery scope: project or global. |
--project text | — | Select a named Brainspace. |
--repo path | — | Select a wired checkout; defaults to the current checkout. |
--all | — | Reconcile every registered project. |
--json | — | Emit one structured result. |
Beads
Manage the Beads tracker's state and backend. See Beads backend.
dotbrain beads sync
Sync declared local tracker bindings and pull configured remotes; never push.
dotbrain beads sync [OPTIONS]| Option | Default | Description |
|---|---|---|
--project text | — | Select a named Brainspace. |
--all | — | Sync every registered project. |
--dry-run | — | Preview tracker sync and configured pulls. |
--home path | — | Override the private data root. |
--json | — | Emit one structured result. |
dotbrain beads migrate
Migrate embedded trackers to a server, keeping history and rollback backups.
dotbrain beads migrate [OPTIONS]| Option | Default | Description |
|---|---|---|
--project text | — | Select a named Brainspace. |
--all | — | Migrate every registered project. |
--server-host text | — | Target Dolt server host; defaults to config. |
--server-port text | — | Target Dolt server port; defaults to config. |
--server-user text | — | Target Dolt server user; defaults to config. |
--database text | — | Database override for a single project. |
--dry-run | — | Preview the history-preserving migration. |
--home path | — | Override the private data root. |
--json | — | Emit one structured result. |
dotbrain beads list-db
List remote database identifiers, including databases without a Brainspace.
dotbrain beads list-db [OPTIONS]| Option | Default | Description |
|---|---|---|
--server-host text | — | Dolt server host; defaults to config. |
--server-port text | — | Dolt server port; defaults to config. |
--server-user text | — | Dolt server user; defaults to config. |
--ssh-host text | — | Optional SSH hop; defaults to config. |
--home path | — | Override the private data root. |
--json | — | Emit one structured result. |
dotbrain beads drop-db
Explicitly delete a remote database; never infer it from the current project.
dotbrain beads drop-db [OPTIONS] NAME| Argument | Description |
|---|---|
NAME | Database identifier, including an orphaned database. |
| Option | Default | Description |
|---|---|---|
--yes | — | Confirm the destructive drop. |
--dry-run | — | Preview without deleting. |
--server-host text | — | Dolt server host; defaults to config. |
--server-port text | — | Dolt server port; defaults to config. |
--server-user text | — | Dolt server user; defaults to config. |
--ssh-host text | — | Optional SSH hop; defaults to config. |
--home path | — | Override the private data root. |
--json | — | Emit one structured result. |
Exchange
Record the dotbrain home's changes and exchange them with its remote.
dotbrain sync
Record uncommitted home changes as sync commits, integrate the upstream, and push.
Acts on the whole home: one commit per changed Brainspace, then one home commit for the rest. A full sync then fetches and merges the upstream, keeping this machine's version of a file both sides changed and writing the other as NAME.sync-conflict-DATE-HOST.ext beside it (an edit wins over a delete). A push rejected because the remote moved is retried at most 3 times; sync never force-pushes. Files over sync.max-file-size in config.yaml (bytes, or a size such as 500KB or 1MB; default 1MB) stay uncommitted and are reported. If incoming changes would overwrite an uncommitted or ignored local file, Git refuses the merge; sync reports Git's diagnostic, pushes nothing, and fails. Offline, rejected, and remote-less homes exit 0 and keep the commits. Nested Git repositories are never recorded. A submodule declared in .gitmodules is recorded when new or moved forward to a commit its remote holds; after integrating, a full sync checks out every recorded submodule commit, cloning new ones. A submodule with uncommitted changes or unpublished commits is reported and left alone; to move one back, commit that yourself. Recording is refused during a merge, rebase, cherry-pick, or revert, with unmerged paths, or on a detached HEAD. Turn sync off with sync.enabled: false. Known limit: sync unstages everything before recording, so index-only state (partially staged hunks, git rm --cached, a staged mode change) is replaced by the working tree.
dotbrain sync [OPTIONS]| Option | Default | Description |
|---|---|---|
--push-only | — | Record and push without fetching the remote. |
--home path | — | Override the private data root. |
--json | — | Emit one structured result. |
Internal
Run by the plugin's hooks, not by hand. See Session context.
dotbrain hook session-start
Sync the home (waiting at most 10 s), then emit a wired repo's Brain context. Fail-open.
dotbrain hook session-start [ARGS]| Argument | Description |
|---|---|
ARGS | — |
dotbrain hook stop
Start a detached push-only home sync and return at once. Fail-open and silent.
dotbrain hook stop [ARGS]| Argument | Description |
|---|---|
ARGS | — |
dotbrain hook session-end
Start a detached full home sync and return at once. Fail-open and silent.
dotbrain hook session-end [ARGS]| Argument | Description |
|---|---|
ARGS | — |
dotbrain hook run
Handle a session event for any runtime adapter, without reading a hook payload. Fail-open.
dotbrain hook run [OPTIONS]| Option | Default | Description |
|---|---|---|
--event choice | — | Session event: startup, resume, clear, compaction, turn-end, or session-end. |
--checkout path | — | Checkout the event belongs to. Default: the working directory. |
--format choice | text | Context output: text (raw) or json (an additional_context object). |
dotbrain hook antigravity
Read an Antigravity hook payload and emit a JSON response. Fail-open.
dotbrain hook antigravity [OPTIONS]| Option | Default | Description |
|---|---|---|
--event choice | — | Antigravity event: startup or turn-end. |