Commands
The claude-second-brain CLI creates and manages brains registered in ~/.claude-second-brain/config.toml.
Usage
Run it without installing anything:
Global install
Install it globally to get the shorter csb alias. Every page in this reference uses csb; substitute npx claude-second-brain if you haven't installed it.
Available commands
csb create [<name>]: Create a new brain. Interactive unless you pass a name and flags.csb <name>is a shortcut.csb ls: List all registered brains. The default brain is marked with*.csb use <name>: Set the default brain.csb rm [<name>…]: Delete one or more brains, and optionally their remotes.csb path [qmd|config|root]: Print a path for the default (or named) brain.csb qmd <qmd args…>: Runqmdagainst the default (or named) brain.csb exec -- <cmd…>: Run a command inside the default (or named) brain's directory.csb skills: Install or update the wiki skills for any agent (Claude Code, Codex, Cursor, Copilot, …).csb git-token [<name>]: Renew the git push/pull token for a Cloudflare Artifacts brain.csb lint [<name>…] [--path <dir>]: Check one or more brains, or any vault folder, for broken links, orphans and bad frontmatter.csb reindex [<name>…] [--path <dir>]: Refresh the qmd search index for one or more brains, or any vault folder.csb upgrade [<name>…]: Update existing brains (schema, vault skills, qmd scripts,.gitignore) to this release, keeping your edits.csb doctor: Verify your setup and suggest fixes.
ls is also available as list, rm as remove, and use as default or switch.
Display info
-h, --help
Show usage. Works on its own, after any command, or as csb help <command>.
csb --help
csb rm --help
csb help qmdEnvironment variables
| Variable | Description |
|---|---|
CSB_AGENTS | Agents to install skills for, comma-separated or all. Used by csb and csb skills when --agent is not passed. |
CSB_USE_MISE | Set to 1 to always fetch node and pnpm with mise, even if pnpm 10+ is on your PATH. |
CSB_ICONS | nerd, emoji or none: icons in the git-remote picker. Nerd Font logos are on by default in Ghostty, WezTerm and kitty. |
CSB_SKIP_SKILL_UPDATES | Set to 1 to update outdated global skills without prompting. |
CLOUDFLARE_API_TOKEN | API token with Artifacts Read and Edit. Used instead of your wrangler login. |
CLOUDFLARE_ACCOUNT_ID | Cloudflare account to use when your login can see more than one. |
CLAUDE_CONFIG_DIR | Where Claude Code reads its config. Skills for Claude Code go in its skills/ folder. |
Exit status
Every command exits non-zero on failure (an unknown brain name, a missing config, a failed doctor check, a remote that could not be created) and writes the error to stderr.
Pressing Ctrl-C (or Esc) at a prompt cancels the whole command, prints Cancelled. and exits 130, the shell's usual code for an interrupt. Answering "no" to a confirm is not a cancel: csb rm then removes nothing and exits 0.