CLI Reference
Overview
Section titled “Overview”Shape how your AI thinks — soul, persona, rules
brainjar composes soul + persona + rules into prompts.
Single-workspace local mode stores everything in ~/.brainjar (override with —home or $BRAINJAR_HOME). Run
brainjar initonce to create the workspace, then use the soul, persona, rule, brain, and state commands to build and compose prompts.Pass —json on any command to get machine-readable output on stdout and a structured error envelope on stderr. Global options
| Flag | Description |
|---|---|
--home string | brainjar home directory (default: $BRAINJAR_HOME or ~/.brainjar) |
--json | emit machine-readable JSON on stdout; errors go to stderr as a JSON envelope |
The options above are global — they apply to every command below.
api-key
Section titled “api-key”Manage API keys for the active workspace
api-key create
Section titled “api-key create”Mint a new API key. Plaintext is shown exactly once — save it now.
Mint a new API key scoped to the active workspace.
By default the plaintext token is printed to stderr only, so capturing stdout (for example in a pipeline or —json consumer) does not silently persist the secret to a log file. Pass —show-key to also include the plaintext in stdout output (JSON mode: in the “key” field; text mode: as the first line).
brainjar api-key create [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--name string | human-readable name for the key (required) |
--show-key | also write the plaintext key to stdout (default: stderr only) |
api-key list
Section titled “api-key list”List API keys in the active workspace (metadata only)
brainjar api-key list [flags]api-key revoke
Section titled “api-key revoke”Revoke an API key by its full id or its display prefix
brainjar api-key revoke <id-or-prefix> [flags]Manage brains — named bundles of soul + persona + rules + model prefs
brain delete
Section titled “brain delete”Delete a brain
brainjar brain delete <slug> [flags]brain list
Section titled “brain list”List brains in the workspace
brainjar brain list [flags]brain save
Section titled “brain save”Save a named brain bundling a soul, persona, rules, optional procedure, and optional skills
Save a named brain. Upsert — saving an existing slug replaces the brain wholesale. All referenced soul, persona, rule, procedure, and skill slugs must already exist.
Pass —soul "" or —persona "" to leave either side unset. —procedure is optional; omit it to bind the brain to no procedure.
Skills attach to a brain via —skill
<slug>(repeatable, order preserved) or —skills<a,b,c>(bulk). The two flags are mutually exclusive — pick one.—platform pins the brain to a specific adapter so it composes against that platform’s catalog regardless of the active context. —model is the alias or literal ID the runtime should use.
brainjar brain save <slug> [flags]Examples
Section titled “Examples”brainjar brain save cto \ --soul mentor --persona cto --procedure review \ --rule security --rule testing --rule git-discipline \ --skill incident-response --skill refund-policy \ --platform claude --model opusOptions
Section titled “Options”| Flag | Description |
|---|---|
--model string | preferred model identifier (alias, tier, or literal ID) |
--persona string | persona slug (required; pass empty string to leave unset) |
--platform string | pin brain to a specific platform adapter (claude, codex, cursor) |
--procedure string | procedure slug (optional) |
--rule strings | rule slug (repeatable) |
--skill strings | skill slug to attach (repeatable; order preserved) |
--skills strings | comma-separated skill slugs (mutually exclusive with —skill) |
--soul string | soul slug (required; pass empty string to leave unset) |
brain show
Section titled “brain show”Show a brain’s bundle contents
brainjar brain show <slug> [flags]brain use
Section titled “brain use”Load a brain wholesale into the workspace state
Load a brain wholesale into the workspace state. soul, persona, procedure, and rules are all set to the brain’s values in one shot, replacing whatever was at the workspace layer before. After this, the effective state matches the brain — sync writes a CLAUDE.md composed of those exact components.
This is a state-mutation, not a brain mutation. The brain on disk is unchanged. Run again with a different slug to switch.
brainjar brain use <slug> [flags]completion
Section titled “completion”Emit a shell-completion script for brainjar
Emit a shell-completion script to stdout. Pipe the output into the appropriate location for your shell.
brainjar completion [bash|zsh|fish|powershell]Examples
Section titled “Examples”# bash (system-wide)brainjar completion bash | sudo tee /etc/bash_completion.d/brainjar > /dev/null
# zsh (first fpath entry; reload with `exec zsh`)brainjar completion zsh > "${fpath[1]}/_brainjar"
# fishbrainjar completion fish > ~/.config/fish/completions/brainjar.fish
# PowerShellbrainjar completion powershell > brainjar.ps1compose
Section titled “compose”Compose a prompt from a brain, persona, or the active state
Compose a prompt and print it to stdout.
brainjar compose
<brain>use a saved brain brainjar compose —persona<slug>use a persona and the state’s soul+rules brainjar compose use the effective state (soul+persona+rules)Warnings (missing slugs, unresolved refs) go to stderr so they don’t pollute a piped prompt. With —json the full ComposeResponse is emitted on stdout including token estimates and resolved references.
brainjar compose [brain] [flags]Examples
Section titled “Examples”# Compose from a saved brainbrainjar compose cto > prompt.txt
# Compose ad-hoc from a personabrainjar compose --persona architect --task "design the auth layer"
# Structured output for agentsbrainjar --json compose cto | jq .token_estimate.totalOptions
Section titled “Options”| Flag | Description |
|---|---|
--persona string | compose from a persona (mutually exclusive with positional brain) |
--task string | task description (counted in token estimate) |
context
Section titled “context”Manage named profiles that bind a workspace, platform, and optional remote endpoint
context add
Section titled “context add”Add a new context — local by default, remote when —url is set
brainjar context add NAME [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--api-key-ref string | secret reference for the remote API key (e.g. env:PROD_BRAINJAR_KEY) |
--ca-cert string | PEM file with extra trusted CAs (added to the system trust store; verification stays on) |
--platform string | platform adapter name (default “claude”) |
--url string | remote server URL (omit for a local context) |
--workspace string | workspace UUID (required) |
context list
Section titled “context list”List every context, with the active one marked
brainjar context list [flags]context remove
Section titled “context remove”Delete a context. Refuses if it is the active one.
brainjar context remove NAME [flags]context rename
Section titled “context rename”Rename a context. If OLD was active, the active pointer moves with it.
brainjar context rename OLD NEW [flags]context show
Section titled “context show”Show a context’s full details (defaults to the active context)
brainjar context show [NAME] [flags]context use
Section titled “context use”Activate a context — subsequent commands route through it
brainjar context use NAME [flags]Generate markdown reference pages for brainjar and every subcommand
Generate markdown reference pages for every brainjar subcommand into the given directory (default ./docs-cli). One file per command, named after its command path: brainjar.md, brainjar-shell.md, brainjar-hooks-install.md, etc.
Intended consumers are static-site generators and docs pipelines that render markdown natively. For nroff man pages, use
brainjar man.
brainjar docs [dir] [flags]Browse server-shipped operational guides for brainjar’s MCP tools
Browse server-shipped operational guides — short, agent-facing docs about how to drive brainjar’s MCP tools correctly.
Guides ship inside the brainjar binary; they are not user content and are not stored in SQLite. To author your own agent context, see
brainjar soul,brainjar persona,brainjar rule,brainjar procedure.
guide list
Section titled “guide list”List embedded guides
brainjar guide list [flags]guide show
Section titled “guide show”Print a guide’s body to stdout
brainjar guide show <slug> [flags]Manage platform hooks that keep the synced config current
hooks install
Section titled “hooks install”Install the brainjar hook into the platform’s settings
Install the brainjar hook into the platform’s settings.
—scope selects which settings layer the hook is written to. The active platform adapter owns the actual path; the meaning of each scope is the same across adapters:
project (default) — shared per-repository settings that every collaborator inherits when they clone the repo. local — per-checkout override that is not shared with collaborators (the adapter writes to its gitignored local settings file). user — user-global settings applied in every project.
—project is ignored when —scope=user.
brainjar hooks install [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--project string | project root (default: cwd); ignored when —scope=user |
--scope string | where the hook lives: project (default, shared with collaborators), local (per-checkout, not shared), user (global across every project) (default “project”) |
hooks remove
Section titled “hooks remove”Remove the brainjar hook from the platform’s settings
brainjar hooks remove [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--project string | project root (default: cwd); ignored when —scope=user |
--scope string | where the hook lives: project (default, shared with collaborators), local (per-checkout, not shared), user (global across every project) (default “project”) |
hooks status
Section titled “hooks status”Report whether the brainjar hook is installed and current
brainjar hooks status [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--project string | project root (default: cwd); ignored when —scope=user |
--scope string | where the hook lives: project (default, shared with collaborators), local (per-checkout, not shared), user (global across every project) (default “project”) |
Initialize a brainjar home directory
Create ~/.brainjar (or the directory pointed at by —home or $BRAINJAR_HOME), run database migrations, create the default workspace, and write config.yaml.
If —force is set, any existing database and config in the home directory are deleted before initializing.
brainjar init [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
-f, --force | wipe existing db and config before initializing |
Generate man pages for brainjar and every subcommand
Generate nroff(1) man pages for every brainjar subcommand into the given directory (default ./man). Files are named after the command path: brainjar.1, brainjar-shell.1, brainjar-hooks-install.1, etc.
Packagers typically install them under $prefix/share/man/man1/.
brainjar man [dir] [flags]Run brainjar as an MCP server — bare command runs the stdio server; subcommands manage registration
Run the brainjar Model Context Protocol server on stdio. The process reads JSON-RPC frames from stdin and writes replies to stdout — nothing else may write to stdout, or the MCP protocol will be corrupted. Logging is routed to stderr.
Spawn this from an MCP client (Claude Code, Cursor, etc.) as a subprocess. The server uses whichever backend the active context selects: local SQLite when the context has no URL, a remote brainjar server over HTTPS when it does. Tools see the same content the CLI sees.
Use the install/remove/status subcommands to register brainjar with the active platform’s MCP config without hand-editing JSON.
brainjar mcp [flags]mcp install
Section titled “mcp install”Register brainjar as an MCP server in the platform’s config
Register brainjar as an MCP server in the platform’s config.
—scope selects which layer the registration is written to. The active platform adapter owns the actual file path; the meaning of each scope is consistent across adapters:
project — committed per-repository registration (for Claude, written to
<projectRoot>/.mcp.json) shared with collaborators. local — per-checkout registration not shared with collaborators (for Claude, stored under projects.<root>.mcpServers in ~/.claude.json). user — (default) user-global registration applied in every project.—project is ignored when —scope=user.
The resolved —home is baked into the registered args so the MCP client spawns brainjar against the correct workspace directory.
brainjar mcp install [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--project string | project root (default: cwd); ignored when —scope=user |
--scope string | where the registration lives: project (committed to the repo), local (per-checkout, not shared), user (default, global across every project) (default “user”) |
mcp remove
Section titled “mcp remove”Remove brainjar’s MCP registration from the platform’s config
brainjar mcp remove [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--project string | project root (default: cwd); ignored when —scope=user |
--scope string | where the registration lives: project (committed to the repo), local (per-checkout, not shared), user (default, global across every project) (default “user”) |
mcp status
Section titled “mcp status”Report whether brainjar is registered as an MCP server
brainjar mcp status [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--project string | project root (default: cwd); ignored when —scope=user |
--scope string | where the registration lives: project (committed to the repo), local (per-checkout, not shared), user (default, global across every project) (default “user”) |
Export and import workspace content as a JSON bundle
pack export
Section titled “pack export”Export the workspace bundle as JSON
Export the workspace’s souls, personas, rules, brains, and active state as a single JSON document. Default output is pretty-printed to stdout; pass -o
<path>to write to a file, or -o - to keep stdout explicit. Round-trips throughpack import.
brainjar pack export [flags]Examples
Section titled “Examples”brainjar pack export -o backup.jsonbrainjar pack export --compact | gzip > backup.json.gzOptions
Section titled “Options”| Flag | Description |
|---|---|
--compact | single-line JSON instead of indented |
-o, --output string | output path (use - for stdout) (default ”-“) |
pack import
Section titled “pack import”Import a workspace bundle from JSON
Apply a bundle produced by
pack exportto the workspace. Imports are additive — existing souls, personas, rules, and brains are upserted in place; per-entity failures (e.g. dangling refs) become warnings and do not abort. An unknown schema_version is a fatal BAD_REQUEST.
brainjar pack import [flags]Examples
Section titled “Examples”brainjar pack import -i backup.jsoncat backup.json | brainjar pack importOptions
Section titled “Options”| Flag | Description |
|---|---|
-i, --input string | input path (use - for stdin) (default ”-“) |
persona
Section titled “persona”Manage personas — the role the composed prompt adopts
persona create
Section titled “persona create”Create or replace a persona. Reads content from stdin, —content, or —file
Create or replace a persona. Upsert — creating an existing slug replaces its content and bundled rules wholesale.
Use —rule
<slug>(repeatable) to bundle rules that compose in by default when the persona is referenced without an explicit rule list.
brainjar persona create <slug> [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--content string | inline content |
--file string | read content from file path |
--rule strings | bundle a rule slug (repeatable) |
persona delete
Section titled “persona delete”Delete a persona
brainjar persona delete <slug> [flags]persona drop
Section titled “persona drop”Clear the active persona in the workspace state override
brainjar persona drop [flags]persona list
Section titled “persona list”List personas in the workspace
brainjar persona list [flags]persona show
Section titled “persona show”Print a persona’s content to stdout
brainjar persona show <slug> [flags]persona use
Section titled “persona use”Set the active persona in the workspace state override
brainjar persona use <slug> [flags]platform
Section titled “platform”Inspect registered platform adapters
platform list
Section titled “platform list”List every registered platform adapter with its capabilities
List every registered platform adapter along with which capabilities (sync/hooks/mcp/spawn/skills) and scopes (project/local/user) it supports. The adapter bound to the active context is marked active.
brainjar platform list [flags]platform models
Section titled “platform models”List models in a platform’s catalog
List the models a platform adapter knows about. Without an argument, lists the active platform’s catalog. With an argument, lists the named adapter’s catalog.
A platform with an empty catalog (e.g. cursor, whose model selection is UI-bound) prints no rows; the brain’s model field still passes through to the runtime as-is.
brainjar platform models [platform] [flags]procedure
Section titled “procedure”Manage procedures — step-by-step playbooks attached to brains or workspace state
procedure create
Section titled “procedure create”Create or replace a procedure. Reads content from stdin, —content, or —file
Create or replace a procedure. A procedure is a single content blob describing how to carry out work step-by-step — creating an existing slug replaces its content wholesale. To attach a procedure to a brain, pass
--procedure <slug>tobrainjar brain save.Content source precedence: —content > —file > stdin.
brainjar procedure create <slug> [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--content string | inline content |
--file string | read content from file path |
procedure delete
Section titled “procedure delete”Delete a procedure
brainjar procedure delete <slug> [flags]procedure drop
Section titled “procedure drop”Clear the active procedure in the workspace state override
brainjar procedure drop [flags]procedure list
Section titled “procedure list”List procedures in the workspace
brainjar procedure list [flags]procedure show
Section titled “procedure show”Print a procedure’s content to stdout
brainjar procedure show <slug> [flags]procedure use
Section titled “procedure use”Set the active procedure in the workspace state override
brainjar procedure use <slug> [flags]Delete the brainjar database and config
Remove brainjar.db and config.yaml from the brainjar home directory. Does not remove other files you may have placed in the home (packs, backups, etc). Run
brainjar initafterwards to start fresh.Requires —yes in non-interactive mode (including —json mode).
brainjar reset [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
-y, --yes | skip confirmation prompt (required in scripts/CI) |
Manage rules — composable guidance fragments
rule add
Section titled “rule add”Add a rule to the workspace state override
Add a rule slug to the active state so it appears in composed prompts. The rule does not have to exist yet — compose will warn if it’s missing. This does NOT edit rule content; use
brainjar rule createfor that.
brainjar rule add <slug> [flags]rule create
Section titled “rule create”Create or replace a rule. Reads content from stdin, —content, or —file
Create or replace a rule. A rule is a single content entry — creating an existing slug replaces its content wholesale. To reference this rule from the active state, use
brainjar rule add.Content source precedence: —content > —file > stdin.
brainjar rule create <slug> [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--content string | inline content |
--file string | read content from file path |
rule delete
Section titled “rule delete”Delete a rule
brainjar rule delete <slug> [flags]rule list
Section titled “rule list”List rules in the workspace
brainjar rule list [flags]rule remove
Section titled “rule remove”Remove a rule from the workspace state override
brainjar rule remove <slug> [flags]rule show
Section titled “rule show”Print a rule’s content to stdout
Print a rule’s content to stdout. Multi-entry rules are joined with blank lines between entries; the JSON output preserves the full structure.
brainjar rule show <slug> [flags]Start the brainjar HTTP server
Start an HTTP server exposing the brainjar API. The server uses the same LocalBackend as the CLI — same SQLite database, same apps.
The server listens until interrupted (SIGINT/SIGTERM), then drains in-flight requests within the shutdown timeout.
brainjar serve [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--host string | bind address (default “127.0.0.1”) |
--port int | listen port (0 for ephemeral) (default 8080) |
--shutdown-timeout duration | graceful shutdown deadline (default 10s) |
Spawn an agent with a composed prompt for this session only
Spawn an agent process (Claude Code, Codex, …) with a prompt composed in memory. Nothing is written to disk. Each invocation is independent — open several terminals with different brains and they will not collide.
The agent inherits the current working directory, stdin/stdout/stderr, and environment. Everything after
--is forwarded verbatim to the agent binary.Prompt-injection surface: on Claude we pass —append-system-prompt so Anthropic’s built-in tool/safety system prompt is preserved; on Codex we pass —system-prompt. Cursor has no CLI injection surface and is rejected with an explicit error.
For strict isolation on Claude — no CLAUDE.md auto-discovery, no hooks, no LSP, no plugin sync, no keychain — pass —bare. Caveat: —bare disables keychain reads, which breaks Claude Max OAuth auth. Only use —bare when you can authenticate via ANTHROPIC_API_KEY or an apiKeyHelper (see Claude Code docs). For interactive Claude Max sessions, omit —bare; the appended system prompt already dominates agent behavior, and the ambient CLAUDE.md content is harmless memory rather than a competing persona.
Caveat: the composed prompt is passed as an argv element, which means anyone with access to the machine can read it via ps(1) or /proc/
<pid>/cmdline until the process exits. Don’t ship secrets inside rules.
brainjar shell [-- AGENT_ARGS...] [flags]Examples
Section titled “Examples”# CTO brain in one terminal, breaker in anotherbrainjar shell --brain ctobrainjar shell --brain breaker
# Ad-hoc persona with custom rules, plus a taskbrainjar shell --persona architect --rules security,testing \ --task "design the auth layer"
# Forward flags to the agent binarybrainjar shell --brain cto -- --model opus --add-dir ../sibling-repoOptions
Section titled “Options”| Flag | Description |
|---|---|
--bare | strict isolation — skip the platform’s ambient context (CLAUDE.md, hooks, LSP, keychain, plugin sync). Claude only; requires ANTHROPIC_API_KEY or apiKeyHelper since keychain/OAuth are disabled. |
--brain string | compose from a saved brain (mutually exclusive with —persona) |
--persona string | compose ad-hoc from a persona |
--platform string | override the active context’s platform (claude, codex, …) |
--rules string | comma-separated rule slugs; only valid with —persona |
--task string | task blurb appended to the composed prompt (also counted in tokens) |
Manage skills — on-demand capabilities emitted to the platform’s skills directory
skill attach
Section titled “skill attach”Attach a skill to a brain at the given position
brainjar skill attach <brain> <skill> [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--position int | display order under the brain |
skill create
Section titled “skill create”Create or replace a skill. Reads the body from stdin, —content, or —file
Create or replace a skill. A skill is an on-demand capability — the runtime loads it on a turn that matches its description or triggers. Saving an existing slug replaces it wholesale.
Body source precedence: —content > —file > stdin.
Scope selects the on-disk emit target on
brainjar sync: project —<projectRoot>/.claude/skills/<slug>/SKILL.md user — ~/.claude/skills/<slug>/SKILL.md
brainjar skill create <slug> [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--content string | inline body |
--description string | one-sentence description (required) |
--file string | read body from file path |
--scope string | emit scope: project or user (default “project”) |
--trigger strings | matching hint (repeatable) |
--version int | author-asserted version (bump to invalidate caches) (default 1) |
skill delete
Section titled “skill delete”Delete a skill (fails if any brain references it)
brainjar skill delete <slug> [flags]skill detach
Section titled “skill detach”Detach a skill from a brain
brainjar skill detach <brain> <skill> [flags]skill drop
Section titled “skill drop”Remove a skill from the workspace state overlay (pruned on next sync)
Mark a skill for removal in the workspace state’s emit set. Does not check that the skill exists — dropping a slug that no longer exists is legitimate cleanup.
brainjar skill drop <slug> [flags]skill emit
Section titled “skill emit”Write every workspace skill to the platform’s skills directory
Write every workspace skill to the active platform’s skills directory. Project-scoped skills land under
<projectRoot>/.claude/skills/<slug>/SKILL.md; user-scoped skills under ~/.claude/skills/<slug>/SKILL.md.Fails (exit 2) when the active platform doesn’t support skill emit — for that case use
brainjar sync, which warns and continues.—platform overrides the configured platform; —project overrides the default project root (cwd).
brainjar skill emit [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--platform string | platform adapter (default: active context) |
--project string | project root (default: cwd) |
skill list
Section titled “skill list”List skills in the workspace (without bodies)
brainjar skill list [flags]skill show
Section titled “skill show”Print a skill’s body to stdout (and full metadata as JSON)
brainjar skill show <slug> [flags]skill use
Section titled “skill use”Add a skill to the workspace state overlay (emitted on next sync)
Add a skill slug to the workspace state’s emit set. Validates that the skill exists — typoed slugs fail fast rather than silently producing nothing on sync.
brainjar skill use <slug> [flags]Manage souls — the top-level voice of the composed prompt
soul create
Section titled “soul create”Create or replace a soul. Reads content from stdin, —content, or —file
Create or replace a soul. Upsert — creating an existing slug replaces its content wholesale.
Content source precedence: —content > —file > stdin.
brainjar soul create <slug> [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--content string | inline content |
--file string | read content from file path |
soul delete
Section titled “soul delete”Delete a soul
brainjar soul delete <slug> [flags]soul drop
Section titled “soul drop”Clear the active soul in the workspace state override
brainjar soul drop [flags]soul list
Section titled “soul list”List souls in the workspace
brainjar soul list [flags]soul show
Section titled “soul show”Print a soul’s content to stdout
brainjar soul show <slug> [flags]soul use
Section titled “soul use”Set the active soul in the workspace state override
Set the active soul in the workspace state override. The soul does not have to exist yet — compose will warn if it’s missing. This is a state change, not a content edit.
brainjar soul use <slug> [flags]status
Section titled “status”Show the effective state and layer chain
Show the effective state and layer chain.
Default output is a multi-line human-readable block. Pass —short for a single-line “soul=
<slug>persona=<slug>procedure=<slug>rules=<n>” summary suitable for embedding in shell prompts and statuslines. Unset fields become ”-”. —json is orthogonal to —short and always emits the full state object.Project scope resolution:
—project
<slug>explicit, always wins git repo basename of the nearest .git root walking up (otherwise) workspace scope onlyIf the directory name isn’t a valid brainjar slug (lowercase, hyphen-separated — no dots, underscores, or capitals), the CLI falls back to workspace scope and emits a warning on stderr. Pass —project
<slug>to force a specific project scope.
brainjar status [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--project string | narrow to a project-scope layer (overrides .brainjar/project.yaml discovery) |
--short | emit a single-line summary for statuslines |
Compose the effective prompt and write it to the platform’s config file
Resolve the configured platform adapter (see config.platform), compose the effective prompt at the workspace scope, and write it into the platform’s managed section (e.g. .claude/CLAUDE.md for Claude Code). User-authored content outside the managed section is preserved.
By default the project root is the current working directory — pass —project to target another directory. Sync is idempotent: if the managed section already matches, no write happens.
brainjar sync [flags]Examples
Section titled “Examples”brainjar syncbrainjar sync --project /path/to/repobrainjar --json syncOptions
Section titled “Options”| Flag | Description |
|---|---|
--project string | project root (default: cwd) |
upgrade
Section titled “upgrade”Update the brainjar binary to the latest release
Fetch the latest release from get.brainjar.sh, verify its cosign signature against brainjar’s release workflow identity, and atomically swap the running binary.
—check Print current vs latest; do not download or install. —force Re-download and re-install even at the same version (signature is still verified). —json Emit a structured envelope on stdout; respects the global —json flag.
brainjar upgradeis only meaningful for installs done via get.brainjar.sh (scripts/install.sh). Users who installed via Homebrew, apt, or nix should upgrade through their package manager; a warning is printed when a managed install is detected.Exit codes (per the global brainjar CLI contract; see CONTRIBUTING.md): 0 upgrade succeeded, or already up to date, or —check ran 1 runtime failure (network, signature verification, or filesystem write); stderr carries the specific cause 2 usage error (bad flags, unsupported platform, write-blocked dir)
brainjar upgrade [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--check | print current vs latest without downloading or installing |
--force | re-download and re-install at the same version |
versions
Section titled “versions”List or show archived versions of soul, persona, rule, procedure, or skill content
Two modes, keyed on argument count:
versions
<type><slug>list all archived versions newest-first versions<type><slug><n>print version<n>’s content to stdout
<type>is one of soul, persona, rule, procedure, skill. brain is not versioned.
brainjar versions <type> <slug> [<n>] [flags]workspace
Section titled “workspace”Manage workspaces — isolation boundaries for souls, personas, rules, and brains
workspace create
Section titled “workspace create”Create a new workspace
brainjar workspace create <name> [flags]workspace delete
Section titled “workspace delete”Delete a workspace. Refuses if it holds content unless —purge is set
brainjar workspace delete <name> [flags]Options
Section titled “Options”| Flag | Description |
|---|---|
--purge | delete all content in the workspace first |
--yes | confirm deletion |
workspace list
Section titled “workspace list”List all workspaces
brainjar workspace list [flags]workspace rename
Section titled “workspace rename”Rename a workspace
brainjar workspace rename <old> <new> [flags]workspace switch
Section titled “workspace switch”Activate a workspace — rewrites config.workspace_id
brainjar workspace switch <name> [flags]