Skip to content

CLI Reference

All commands support --help for usage information.

FlagDescription
--format <toon|json|yaml|md|jsonl>Output format
--filter-output <keys>Filter output by key paths (e.g. foo,bar.baz,a[0,3])
--verboseShow full output envelope
--token-countPrint token count of output instead of output
--token-limit <n>Limit output to n tokens
--token-offset <n>Skip first n tokens of output
--schemaShow JSON Schema for command
--llms, --llms-fullPrint LLM-readable manifest
--mcpStart as MCP stdio server
--versionShow version

Initialize brainjar: config, server, and optional seed content.

Terminal window
brainjar init [--default] [--backend claude|codex]
FlagDescription
--defaultSeed starter soul, personas, and rules
--backendAgent backend to target (default: claude)

Show active brain configuration.

Terminal window
brainjar status [--sync] [--workspace] [--project] [--short]
FlagDescription
--syncRegenerate config file from active layers
--workspaceShow only workspace state
--projectShow only project overrides
--shortOne-line output: soul | persona

Regenerate config file from active layers.

Terminal window
brainjar sync [--quiet]
FlagDescription
--quietSuppress output (useful in hooks)

Assemble a full subagent prompt from a brain or ad-hoc layers.

Terminal window
brainjar compose <brain> [--task <text>]
brainjar compose --persona <name> [--task <text>]
FlagDescription
--personaAd-hoc persona name (fallback when no brain is saved)
--taskTask description to append to the prompt

The brain argument is the primary path — it resolves soul, persona, and rules from the brain file. Use --persona as a fallback when no brain is saved.


Manage souls — the agent’s personality and values.

Create a new soul.

Terminal window
brainjar soul create <name> [--description <text>] [--content <text>]
FlagDescription
--descriptionOne-line description of the soul
--contentProvide content directly instead of generating a template

List available souls.

Terminal window
brainjar soul list

Show a soul by name, or the active soul if no name given.

Terminal window
brainjar soul show [name] [--project] [--short] [--rev <n>]
FlagDescription
--projectShow project soul override (if any)
--shortPrint only the active soul name
--revShow a specific version from history

List version history for a soul.

Terminal window
brainjar soul history <name>

Restore a soul to a previous version (fetches old content and saves it as the current version).

Terminal window
brainjar soul revert <name> --to <version>
FlagDescription
--toVersion number to restore

Update a soul’s content.

Terminal window
brainjar soul update <name> --content <text>
cat content.md | brainjar soul update <name>
FlagDescription
--contentProvide content directly instead of reading from stdin

Activate a soul.

Terminal window
brainjar soul use <name> [--project]
FlagDescription
--projectForce project scope (auto-detected from .brainjar/ dir)

Deactivate the current soul.

Terminal window
brainjar soul drop [--project]
FlagDescription
--projectForce project scope (auto-detected from .brainjar/ dir)

Permanently delete a soul.

Terminal window
brainjar soul delete <name>

Manage personas — role behavior and workflow for the agent.

Create a new persona.

Terminal window
brainjar persona create <name> [--description <text>] [--rules <list>] [--content <text>]
FlagDescription
--descriptionOne-line description of the persona
--rulesRules to bundle with this persona
--contentProvide content directly instead of generating a template

List available personas.

Terminal window
brainjar persona list

Show a persona by name, or the active persona if no name given.

Terminal window
brainjar persona show [name] [--project] [--short] [--rev <n>]
FlagDescription
--projectShow project persona override (if any)
--shortPrint only the active persona name
--revShow a specific version from history

List version history for a persona.

Terminal window
brainjar persona history <name>

Restore a persona to a previous version (fetches old content and bundled rules, saves them as the current version).

Terminal window
brainjar persona revert <name> --to <version>
FlagDescription
--toVersion number to restore

Update a persona’s content. Optionally update bundled rules.

Terminal window
brainjar persona update <name> [--content <text>] [--rules <list>]
cat content.md | brainjar persona update <name> [--rules <list>]
FlagDescription
--contentProvide content directly instead of reading from stdin
--rulesUpdate bundled rules

Activate a persona.

Terminal window
brainjar persona use <name> [--project]
FlagDescription
--projectForce project scope (auto-detected from .brainjar/ dir)

Deactivate the current persona.

Terminal window
brainjar persona drop [--project]
FlagDescription
--projectForce project scope (auto-detected from .brainjar/ dir)

Permanently delete a persona.

Terminal window
brainjar persona delete <name>

Manage rules — behavioral constraints for the agent.

Create a new rule.

Terminal window
brainjar rules create <name> [--description <text>] [--content <text>]
FlagDescription
--descriptionOne-line description of the rule
--contentProvide content directly instead of generating a template

List available and active rules.

Terminal window
brainjar rules list [--project]
FlagDescription
--projectShow project rules delta only

Show the content of a rule by name.

Terminal window
brainjar rules show <name> [--rev <n>]
FlagDescription
--revShow a specific version from history

List version history for a rule.

Terminal window
brainjar rules history <name>

Restore a rule to a previous version (fetches old entries and saves them as the current version).

Terminal window
brainjar rules revert <name> --to <version>
FlagDescription
--toVersion number to restore

Update a rule’s content.

Terminal window
brainjar rules update <name> --content <text>
cat content.md | brainjar rules update <name>
FlagDescription
--contentProvide content directly instead of reading from stdin

Activate a rule or rule pack.

Terminal window
brainjar rules add <name> [--project]
FlagDescription
--projectForce project scope (auto-detected from .brainjar/ dir)

Deactivate a rule.

Terminal window
brainjar rules drop <name> [--project]
FlagDescription
--projectForce project scope (auto-detected from .brainjar/ dir)

Permanently delete a rule.

Terminal window
brainjar rules delete <name>

