This guide walks through installing Brain CLI, creating or joining a brain, and using basic commands.
- Node.js 20 or later
- git configured with
user.name(used as your author identity)
npm install -g @vraspar/brain@alphaAfter install, the brain command is available globally.
For development, clone the repo instead: see CONTRIBUTING.md.
Use brain init to create a fresh knowledge hub. This initializes a local git repo with the standard directory structure.
brain init --name "Acme Engineering"Output:
Creating brain "Acme Engineering"...
✅ Brain "Acme Engineering" is ready! (local-only)
Local: /home/you/.brain/repo
Author: your-name
⚠ No remote configured. Knowledge stays on this machine.
Next steps:
brain push --title "My First Guide" --file ./guide.md
brain digest
To share with a team, create an empty GitHub repo first, then pass --remote:
brain init --name "Acme Engineering" --remote https://github.com/acme/brain-hub.gitThis adds the remote as origin and pushes the initial commit.
Run brain init without flags for a guided wizard:
brain initIt prompts for the brain name and (optionally) a remote URL.
If a teammate already created a brain, use brain connect to clone it:
brain connect https://github.com/acme/brain-hub.gitOutput:
🔗 Connecting to team brain...
Cloning repository...
Building search index...
✅ Connected to brain: https://github.com/acme/brain-hub.git
Local: /home/you/.brain/repo
Remote: https://github.com/acme/brain-hub.git
Author: your-name
Indexed 14 entries.
Try: brain digest
Write a markdown file with your knowledge, then push it:
cat > my-guide.md << 'EOF'
# CI Pipeline Setup
This guide explains how to set up our CI pipeline using GitHub Actions.
## Steps
1. Create `.github/workflows/ci.yml`
2. Configure the build matrix
3. Add test and lint steps
EOF
brain push ./my-guide.mdOutput:
✅ Pushed: CI Pipeline Setup
ID: ci-pipeline-setup
Type: guide
File: guides/ci-pipeline-setup.md
Tags: github (auto-detected)
The title is auto-detected from the H1 heading. Tags are auto-detected from content. To push multiple files at once:
brain push ./docs/*.mdbrain search "CI pipeline"Returns matching entries ranked by relevance with contextual snippets. Use --no-preview to hide snippets.
brain show ci-pipeline-setupDisplays the full entry content including metadata. Records a read receipt for analytics.
brain digestShows entries created or updated since your last digest (or last 7 days on first run). Filter with --mine, --unread, --tag, --type, or --author:
brain digest --unread # only entries you haven't read
brain digest --mine --since 1m # your entries from last 30 days
brain digest --tag docker # entries tagged 'docker'
brain digest --summary # compact one-line formatPull the latest entries from the team:
brain sync✅ Brain synced successfully.
✨ 2 new: guides/docker-guide.md, skills/react-patterns.md
Total entries indexed: 16
If your team already has documentation in other repos, import it in one command:
brain ingest https://github.com/acme/platform.git --path "docs/**"Preview first with --dry-run:
brain ingest https://github.com/acme/platform.git --dry-runEach file gets a freshness score based on its age and content type.
Over time, some entries become outdated. Check what's stale:
brain prune --dry-runArchive stale entries (they move to _archive/ and can be restored later):
brain pruneRestore a pruned entry if you need it back:
brain restore --list # see what's archived
brain restore old-deployment-guide # bring it backFollow a topic across related entries:
brain trail kubernetesUpdate metadata without opening the file:
brain edit k8s-guide --add-tag helm
brain edit k8s-guide --title "K8s Deployment Runbook"Or open the file directly in your editor:
brain open k8s-guideSee entry counts, freshness distribution, and sync state:
brain statusEvery brain is an Obsidian vault. Open ~/.brain/repo in Obsidian to browse entries with graph view and backlinks.
Entries in guides/ and skills/ are standard markdown with YAML frontmatter — Obsidian renders them natively. Wikilink footers connect related entries. After editing in Obsidian, run brain sync to commit and push changes.
- Full CLI reference — all commands, flags, and edge cases
- MCP integration — set up AI agent access
- Configuration — config file reference
- Architecture — how it works under the hood