Reference

CLI Reference

Every Braingent CLI command, every flag, every exit code.

The braingent CLI is a thin wrapper around plain Markdown operations. Every command can be replaced with a manual edit + git commit — but the CLI is faster and adds validation, indexing, and templating.

This page is the canonical surface. For tutorial-style explanations, see the CLI Workflows guide.

Global flags

These flags are accepted by every command:

FlagDefaultNotes
--path <dir>$BRAINGENT_PATH or ~/Documents/repos/braingentThe memory repo to operate on.
--jsonoffEmit JSON instead of human-readable output.
--quietoffSuppress non-error output.
--verboseoffPrint debug detail.
--no-coloroffDisable ANSI colors.
--versionPrint CLI version and exit.

Environment variables

VariableWhat it sets
BRAINGENT_PATHDefault value for --path.
BRAINGENT_NO_COLORSame as --no-color.
BRAINGENT_LOG_LEVELdebug / info / warn / error.

init

Bootstrap a new memory repo from the starter pack.

braingent init [target-dir]
FlagDefaultDescription
target-dirrequiredWhere to create or seed the repo.
--from <path>bundledUse a different starter pack source.
--non-interactiveoffUse defaults; skip prompts.
--forceoffOverwrite existing files (dangerous).
--no-gitoffSkip git init.
--name <slug>from promptRepo display name.

Exit codes:

  • 0 — success.
  • 2 — target directory not empty without --force.
  • 3 — required tool missing.

doctor

Health-check a memory repo.

braingent doctor [--strict]
FlagDefaultDescription
--strictoffWarnings become errors.
--check <key>allRun only the named checks.
--skip <key>noneSkip the named checks.

Check keys: entrypoints, placeholders, frontmatter, indexes, tooling, private-paths, links.

Exit codes:

  • 0 — clean.
  • 1 — error(s) reported.
  • 2 — warning(s) under --strict.

validate

Check frontmatter only.

braingent validate [--kind <kind>] [--since <date>]
FlagDefaultDescription
--kind <kind>allLimit to one record kind.
--since <date>Only records created on or after this date.
--fixoffAuto-fix safe issues (date formatting, slug case).

find

Filter records by frontmatter fields.

braingent find [--kind ...] [--repo ...] [--tag ...] [--status ...] [--since ...] [--limit N]
FlagNotes
--kind <kind>One of: task, decision, review, learning, repo, project, topic, tool. Repeatable.
--repo <slug>Repeatable.
--project <slug>Repeatable.
--topic <slug>Repeatable.
--tool <slug>Repeatable.
--tag <tag>Repeatable.
--status <status>Kind-specific.
--owner <name>Match owner field.
--since <date>YYYY-MM-DD.
--until <date>YYYY-MM-DD.
--limit <n>Default 50.
--sort <field>date (default), id, title.

Output: <id> <title> <path> per line, or JSON with --json.

get

Fetch one record.

braingent get <id> [--depth summary|full]
FlagDefaultDescription
--depthsummarysummary returns frontmatter + first paragraph; full returns whole body.
--with-linksoffInclude linked record summaries.
--format <md|json>mdOutput format.

recall

Build a focused context pack.

braingent recall <query> [--task <id>] [--max N]
FlagDefaultDescription
<query>required (or --task)Free-text concept.
--task <id>Walk links from a specific task instead.
--max <n>12Maximum records in the pack.
--depth <n>2How many graph hops to walk.
--include-archivedoffInclude archived records.

Full-text body search with frontmatter ranking.

braingent search <query> [--kind ...]

Standard boolean syntax: temporal AND idempotency, (jobs OR webhooks) AND -archived.

FlagDefaultDescription
--kind <kind>allRepeatable.
--limit <n>50
--context <n>1Lines of body context per hit.

capture

Write a record without touching an agent.

braingent capture --kind <kind> --title "..." [--tags ...] [--body ...]
FlagRequired?Description
--kind <kind>yesThe record kind.
--title "..."yesRecord title.
--status <status>noDefaults to kind’s “live” value.
--repo <slug>repeatableAdds to repos.
--project <slug>repeatableAdds to projects.
--topic <slug>repeatableAdds to topics.
--tool <slug>repeatableAdds to tools.
--tags <a,b,c>comma-listAdds to tags.
--link <id>repeatableAdds to links.
--body @<path>noRead body from file.
--body "..."noInline body.
--dry-runoffPrint path + frontmatter, don’t write.
--no-commitoffWrite file but skip git commit.

update

Apply starter-pack improvements safely.

braingent update [--apply auto|all|none] [--dry-run]
FlagDefaultDescription
--apply <mode>autoauto = safe-only, all = include manual review, none = plan only.
--dry-runoffPrint plan, don’t write.
--from <path>bundledUse a different starter-pack source.

synthesize

Generate a synthesis page that cites records.

braingent synthesize --topic <slug> --out <path>
FlagRequired?Description
--topic <slug>one of theseSynthesize within a topic.
--repo <slug>one of theseSynthesize within a repo.
--project <slug>one of theseSynthesize within a project.
--since <date>noLimit by date.
--max-records <n>no, default 40Cap how many sources are included.
--out <path>yesOutput Markdown path.

qa-generate

Generate a strict QA plan from ticket + memory + evidence. See QA Test Planning.

braingent qa-generate --ticket <path> [--evidence <path>] [--gatherstep] [--format <fmt>] [--out <path>]
FlagDescription
--ticket <path or URL>Source ticket. Required.
--allow-missing-acSkip the AC requirement. Pair with --intent.
--intent "..."Free-text product intent when AC is missing.
--evidence <path>qa-evidence.v1 manifest from your build.
--gatherstepPull native evidence from Gather Step’s CLI.
--memory <path>Path to memory repo (defaults to --path).
--budget-tokens <n>Default 160000.
--format <md|xray|testrail|gherkin>Output format.
--out <path>Output path. Required.
--strictTreat precheck warnings as errors.
--include-risksOn by default. Add risks per case.

Exit codes:

  • 0 — plan generated.
  • 1 — precheck error.
  • 2 — strict-mode warning.

Live task commands — task-*

See Multi-Agent Coordination for the full flow.

CommandNotes
task-new "<title>"--priority P0..P4, --repo, --project.
task-claim <BGT-ID>--as <agent>.
task-status <BGT-ID> "<line>"Append to status log.
task-question <BGT-ID> "<text>"Add to open questions.
task-block <BGT-ID> "<text>"Add to blockers.
task-unblock <BGT-ID> "<text>"Resolve a blocker.
task-close <BGT-ID>--status done|abandoned.
task-list--status, --owner, --repo.
task-archive <BGT-ID>Move from tasks/active/ to tasks/done/.

mcp serve

Start the MCP server.

braingent mcp serve [--port <n>] [--read-only]
FlagDefaultDescription
--port <n>stdioUse TCP instead of stdio.
--read-onlyoffDisable any future write tools.

Print agent entrypoint contents (no file changes).

braingent print-prompts --agent <claude|codex|chatgpt|gemini> [--copy]
FlagDefaultDescription
--agent <name>requiredWhich entrypoint to print.
--copyoffCopy to clipboard instead of stdout.

reindex

Regenerate indexes/*.md and search caches.

braingent reindex [--check]
FlagDefaultDescription
--checkoffExit non-zero if indexes drifted; don’t write.

Where to go next