Docs navigation
Command Reference

brainbase orchestration

Create, pull, and push agent graphs, including self-edges when self-delegation is enabled for the organization. See Orchestrations for the concept and the orchestration manifest for the full YAML schema. orch is an alias for orchestration.

Self-edges and Runtime Auto

Self-edge and runtime_mode support requires @brainbase-labs/cli 0.58.0 or later. Upgrade with npm install -g @brainbase-labs/cli@latest. Start a new task after adding the self-edge. Brainbase connects the sandbox's self-delegation tools automatically when the feature is enabled and a self-edge governs the task; no agent secret is needed. Access is checked for the human owner of the root task, not the child agent.

To allow a member to delegate to itself, add an edge with matching from and to slugs, plus its description and optional payload schema. Run orchestration status to inspect drift, then orchestration push. Create, pull, push and sync preserve the self-edge payload schema. See the self-edge manifest example.

Set runtime_mode: auto in that member's brainbase.agent.yaml for per-child execution selection, or fixed for the lead's effective pair. Omission preserves the remote mode. Choose lead harness and effort in the console; --harness on orchestration pull selects the local folder layout, not a child's execution. The CLI has no separate enablement switch: it reports server refusals such as self_edge_disabled and runtime_auto_disabled.

Pull cloud changes before pushing; stale sync state cannot silently remove an unpulled self-edge or acknowledge an unpulled runtime mode. Removing a self-edge blocks new child admissions but keeps read and Stop for admitted children. It does not make an enrolled task or its agent deletable while retained records depend on them.

brainbase orchestration init

Write a starter brainbase-orchestration.yaml in the current folder and stop. It needs no login and makes no network calls, so it works offline, in CI, and inside a sandbox. The file is valid input to orchestration create as written. It has no members, because create requires a local checkout for every member; add members after creating the orchestration with orchestration add-agent.

bash
brainbase orchestration init --name "Support Flow"
brainbase orchestration create
brainbase orchestration add-agent triage
FlagDescription
--name <name>Orchestration name. Defaults to the folder name.
--fullWrite a commented template documenting every optional block: icon, colour, credit limit, members, edges, and schedule triggers.
--minimalWrite the starter manifest. This is the default.
--forceOverwrite an existing brainbase-orchestration.yaml. Without it, init exits 1 and leaves the file alone. A folder linked to an orchestration is always refused: edit its manifest and run orchestration push instead.
--jsonPrint { path, created, name, template }, or { path, created: false, reason } when it refuses.

brainbase orchestration create

Claim a local brainbase-orchestration.yaml and create the orchestration in the cloud. Every declared member must already have a linked checkout under agents/<slug>/. The command validates the graph and schedule triggers, attaches the existing members, creates edges, edge settings, and schedule triggers, then writes gitignored link and sync state.

bash
brainbase orchestration create
brainbase orchestration create --org <org-id-or-slug> --team <team-id> --yes
FlagDescription
--org <id-or-slug>Create in this organization.
--team <id>Create in this team.
--yes, -ySkip the creation confirmation.

brainbase orchestration list

List orchestrations under a team. --org accepts an organization ID or slug; --team accepts a team ID. Note the CLI's vocab inversion: --org maps to the DB teams.id and --team maps to the DB groups.id.

bash
brainbase orchestration list
brainbase orchestration list --org <org-id-or-slug> --team <team-id>
brainbase orchestration list --team <team-id> --json | jq -r '.[].id'
FlagDescription
--org <id-or-slug>List within this organization.
--team <id>List within this team.
--jsonPrint the orchestration array and nothing else. Never prompts; pass --team <id> when the choice is ambiguous.

brainbase orchestration pull <id>

Recursively fetch an orchestration plus every member agent. Pull preserves edge settings, materializes member runtime configuration, writes schedule triggers in their writable normalized form, and retains non-schedule app triggers as read-only context.

