Command-Line Interface#
The fractal executable is the operating surface for a fractal tree. The
top-level commands manage the tree as a whole — initialization, baseline
commits, tree-wide pause and resume, teardown — and public sub-apps manage
nodes, inter-node messaging, and iteration plans. Agents inside the tree
run the same commands: every node steers itself and its children through
this CLI, whether driven by an operator at a shell or by the
fractal skill.
Run fractal --help (or --help on any command) for the built-in
summaries; fractal --version prints the package version.
fractal --install-completion installs tab-completion for the current
shell, and --show-completion prints it for manual installation.
Command map#
Command group |
Purpose |
|---|---|
Tree-level operations: skill install, initialization, baseline commits, tree-wide pause and resume, teardown, and the TUI cockpit. |
|
Node lifecycle and management: create, start, signal, merge, delete, inspect, and retune nodes. |
|
|
Time budget introspection: seconds until the next run, iteration, or step timeout (documented on the node page). |
|
Cost budget introspection: remaining headroom, recorded spend, and a per-node breakdown (documented on the node page). |
|
Read and write a node’s configuration keys (documented on the node page; the key reference is Configuration). |
Inter-node messaging: send, post, read, reply, react, and subscribe. |
|
|
Create, delete, and list custom channels (documented on the radio page). |
Create and list per-iteration plan files. |
Conventions#
These behaviors are shared by every command; the per-command pages state only what deviates.
Errors. Core refusals print
Error: <message>on stderr and exit with code2, as do argument errors raised at the CLI boundary — bad values, unknown or ambiguous node names, mutually exclusive flags, missing required options — which print a usage error (Invalid value: <message>). Exit code1is reserved for a command’s own nonzero outcome (fractal commit --checkon a dirty tree), so a script can never read a failed run as a legitimate result. The last line of every failed command isFAILED (exit N)on stderr (bold red on a terminal), so a truncated log still names the failure.The caller and the target. Almost every command takes
--path(default.), which identifies the caller’s worktree — the node the command runs as. Where a command acts on another node, the target is the positionalNODEargument (a branch name). The radio verbs that write rows attributed to the caller resolve it env-first instead — an explicit--path, else the loop-exported_NODE, else the cwd — andfractal radio read’s--pathselects the mailbox being viewed (see fractal radio).Trees. One repository can carry several fractal trees, one per branch
fractal initran on. The tree-scoped verbs (fractal pause,resume,reset,track,untrack,open) take the tree’s root branch as an optional positionalNAMEand otherwise infer it from the caller’s branch — a lone tree answers any checkout; with several trees, a checkout belonging to none of them refuses and asks you to name the tree. On these verbs--pathis the repository path, not a node worktree.fractal openalso accepts a node branch in that slot, which opens the tree owning that node, focused there.fractal destroytakes the sameNAMEbut never infers it;--allis the only repo-wide form.Short names.
NODEarguments on thefractal nodecommands (node costtargets included) and the node-branch form offractal openresolve a unique trailing segment to the full dotted branch (lexerfindsmain.parser.lexer). An ambiguous short name refuses with the candidate list; an unknown one refuses withNo node found for branch: '<name>'. The root-branchNAMEargument onfractal track,untrack,pause,resume,reset, anddestroymatches a tree’s root branch exactly — no short names — and an unknown one refuses withNo fractal tree '<name>' under <repo>. Trees here: <roots>..fractal openandfractal node listtake either name in their one slot: a root matches exactly, anything else resolves as a node branch. Thefractal radiotargets (--node) take the full branch name only.Listings. Listing commands print a text table on a TTY and CSV automatically when piped, so scripts get machine-readable output without flags;
--csvforces CSV either way. Where--jsonexists it prints a JSON array ([]when empty) and is mutually exclusive with--csv. Empty listings still emit the header row.stdout and stderr. stdout is the parseable surface — UUIDs, tables, paths. Notices, warnings, routing echoes, and confirmations of defaulted options ride stderr.
Numeric caps.
--max-depth,--max-children, and--max-descendantsmust be at least0(onnode initandnode update,0disables spawning);--max-itersand the cost caps (--max-cost,--max-iter-cost,--max-step-cost) must be greater than0. Unlimited is expressed by omitting the flag, never by a negative or sentinel value, and an integer cap must fit a signed 64-bit integer (below2**63).Durations. Duration-valued options take
<number><s|m|h|d>— for example30s,10m, or1h— and must amount to at least one second. Bare numbers are rejected. See Configuration.
Internal commands#
Fractal’s hidden sub-apps and the underscore-prefixed fractal node
commands are internal plumbing invoked by fractal’s own scripts — the
in-tmux iteration loop, node seeding, and pre-init configuration writes.
They are hidden from --help and are not user surface; their effects
appear to users only as the iteration loop’s normal behavior (see
The Iteration Loop).