CLI reference
Every binary under cmd/, exit codes, signal handling, v2 t12 subcommands, and legacy v1 commands.
factory/cmd/ builds twelve binaries. Four (t12, t12-ui, t12-adapter, t12-container) load ~/.config/t12/env at startup via envfile.Load(envfile.Path()), and t12-bench grade loads it on demand.
Every v2 verb defaults --home DIR to $T12_HOME or ~/t12/home, except t12 repo auth, t12 config check|explain, and t12 eval run (no --home), while t12 eval seams|capture require --home.
Ask & confirm
Start a conversation (t12 ask), connect repos (t12 repo), and lock specs (t12 confirm).
Run & approve
Execute lanes (t12 run), stream progress (t12 watch), and approve policy stops (t12 approve).
Release & preview
Verify gates (t12 release), merge to main, and serve locally (t12 preview).
UI, config & SRE
Host the web app (t12 ui), manage users (t12 access), and monitor URLs (t12 sre).
Common commands
factory/bin/t12 repo init --name bakery-blog
factory/bin/t12 ask --project-dir ~/t12/bakery-blog "I want a blog for my bakery"
factory/bin/t12 confirm --conversation <id> --acceptor Lan --name bakery-blog
factory/bin/t12 run --conversation <id>
factory/bin/t12 watch --conversation <id>
factory/bin/t12 release signoff --conversation <id> --by Lan
factory/bin/t12 release merge --conversation <id> --by LanExit codes, signals, and dual v1/v2 dispatch
- Exit codes:
0= success;1= failure, blocking gate/lock, or failed verification (errFailed);2= bad usage (errUsage). - Signals (
SIGINT/SIGTERM): Stops tracked child process groups (SIGTERM,2s,SIGKILL) and exits128 + signal(previewremoves its container;t12-uidrains HTTP for5s). - Conversation aliases: Every
v2conversation verb accepts--conversation IDwith--request IDas a legacy alias, andt12 requestaliasest12 conversation. - Dual dispatch:
t12 status --task-id <id>andt12 reportwithout--conversation/--requestroute tov1(flag.FlagSet/set.Visit); pass--conversation <id>forv2. - Home guard: Every home command refuses to run if the
t12binary sits inside--home.
Renamed flags and paths
- Flags:
--product-diris now--project-dir,t12-cc --productis now--project, andt12-wizard --product-repois now--project-repo. The old spellings are no longer accepted. - Paths: The repo config is
.t12/config.json(the old.t12/product.jsonis still read), and the home registry isprojects.json. The first open of an older home renames them; see Layout migration. - Not the profile:
.t12/project.jsonis the profile thatt12 profile-checkvalidates. It is a different file from.t12/config.json.
v2 conversation commands
| Command | Key flags | Purpose |
|---|---|---|
t12 ask | --home, --project-dir | --repo, --type, --issue, --image, --conversation, --answer, --resume | Starts or continues a repo-backed Context creator conversation with up to 5 images (5 MiB) or 5 (1..20) GitHub issues. |
t12 confirm | --conversation ID, --acceptor NAME, --name SLUG, --project-dir, --github | Checks start gate and toolchain, scaffolds or verifies an adopted repo, runs Project Gate, and commits OpenSpec on staging. |
t12 run | --conversation ID, --skip-review, --answer TEXT, --by observer, --release | Runs the orchestrator pipeline (T12_AUTONOMY aware) and records outcomes; --release runs release checks only. |
| Command | Full flags | Notes |
|---|---|---|
t12 ask (new) | [--home DIR] (--project-dir DIR | --repo OWNER/REPO|URL) [--repo-branch BRANCH] [--type web-blog|web-app|desktop] [--issue OWNER/REPO#N|URL]... [--issue-file PATH] [--issues-file PATH] [--source OWNER/REPO#N] [--image PATH]... [--by NAME] [--id ID] [--json] [TEXT] | Requires git repo via --project-dir or --repo; --repo rejects --type desktop; --source records offline factorybench refs. |
t12 ask (continue) | --conversation ID [--answer TEXT] [--add-issue REF]... [--remove-issue REF]... [--set-issues REF]... [--issues-file PATH] [--by NAME] [--image PATH]... [--resume] [--json] | Issue-edit flags never combine with --image. |
t12 confirm | --conversation ID --acceptor NAME [--home DIR] [--project-dir DIR] [--name SLUG] [--github OWNER/NAME] | Repo flags optional when already bound; defaults to ~/t12/<SLUG>. |
| Command | Full flags | Notes |
|---|---|---|
t12 eval run | [--dir DIR] [--role ROLES] [--case IDS] [--harness H] [--model M] [--thinking T] [--offline] [--json] | Roles: code-review, spec-judge, deslop, strategist, red-team. |
t12 eval seams | --home DIR --request ID [--tokens N] [--json] | Requires --home and --request. |
t12 eval capture | --home DIR --request ID --lane LANE --role ROLE --out DIR [--id ID] [--expect must-catch|must-not-catch] | Requires --home and --request. |
Binaries
| Binary | Role | Network boundary | Loads envfile |
|---|---|---|---|
t12 | Main CLI for v2 requests and legacy v1 runs | Links no net/http (TestTheCoreAndTheCageProgramsLinkNoNetworkCode); spawns git, docker, harnesses (agy, omp, claude), subprocess adapters (ghcli, ghissue, ghrepo, fbreport), t12-ui, t12-adapter | Yes |
t12-ui | Web server (internal/ui) serving SPA, API, SSE, Observer, SMTP | Imports net/http and net/smtp; binds 127.0.0.1:8790 by default | Yes |
t12-adapter | Host adapter for forges, issues, trunk jobs, skills, Context7, SRE | Imports net/http; holds host tokens and makes outbound HTTP calls | Yes |
t12-bench | FactoryBench grader (grade, tokens, summarize) for hidden checks and pass@k/pass^k stats | Offline (links no net/http; executes checks via served.App) | grade only |
t12-cage | Linux Landlock + PID/user namespace wrapper (internal/cage) | Offline (links no net/http); Landlock denies TCP unless --network is passed | No |
t12-container | Wraps bin/t12 inside read-only --network none Docker container | Offline (links no net/http; --network none) | Yes |
t12-job | Legacy v1 trunk runner (cubic, sentry, sonarqube) | Links net/http transitively via internal/adapters/common; delegates HTTP calls to t12-adapter | No |
t12-mutate | Standalone Go mutation testing and test-pruning tool | Offline (links no net/http) | No |
t12-queue | Legacy v1 task queue dispatcher launching sibling t12 | Links net/http transitively via internal/adapters/common; launches lanes via sibling t12 | No |
t12-runner | Legacy v1 inner-loop driver with optional factorybench emit | Links net/http transitively via internal/adapters/common and internal/skills; spawns harnesses and t12-adapter | No |
t12-cc | Legacy v1 standalone Context creator CLI | Links net/http transitively via internal/adapters/common and internal/skills; spawns omp sessions | No |
t12-wizard | Legacy v1 guided workspace CLI | Offline (links no net/http); runs git, gh, t12, t12-runner, t12-adapter | No |
Legacy v1 commands
Legacy v1 pipeline
These commands drive the older per-task runs/<task-id>.json flow (model.Version = 8) slated for removal at cutover G1. Direct new work to the v2 commands above.
| Command | Usage signature | Role |
|---|---|---|
init | --repo DIR --home DIR [--trunk main] | Initializes a v1 state home (config.json, runs/, evidence/, worktrees/). |
profile-check | --repo DIR | Validates .t12/project.json and referenced verify skills without a state home. |
prepare | --home DIR --task FILE [--supersede [--carry]] | Admits a v1 task JSON file, creates its worktree, times base tiers, and writes runs/<id>.json. |
context | --home DIR --task-id ID --role ROLE --phase PHASE [--unit UNIT] | Prints rendered prompt, skills, and JSON context for a v1 worker session. |
tool-schema | --home DIR --task-id ID --role ROLE [--host-tools] [--unit UNIT] | Prints JSON Schema or host tool definitions for a v1 role. |
act | --home DIR --task-id ID --role ROLE --session ID --input FILE [--patch FILE] [--raw FILE] [--parsed-by raw] [--run-id ID] [--unit UNIT] | Records and executes one v1 worker tool call (test_list_ready, red_test_ready, green_ready, refactor_done, engineer_done, mutant_equivalent, verification_done, review, escalate). |
tdd-step | --home DIR --task-id ID [--unit UNIT] | Runs final unit tier, lint, and mutation check to pin the candidate, or merges --unit into the run branch. |
review | --home DIR --task-id ID --role ROLE --session ID --verdict approve|changes-requested|human-gated --report FILE | Records a v1 review role verdict and report blob. |
qc | --home DIR --task-id ID | Runs v1 static checks and e2e tier on the pinned candidate. |
check | --home DIR --task-id ID | Re-verifies the v1 evidence chain and transitions to local-verified. |
manifest | --home DIR --task-id ID [--out FILE] | Writes the v1 evidence manifest and records its digest. |
verify | --home DIR --task-id ID | Audits v1 event chain, evidence refs, exit codes, worktree HEAD, and manifest without modifying state. |
repair | --home DIR --task-id ID | Drops a torn trailing line from runs/<id>.events.jsonl and records a recovered event. |
probe | --home DIR --task-id ID | Executes in-cage credential and external-access probes (_probe) and records results on the v1 run. |
deliver | --home DIR --task-id ID --adapter github|gitlab|bitbucket|asana --report FILE [--resolves] | Validates and stores a t12-adapter delivery report on the v1 run. |
pause | --home DIR --task-id ID --reason TEXT | Transitions a v1 run to paused. |
resume | --home DIR --task-id ID [--answer TEXT] [--repair-cap N] [--cycle-limit N] [--unit UNIT [--op-limit N]] | Verifies worktree, locked tests, evidence, and log before resuming a paused v1 run or lane. |
stop | --home DIR --task-id ID --reason TEXT | Transitions a v1 run to stopped. |
escalate | --home DIR --task-id ID --question TEXT [--unit UNIT] | Pauses a v1 run or lane with an open human question. |
board | --home DIR [--json] | Lists active and finished v1 runs and parallel lanes with remaining budgets. |
retro | --home DIR [--json] [--min 2] | Aggregates recurring findings across v1 runs into candidate lessons. |
calibrate | --home DIR [--apply] | Computes recommended limits.json defaults from completed v1 runs (--apply writes limits.json). |
Next steps
UI and access
How t12-ui serves an embedded React SPA and live SSE flow graphs, enforces CSP/CSRF, manages mode/approvals/Observer, and delegates git and pipeline writes to t12.
Configuration reference
Schemas for .t12/config.json and .t12/preferences.json, fixed rules, env file format, and environment variables.