bash
brainbase orchestration pull <orchestration-id>
brainbase orchestration pull <orchestration-id> --harness codex --yes
FlagDescription
--harness <id>Harness for newly-created member folders (default claude-code).
--forceDiscard unpublished concurrency edits in the orchestration and linked member manifests. Without it, pull refuses before writing files.
--yes, -ySkip confirmation prompts.

brainbase orchestration push

Recursively push each member agent, then update the graph: membership, edges, edge settings, and schedule triggers. Use --graph-only to update that graph without pushing member-agent content. Non-schedule triggers are preserved in YAML but ignored by push.

bash
brainbase orchestration push
brainbase orchestration push --graph-only
brainbase orchestration push --force
FlagDescription
--graph-onlyPush members, edges, edge settings, and schedule triggers, but not member-agent content.
--forceSettle every conflict in the local manifest's favour. See below.
--yesSkip confirmation prompts.

Push refuses, and names each conflict, when the cloud holds schedule triggers this checkout has never pulled or that were edited in the cloud since, or when orchestration metadata — name, description, icon, icon_color, credit_limit — changed both locally and in the cloud. Run orchestration pull to take the cloud's side, or --force to take yours. One flag settles both kinds: the cloud's conflicting schedule triggers are deleted and the metadata fields are overwritten with the file's values. A field only the cloud changed is never reverted. The flag applies to the graph only: member agents are still pushed without it, so a member's own conflict is settled with agent push --force in that member's folder.

brainbase orchestration add-agent <name>

Create a new member agent, wire its edges into the graph, and push. add is an alias for add-agent.

bash
brainbase orchestration add-agent researcher --from planner --to writer
FlagDescription
--from <agent>Source edge into the new agent (repeatable).
--to <agent>Edge out of the new agent (repeatable).
--self-loopAlso give the new agent an edge to itself, so its tasks can spawn copies.
--description <text>Description for the new member agent.
--schema <json>Edge payload schema.
--harness <id>Target harness for the new member agent.
--org <id>Scope to an org.
--no-pushCreate and wire locally but skip the push.
--yesSkip confirmation prompts.

brainbase orchestration self-loop [<member>]

Add, edit or remove the edge from a member agent to itself, then push the graph. This is the console's self-loop on an agent: with it, the agent's tasks can spawn copies of themselves. The member can be left out when the orchestration has one member. To give a standalone agent a self-loop, wrap it in an orchestration first with brainbase orchestration from-agent.

bash
brainbase orchestration self-loop builder --description "Split the build by package"
brainbase orchestration self-loop builder --schema '{"type":"object","properties":{"package":{"type":"string"}}}'
brainbase orchestration self-loop builder --remove
FlagDescription
--description <text>What a copy is for. An empty string clears it.
--schema <json>JSON Schema for the payload a spawn must carry.
--removeDelete the self-loop. Copies already running keep running.
--no-pushChange brainbase-orchestration.yaml only.

An edit changes only the fields given, so --description alone keeps the payload schema. The same edge can be written by hand; see Self-edges. Runtime mode, the children limit and the shared folder are set with agent runtime.

brainbase orchestration delete <id>

Permanently delete an orchestration graph. Its member agents are kept. The id is required and never taken from the linked folder. Find ids with orchestration list.

bash
brainbase orchestration delete <orchestration-id>
brainbase orchestration delete <orchestration-id> --yes --json
FlagDescription
--yes, -yDelete without the confirmation prompt. Required with no terminal. See destructive commands.
--jsonPrint { id, kind, name, deleted } and nothing else. Requires --yes, because --json never prompts.

If the folder you run it in is linked to the deleted orchestration, the command says so: delete .brainbase/orchestration-link.json before recreating it with orchestration create.

brainbase orchestration status

Preview membership, edge description/payload/settings, and schedule trigger drift. Status also reports missing or stale member checkouts and cloud revision drift since the last pull. Schedule drift compares the UUID node, active state, normalized config, and target edges; non-schedule triggers are not diffed.

bash
brainbase orchestration status