Manage brains — full-stack configuration snapshots (soul + persona + rules).

Snapshot current effective state as a named brain.

Terminal window
brainjar brain save <name> [--overwrite]
FlagDescription
--overwriteOverwrite existing brain

List available brains.

Terminal window
brainjar brain list

Show a brain configuration.

Terminal window
brainjar brain show <name>

Activate a brain — sets soul, persona, and rules in one shot.

Terminal window
brainjar brain use <name> [--project]
FlagDescription
--projectForce project scope (auto-detected from .brainjar/ dir)

Deactivate a brain — clears soul, persona, and rules.

Terminal window
brainjar brain drop <name>

Permanently delete a brain.

Terminal window
brainjar brain delete <name>

Export and import brainjar packs — self-contained shareable bundles.

Export a brain as a shareable pack directory.

Terminal window
brainjar pack export <brain> [--out <dir>] [--name <name>] [--version <ver>] [--author <name>]
FlagDescription
--outParent directory for the exported pack (default: cwd)
--nameOverride pack name (and output directory name)
--versionSemver version string (default: 0.1.0)
--authorAuthor field in manifest

Import a pack directory into the server.

Terminal window
brainjar pack import <path> [--activate]
FlagDescription
--activateActivate the brain after successful import

Manage Claude Code hooks for brainjar.

Register brainjar hooks in Claude Code settings.

Terminal window
brainjar hooks install [--local]
FlagDescription
--localTarget project-local .claude/settings.json

Remove brainjar hooks from Claude Code settings.

Terminal window
brainjar hooks remove [--local]
FlagDescription
--localTarget project-local .claude/settings.json

Show brainjar hook installation status.

Terminal window
brainjar hooks status [--local]
FlagDescription
--localTarget project-local .claude/settings.json

Spawn a subshell with session-scoped state overrides.

Terminal window
brainjar shell [--brain <name>] [--soul <name>] [--persona <name>] [--rules-add <names>] [--rules-remove <names>]
FlagDescription
--brainBrain name — sets soul, persona, and rules from brain file
--soulSoul override for this session
--personaPersona override for this session
--rules-addComma-separated rules to add
--rules-removeComma-separated rules to remove

Remove brainjar-managed config from agent backend and restore backup.

Terminal window
brainjar reset [--backend claude|codex]
FlagDescription
--backendAgent backend to reset (default: claude)

Manage the brainjar server.

Show server status.

Terminal window
brainjar server status

Start the local server daemon.

Terminal window
brainjar server start

Stop the local server daemon.

Terminal window
brainjar server stop

Show server logs.

Terminal window
brainjar server logs [--lines <n>] [--follow]
FlagDescription
--linesNumber of lines to show (default: 50)
--followFollow log output

Switch to managed local server. Creates or switches to the local context.

Terminal window
brainjar server local

Switch to a remote server. Creates a context for the URL if one doesn’t exist.

Terminal window
brainjar server remote <url>

Upgrade brainjar CLI and server to latest versions.

Terminal window
brainjar upgrade # upgrade both
brainjar upgrade --cli-only # upgrade CLI only
brainjar upgrade --server-only # upgrade server only
FlagDescription
--cli-onlyOnly upgrade the CLI
--server-onlyOnly upgrade the server binary

The server upgrade always targets the local binary, regardless of which context is active.


Manage server contexts — named server profiles for switching between local, staging, production, and team servers.

List all contexts. The active context is marked.

Terminal window
brainjar context list

Add a remote context. Validates the server is reachable before adding.

Terminal window
brainjar context add <name> <url> [--workspace <name>]
FlagDescription
--workspaceWorkspace name (default: default)

Remove a context. Cannot remove local or the active context.

Terminal window
brainjar context remove <name>

Switch active context. Syncs configuration from the new server.

Terminal window
brainjar context use <name>

Show context details. Defaults to the active context.

Terminal window
brainjar context show [name]

Rename a context. Cannot rename local.

Terminal window
brainjar context rename <old> <new>

Store an API key for a remote context.

Terminal window
brainjar context set-token <name> <key>

Cannot be used on local contexts — local contexts use auto-generated tokens.


Manage API keys for remote server authentication. All commands require local admin access (local token auth).

Create a new API key. The plaintext key is returned once — save it immediately.

Terminal window
brainjar api-key create --name <name> [--user-id <id>] [--expires-in <duration>]
FlagDescription
--nameKey name (e.g. ci-pipeline)
--user-idUser ID label for the key
--expires-inExpiration duration: 30d, 90d, 365d (1-365 days)

List all API keys (shows prefix only, not the full key).

Terminal window
brainjar api-key list

Revoke an API key by ID.

Terminal window
brainjar api-key revoke <id>

Import file-based content into the server.

Terminal window
brainjar migrate [--dry-run] [--skip-backup]
FlagDescription
--dry-runPreview what would be imported without making changes
--skip-backupSkip renaming source directories to .bak

Generate shell completion script.

Terminal window
brainjar completions <bash|fish|nushell|zsh>

Setup examples:

Terminal window
eval "$(brainjar completions bash)" # add to ~/.bashrc
eval "$(brainjar completions zsh)" # add to ~/.zshrc
brainjar completions fish | source # add to ~/.config/fish/config.fish

Register brainjar as an MCP server for your agent.

Terminal window
brainjar mcp add [--agent <name>] [--command <cmd>] [--no-global]
FlagDescription
--agentTarget a specific agent (e.g. claude-code, cursor)
--command, -cOverride the command agents will run
--no-globalInstall to project instead of globally

Sync brainjar skill files to your agent.

Terminal window
brainjar skills add [--depth <n>] [--no-global]
FlagDescription
--depthGrouping depth for skill files (default: 1)
--no-globalInstall to project instead of globally