Referencia de la CLI

Todos los comandos de `orch`, agrupados por verbo de primer nivel, generados desde el arbol de cobra.

Referencia de la CLI orch

Generado por go run ./cmd/orch-docs desde cli.NewRoot() (client/internal/cli). 335 comandos en total, 52 ocultos (ver "Modo avanzado / protocolo de agentes" mas abajo).

orch#

Orchemax — run AI coding agents together on your projects

orch [flags]
Orchemax sits under the agents you already use (Claude, OpenCode, Cursor, Codex, …). It does not replace their UI.
It adds shared-folder locks, a local LLM gateway (token savings + provider
failover), and a simple way for sessions to hand off work.

The command-line name is:  `orch`

First-time setup
  1. Run `orch install` (also works on the downloaded file) — it copies Orchemax to its
     per-OS folder and adds that folder to your user PATH
  2. Create or cd into your workshop folder (the folder that holds your projects)
  3. Run:  `orch init`
     → binds this folder as a workshop when it is not bound yet (writes `orch.yaml` + `.orch/`)
     → then offers the ordered layout (shared + projects), thin CLAUDE/TRACKER, git per folder

Connect LLM providers (user-wide — once for all workshops)
  `orch gateway setup --live --name … --url … --key-env MY_API_KEY`
  → writes %LOCALAPPDATA%\Orchemax\ai.yaml
  → put the secret in a Windows User environment variable (not in yaml)
  `orch gateway`

  A workshop `orch.yaml` can still override ai.providers if you need a special case.

Start working (from inside your workshop)
  Open any agent on your PATH:  `orch <name>`
  `orch ui`              # optional local web console
  `orch workshop`        # show resolved workshop for this folder

Tips
  Type your prompt inside the agent UI — not as arguments to `orch`.
  Outside a workshop: loose mode (gateway OK; no locks/bus/project control).
  Agents that know Orchemax use MCP — see docs/PROTOCOL-AGENT.md.
  Bare `orch` prints this help. Use:  `orch <command> --help`
  Agent-facing commands (mcp, dispatch, msg, ask, task, guard, index, seats)
  are listed under "Agents & workshop:" below; the learning engine (learn, memory,
  chair) under "Learning & memory:". A few internal-only verbs stay
  hidden; they still work if you know their name.

Docs: https://docs.orchemax.com
bandera tipo valor por defecto persistente ayuda
--config string orch.yaml si ``path to `orch.yaml```

orch acp#

Agent Client Protocol session commands

orch acp [flags]

orch acp list#

List ACP agent sessions recorded for resume

orch acp list [flags]

orch acp resume#

Continue a recorded ACP session with one more prompt

orch acp resume <session-id> [flags]
Drives one more session/prompt turn against an agent session recorded by a
prior ACP dispatch (see: `orch acp list`), preferring session/resume and
falling back to session/load — whichever the agent's initialize response
advertises. Fails with an explicit "capability absent" message when the
agent advertises neither. Reuses the routing env the original dispatch
resolved: a session recorded as opencode-gateway gets its worktree
OPENCODE_CONFIG and a freshly minted worker key back, never the operator's
own OpenCode config; any other route runs with the environment untouched.
bandera tipo valor por defecto persistente ayuda
--cwd string `` no override the session's recorded cwd (use when its worktree was pruned)
--prompt, -p string `` no prompt text
--prompt-file string `` no read prompt from file
--timeout int 300 no turn timeout seconds

orch agents#

Detect coding agents installed on your PATH

orch agents [flags]
Scans your PATH for known agent CLIs and records what was found.
Presets are never written into `orch.yaml` until you name them.

  `orch agents scan`              # look for agents; write a snapshot
  `orch agents show`              # print last scan
  `orch agents apply <id>…`       # add ONLY the agents you name to `orch.yaml`

Tool execution permissions:
  Orchemax oversees sandboxes, worktrees, and quality gates. Dispatched workers
  and interactive seats configure tool auto-approval (e.g. `agy --dangerously-skip-permissions`,
  `cursor --approve-mcps --trust` (interactive) / `--force --trust --approve-mcps` (headless),
  `opencode run --auto`) so child CLIs run smoothly
  without prompting for confirmation on every command.

orch agents apply#

Add named agents to `orch.yaml` (only what you list)

orch agents apply [id...] [flags]
Add the named agent id(s) to `orch.yaml`. Never applies the whole PATH scan.

  `orch agents apply openclaude`
  `orch agents apply openclaude cursor`

--yes is accepted for CLI consistency with init/setup (apply has no prompts).
bandera tipo valor por defecto persistente ayuda
--yes bool false no Accept defaults for every prompt — no stdin required (mirrors `orch init --yes`)

orch agents scan#

Scan PATH and save results (does not change `orch.yaml` yet)

orch agents scan [flags]

orch agents show#

Print the last agents scan (scans PATH first if none exists yet)

orch agents show [flags]

orch agents-md#

Regenerate AGENTS.md from the live ledger/board

orch agents-md [flags]

orch agents-md refresh#

Regenerate the workshop root AGENTS.md

orch agents-md refresh [flags]
Rebuilds AGENTS.md's Tools section from the registered MCP tools and its
Ledger/Board sections from .workflow/LEDGER.md and .workflow/BOARD.md.

Non-clobber like every other seed: an existing non-empty AGENTS.md is left
alone unless --force.
bandera tipo valor por defecto persistente ayuda
--dry-run bool false no print what would happen without writing
--force bool false no overwrite an existing non-empty AGENTS.md

orch ask#

Answer blocking questions raised by workers

orch ask [flags]

orch ask answer#

Answer an open ask; the blocked worker resumes immediately

orch ask answer <id> [text] [flags]
bandera tipo valor por defecto persistente ayuda
--answer string `` no the answer, when not passed positionally
--by string `` no who answered (default human)

orch ask list#

List asks (default: the open ones) as id, seat, age, question

orch ask list [flags]
bandera tipo valor por defecto persistente ayuda
--json bool false no emit the raw rows instead of the table
--limit int 50 no max rows
--session string `` no filter by asker or addressee session
--status string open no open|answered|timeout|all

orch audit#

Independent audit of a worker branch: start a clone with a lease, record the result (accept/fix/reject)

orch audit [flags]

orch audit destructive#

List the destructive commands seats ran or were refused (masked of secrets)

orch audit destructive [flags]
bandera tipo valor por defecto persistente ayuda
--since string `` no cutoff: duration (24h, 7d) or date (2026-09-01, RFC3339); default all

orch audit done#

Finish an audit: release its load and store the verdict with its whole report

orch audit done <session> accept|reject|fix --file <report> [flags]
bandera tipo valor por defecto persistente ayuda
--file string `` no the audit report file (required)
--sibling-ok string `` no reason to accept although an accepted sibling conflicts or fails together with this session (recorded and counted)

orch audit export#

List sessions sealed since a cutoff: guard verdicts, files-changed count, promote eligibility, usage

orch audit export [flags]
bandera tipo valor por defecto persistente ayuda
--json bool false no JSON Lines output (one AuditRecord per line) instead of the table
--since string 24h no cutoff: duration (24h, 7d) or date (2026-09-01, RFC3339)

orch audit start#

Start an audit of a session: count its load, gate its brief, clone the branch into the sandbox

orch audit start <session> --brief <file> [flags]
bandera tipo valor por defecto persistente ayuda
--brief string `` no the audit brief file (required)
--for duration 1h30m0s no how long the audit's load hold lasts at most
--lesson-ok string `` no reason to start although a lesson enforce clause refuses this brief (recorded and counted; env ORCH_LESSON_OK)

orch brief#

Write worker brief skeletons

orch brief [flags]

orch brief new#

Write a brief skeleton with every section the brief lint requires (--out file, else stdout)

orch brief new <item> [flags]
bandera tipo valor por defecto persistente ayuda
--continue string `` no session to continue: names its branch and last seal failures
--out string `` no write the skeleton to this file instead of stdout

orch budget#

Daily token budget (`orch.yaml` budget.*)

orch budget [flags]

orch budget status#

Used/cap per seat and workspace for today

orch budget status [flags]
bandera tipo valor por defecto persistente ayuda
--format string table no table|json
--project string `` no git repo path (default: registered project containing cwd)

orch bus#

Bus diagnostics

orch bus [flags]

orch bus selftest#

Time a health check + phrase exchange over the bus with no model in the loop; --live repeats it with real models

orch bus selftest [flags]
Exercises the bus mechanism (notify.CommitSend / bus.Wait / bus.AckMessage) with a
constant phrase and no model in the loop, so a failure is the bus and not an LLM.
Phase 1 is a health handoff every seat must see from every other seat; phase 2 has
each seat send the phrase and return every phrase it collected. Each leg reports
measured dispatch, delivery, ack and round-trip milliseconds. Runs push and poll
(the daemon-off fallback) so the two are comparable; --live repeats the identical
exchange through the seats' real models. A seat with nothing running is reported as
not live, with what was tried. One evidence file per run lands under the data dir.
bandera tipo valor por defecto persistente ayuda
--live bool false no repeat the identical exchange through the seats' real models (agents.workers presets)
--seats string a,b no comma-separated seat names (min 2)
--timeout int 20 no per-leg wait timeout, seconds

orch chair#

Configure orchestration guidance for your main (lead) agent session

orch chair [flags]
Optional rules for how the lead session should break work into tasks
and coordinate workers. You can accept or reject each suggestion.

  `orch chair setup`     # interactive Y/n
  `orch chair show`
  `orch chair install`   # write skill/guidance files agents can discover

orch chair brief#

Print the sections a new Chair seat receives, each with its size (read-only)

orch chair brief [flags]
bandera tipo valor por defecto persistente ayuda
--project string `` no project path (default: registered project containing cwd, else the workshop)

orch chair install#

Write guidance files + MCP from chair.guidance flags

orch chair install [flags]
bandera tipo valor por defecto persistente ayuda
--allow-user-scope bool false no non-interactive consent for --scope user; required when stdin is not a terminal
--dry-run bool false no list paths without writing
--scope string project no project (default: workspace files only) | user (~/.claude/settings.json + `orch-mcp.json`, ~/.cursor/mcp.json, and each CLI's home skills dir)
--target string project no project|claude|openclaude|cursor|commandcode|opencode|all (comma-ok); anything beyond project needs --scope user --allow-user-scope

orch chair next#

List the preparation actions a Chair can take while work is in flight (read-only)

orch chair next [flags]

orch chair setup#

Suggest guidance flags (Y/n), save `orch.yaml`, reinstall project files

orch chair setup [flags]
bandera tipo valor por defecto persistente ayuda
--yes bool false no accept all suggestions without prompts

orch chair show#

Show effective chair.guidance flags

orch chair show [flags]

orch cycle#

Learning cycle: detected errors until each is memorized as a lesson

orch cycle [flags]

Link a row to the ledger item or gate that improves it

orch cycle link <row> <item> [flags]

orch cycle list#

List the rows not yet memorized, each with the command that advances it

orch cycle list [flags]

orch cycle tick#

Advance the cycle once: landed items, proposals for unowned needs-gate lessons, repeated rows; prints a digest

orch cycle tick [flags]

orch dispatch#

Run one agent once without its interactive UI (automation)

orch dispatch [flags]
Runs an agent headlessly with a prompt (CI / scripts).

For the normal interactive agent UI, prefer:
  `orch <name>`  (any coding-agent CLI on your PATH)

Refusals exit with their own code (any other error exits 1):
  80  done-means
  81  brief-lint
  82  clarify
  83  needs-gate
  84  unknown-names
  85  load
  86  overlap
  87  audit-rerun

bandera tipo valor por defecto persistente ayuda
--acp-session string `` no resume this ACP session id instead of starting a new one (transport acp presets only)
--actor string `` no policy actor (default: ORCH_ACTOR or local)
--agent string default no CLI preset or agents.workers[].name (roster nickname)
--auth string `` no credential mode: account (vendor login) or gateway (Orchemax virtual key)
--base string `` no ref the worker's worktree starts from: the seal judges the run only on commits beyond this ref's tip — the ref itself is never written, reset or checked out
--continue string `` no session id of an unfinished run to pick up: the worktree starts at its branch tip, the prompt gets its status, last words and commits (its prompt is reused when --prompt is absent), and the seal judges from its base
--force bool false no bypass clarify_before_spawn ledger gate
--force-load string `` no reason: dispatch although 3+ heavy loads run on a busy host (Orchemax counts each override)
--force-reason string `` no reason for --force; a second override within 24 h must name an open ledger item id
--from-branch string `` no ref the worker's setup comes from: commits whose files all match its tip count as setup, and a run with nothing beyond them seals no_work ("only the setup from \<ref>")
--gate-ok string `` no reason: dispatch a non-base brief although a lesson recurred with no mechanism (Orchemax counts each override)
--inplace bool false no run in project root (shared disk; multi-agent coord)
--keep-worktree bool false no keep worktree after run
--lane string `` no fast: after a completed seal Orchemax audits the branch itself and queues it for the next land batch (one package, at most 150 changed lines); anything else falls back to the normal lane
--lesson-ok string `` no reason: dispatch although a lesson enforce clause refuses this brief (Orchemax counts each override)
--login bool false no keep vendor plan login (alias for --auth account)
--name string `` no session display name (default: agent id; like claude -n)
--no-done-means bool false no allow a prompt without numbered ## Done means lines (exploratory run)
--overlap-ok string `` no reason: dispatch although a running worker already changes a file the brief names (Orchemax counts each override)
--plan bool false no read-only: deny every write tool call, require a plan in the final answer, fail sealing if the tree changed
--plan-from string `` no inject the plan captured by this earlier --plan session into the prompt
--project string `` no git repo path (default: registered project containing cwd)
--prompt string `` no prompt text
--prompt-file string `` no read prompt from file
--risk string `` no risk tag (security|money|keys → strongest roster row, ui|copy → cheapest); used only when no --agent is given
--session string `` no session id (default: timestamp-hex-agent)
--task string `` no chair task id (updates agent_tasks)
--timeout int 0 no agent timeout seconds (0=agents.timeout_sec / ORCH_AGENT_TIMEOUT_SEC)
--unknown-ok string `` no reason: dispatch although the brief names an ORCH_ variable or a flag Orchemax does not have (Orchemax counts each override)
--wait bool true no block until the worker seals (--wait=false returns as soon as it starts)

orch doctor#

Report what is running, what is stale, and what is down — non-zero when something is broken

orch doctor [flags]
bandera tipo valor por defecto persistente ayuda
--fix bool false no also repair stale agent wiring, clear a core.bare flag left on, remove leaked test homes and stale worker scratch dirs, and reap what ended owners left (worktrees, merged `orch/*` branches, sandbox `orch` executables, old `orch` temp dirs); otherwise only reported
--quiet bool false no print only the checks that are not ok

orch evidence#

Print a session's evidence bundle (verdict, files, commands, tests, usage)

orch evidence <session> [flags]
bandera tipo valor por defecto persistente ayuda
--json bool false no print bundle.json instead of the markdown report
--stall-min int 0 no with --wait: minutes of no live child before reporting stalled (0 = agents.stall_after_min)
--timeout int 300 no with --wait: seconds to wait
--wait bool false no block until the session seals, or report it stalled

orch gateway#

Local LLM proxy: savings, providers, and agent connection helpers

orch gateway [flags]
The Orchemax gateway is a small local proxy (default http://127.0.0.1:8788).
Agents talk to Orchemax; Orchemax talks to your providers. That enables token savings
and failover across the URLs you configured.

Typical flow
  `orch gateway setup --live --name … --url … --key-env MY_API_KEY`
  `orch gateway`                 # start the proxy (same as: `orch gateway run`)
  `orch gateway connect claude`  # print settings to paste into your agent
  `orch gateway show`            # list providers (secrets hidden)
  `orch gateway usage`           # calls / tokens / savings (no prompt text)

Power users can edit ai.providers and ai.passthrough in `orch.yaml` instead of setup.

Docs: https://docs.orchemax.com/how-to/gateway-keys-and-connect/

orch gateway autostart#

Manage gateway background autostart/service (alias for: `orch gateway service`)

orch gateway autostart [flags]
Installs, starts, stops, or inspects the Orchemax Gateway running as a
background service (systemd user service on Linux, launchd on macOS,
schtasks watchdog on Windows).

Commands:
  `orch gateway service install [--start]`  # install native service
  `orch gateway service start`              # start service in background
  `orch gateway service stop`               # stop running service
  `orch gateway service restart`            # restart service
  `orch gateway service status`             # check health and PID
  `orch gateway service uninstall`          # remove service registration

orch gateway autostart install#

Register gateway background service (systemd / launchd / schtasks)

orch gateway autostart install [flags]
bandera tipo valor por defecto persistente ayuda
--dry-run bool false no print script + service spec without writing
--every int 5 no watchdog interval minutes (Windows)
--name string `` no service / task name (defaults per OS)
--start bool false no start service immediately after install

orch gateway autostart restart#

Restart the gateway background service

orch gateway autostart restart [flags]
bandera tipo valor por defecto persistente ayuda
--name string `` no service / task name

orch gateway autostart start#

Start the gateway background service

orch gateway autostart start [flags]
bandera tipo valor por defecto persistente ayuda
--name string `` no service / task name

orch gateway autostart status#

Show gateway service state (registered, running, listening, PID)

orch gateway autostart status [flags]
bandera tipo valor por defecto persistente ayuda
--json bool false no output JSON
--name string `` no service / task name

orch gateway autostart stop#

Stop the gateway background service

orch gateway autostart stop [flags]
bandera tipo valor por defecto persistente ayuda
--name string `` no service / task name

orch gateway autostart uninstall#

Remove gateway background service

orch gateway autostart uninstall [flags]
bandera tipo valor por defecto persistente ayuda
--dry-run bool false no print actions only
--name string `` no service / task name
--remove-script bool false no also delete launcher script

orch gateway connect#

Point any agent at this gateway (protocol: OpenAI-compat or Anthropic)

orch gateway connect [openai|anthropic|opencode] [flags]
Prints (or, for OpenCode only, writes) how to reach the local Orchemax gateway.

Protocols — not per-CLI special cases. Hundreds of agents share two wires:

  `orch gateway connect` / `connect openai`   # OpenAI-compat: Base URL + virtual key
  `orch gateway connect anthropic`            # Anthropic Messages (/v1/messages)
  `orch gateway connect opencode --allow-user-scope`  # optional: write OpenCode's own JSON
  `orch gateway connect commandcode --allow-user-scope`  # optional: write ~/.commandcode/providers.json

Aliases (still print the same openai block): copilot, cursor, openclaude, …
Alias for anthropic: claude.

Any OpenAI-compatible agent: set Base URL to http://127.0.0.1:8788/v1 and the
printed orch_gk_… key; models come from GET /v1/models (real upstream ids).

Command Code: the cloud Command Code plan key ≠ Orchemax gateway. BYOK lives in
`~/.commandcode/providers.json`; pick an `orch/…` model in `/model`.

Start the gateway first:  `orch gateway`
bandera tipo valor por defecto persistente ayuda
--allow-user-scope bool false no consent to write OpenCode/Command Code config outside this workshop

orch gateway enable#

Turn on gateway savings and auto-route for agent runs

orch gateway enable [flags]
Updates `orch.yaml` so agent runs can use the local gateway (token savings).
Creates a workspace gateway key file if needed and prints the next step.

  Stub mode costs $0. For real providers:
    `orch gateway setup --live …`
    `orch gateway` (or: `orch gateway service start`)
bandera tipo valor por defecto persistente ayuda
--live bool false no set ai.mode=live (needs provider via gateway setup)
--service bool false no alias for --start
--start bool false no install and start gateway service in background

orch gateway guide#

Print telegraphic guide for LLMs and admins to configure Orchemax and Gateway

orch gateway guide [flags]
Prints the sealed markdown guide covering workspace setup, agent registration,
gateway upstreams, keys vault, and user-level background services.
Agents and LLMs can consult this guide to configure Orchemax end-to-end.

orch gateway health#

Ask each worker's model to answer, and report which ones are alive

orch gateway health [flags]
One minimal completion per seat in `agents.workers`, through the
gateway — the same path a dispatched worker takes, so it proves key, route,
model id and upstream in one call. `gateway status` only reports the circuit
breaker: "nothing has failed yet" is not "it answered".

Exit 1 when any target is dead, so a script can gate a dispatch on it. A dead
target is a real failure for the router too, so it enters cooldown: the next
run reports those routes as cooling until the wait passes.
bandera tipo valor por defecto persistente ayuda
--json bool false no machine-readable output
--model stringArray [] no check this model instead of the worker roster (repeatable)
--timeout int 30 no seconds to wait for all the pings together

orch gateway key#

Manage virtual keys agents use to call the local gateway

orch gateway key [flags]

orch gateway key check#

Probe the running gateway with the key an agent actually sends

orch gateway key check [flags]
Reads the configured key source and asks the gateway that is really
listening whether it accepts it (GET /v1/models).

  `orch gateway key check`              # `.orch/gateway.agent.key` vs gateway.addr
  `orch gateway key check --opencode`   # the key and baseURL in your opencode.json

A key can be live in this workspace's `orch.db` and still be rejected: the
gateway on that port may have been started from another workspace.
bandera tipo valor por defecto persistente ayuda
--opencode bool false no check the key and baseURL written in the user's opencode.json

orch gateway key issue#

Create a gateway key (secret is printed once — save it)

orch gateway key issue [flags]
bandera tipo valor por defecto persistente ayuda
--budget-day int64 0 no per-key daily token budget (0 = unlimited)
--label string `` no optional label
--models string `` no comma-separated model allowlist (empty = any)

orch gateway key list#

List gateway keys (secrets are never shown again)

orch gateway key list [flags]

orch gateway key revoke#

Revoke a gateway key by id

orch gateway key revoke <id> [flags]

orch gateway key workers#

List the live per-worker keys (id, session, role, expiry — never the secret)

orch gateway key workers [flags]
Every dispatched worker gets its own gateway key (orch_wk_…), bound to its
session, expiring with its dispatch and revoked at sealing. The workspace key
(orch_gk_…) never enters a worker's environment.

This prints the keys that still authenticate right now. The secret itself was
printed once, into the worker's environment, and only its hash is stored.

orch gateway keys#

Manage upstream provider API keys (a rotation ring per provider)

orch gateway keys [flags]
Keys live in the same vault as everything else (machine-home keys.env), one
env var per provider — several keys, comma-separated, is a rotation ring the
gateway already knows how to fail over into on 429s (see: `orch gateway status`).

Never prints a full key: add/list/remove only ever show a hint ("sk-…abcd").

orch gateway keys add#

Add a key to a provider's rotation ring (probes connectivity first)

orch gateway keys add <provider> [key] [flags]

orch gateway keys list#

List configured keys per provider (hints and tier only)

orch gateway keys list [provider] [flags]

orch gateway keys remove#

Remove a key from a provider's ring by hint

orch gateway keys remove <provider> <hint> [flags]

orch gateway presets#

List known LLM upstream URLs (for setup / agents)

orch gateway presets [flags]
Prints the built-in catalog of OpenAI-compat / Anthropic endpoints Orchemax knows.
Agents should use this when the user asks to add another LLM provider.
Secrets never go in chat — user fills keys.env or Windows User env.

orch gateway prices#

Model rates fetched from a provider's catalogue, with their source

orch gateway prices [flags]
A price belongs to the provider that charges it. Orchemax asks the provider's
catalogue, caches each rate with the URL it came from and the time it was read,
and prices spend against that. It ships no rate table of its own: a model with no
fetched rate is refused by the USD ceiling rather than metered at $0 or at a
number somebody remembered.

orch gateway prices refresh#

Ask each configured provider for its rates and cache them

orch gateway prices refresh [flags]
Reads every enabled provider in `orch.yaml` that has a `prices_url` (or a `base_url` to derive `<base>/models` from) and caches the rates it answers with. --endpoint asks one URL instead. Orchemax names no provider: the catalogue is the owner's, like the key.
bandera tipo valor por defecto persistente ayuda
--endpoint string `` no ask this catalogue URL instead of the configured providers
--provider string `` no only this provider from `orch.yaml` (by name)

orch gateway prices status#

How many rates are cached and how old they are

orch gateway prices status [flags]

orch gateway restart#

Restart the gateway background service (same as: `orch gateway service restart`)

orch gateway restart [flags]

orch gateway run#

Start the local LLM proxy (same as: `orch gateway`)

orch gateway run [flags]

orch gateway service#

Manage the local LLM router background service (Windows, Linux, macOS)

orch gateway service [flags]
Installs, starts, stops, or inspects the Orchemax Gateway running as a
background service (systemd user service on Linux, launchd on macOS,
schtasks watchdog on Windows).

Commands:
  `orch gateway service install [--start]`  # install native service
  `orch gateway service start`              # start service in background
  `orch gateway service stop`               # stop running service
  `orch gateway service restart`            # restart service
  `orch gateway service status`             # check health and PID
  `orch gateway service uninstall`          # remove service registration

orch gateway service install#

Register gateway background service (systemd / launchd / schtasks)

orch gateway service install [flags]
bandera tipo valor por defecto persistente ayuda
--dry-run bool false no print script + service spec without writing
--every int 5 no watchdog interval minutes (Windows)
--name string `` no service / task name (defaults per OS)
--start bool false no start service immediately after install

orch gateway service restart#

Restart the gateway background service

orch gateway service restart [flags]
bandera tipo valor por defecto persistente ayuda
--name string `` no service / task name

orch gateway service start#

Start the gateway background service

orch gateway service start [flags]
bandera tipo valor por defecto persistente ayuda
--name string `` no service / task name

orch gateway service status#

Show gateway service state (registered, running, listening, PID)

orch gateway service status [flags]
bandera tipo valor por defecto persistente ayuda
--json bool false no output JSON
--name string `` no service / task name

orch gateway service stop#

Stop the gateway background service

orch gateway service stop [flags]
bandera tipo valor por defecto persistente ayuda
--name string `` no service / task name

orch gateway service uninstall#

Remove gateway background service

orch gateway service uninstall [flags]
bandera tipo valor por defecto persistente ayuda
--dry-run bool false no print actions only
--name string `` no service / task name
--remove-script bool false no also delete launcher script

orch gateway setup#

Add an LLM provider to the user-wide catalog (ai.yaml)

orch gateway setup [flags]
Writes one LLM provider into your user config (machine-home ai.yaml),
shared by every workspace. Secrets stay in OS User environment variables.

Example
  set OPENROUTER_API_KEY=…          # Windows: User environment variable
  `orch` gateway setup --live \
    --name openrouter \
    --url https://openrouter.ai/api/v1 \
    --model qwen/qwen3-32b \
    --key-env OPENROUTER_API_KEY \
    --tier cheap \
    --priority 10

Prefer --key-env over --api-key so secrets never sit in yaml.
Then start the proxy:  `orch gateway`

File:  %LOCALAPPDATA%\Orchemax\ai.yaml  (override with ORCH_HOME)

A workspace `orch.yaml` may still list ai.providers to override this user catalog.
Claude / Anthropic Messages: ai.passthrough.anthropic in the same user file
(or workspace override).
bandera tipo valor por defecto persistente ayuda
--api-key string `` no API key inline (prefer --key-env)
--key-env string `` no environment variable that holds the API key
--live bool false no also set ai.mode=live
--model string `` no default model id
--name string `` no provider name
--priority int 0 no lower number = tried first when a provider fails
--tier string `` no local|free|cheap|paid
--url string `` no provider API base URL (…/v1)

orch gateway show#

List providers from `orch.yaml` (API keys hidden)

orch gateway show [flags]

orch gateway start#

Start the gateway background service (same as: `orch gateway service start`)

orch gateway start [flags]

orch gateway status#

Per-provider live/cooldown state, key-ring position, rotation and cooldown counts

orch gateway status [flags]
Reads /v1/providers/stats from the running gateway (`orch gateway`). Counters
are in-memory and reset when the gateway restarts — this is "since start", not
a historical ledger (see: `orch gateway usage` for that). Never shows keys.

orch gateway stop#

Stop the gateway background service (same as: `orch gateway service stop`)

orch gateway stop [flags]

orch gateway usage#

Show gateway call stats and token savings (never stores prompts)

orch gateway usage [flags]
bandera tipo valor por defecto persistente ayuda
--limit int 20 no recent attempts to list
--push bool false no push content-free rollup to Orchemax (server link required)

orch guard#

Local guardrail checks

orch guard [flags]

orch guard add-all#

Deny blanket git add (-A/.) when cwd is a shared repo

orch guard add-all [git-command] [flags]
Field lesson: on shared layers, git add -A steals other sessions' WIP.
Pass the shell command (default reads first arg). Soft-skip when cwd is not under a registered shared path.

orch guard allow#

Deny an `orch:allow` override marker that silences nothing (unwaivable gate, or no reason)

orch guard allow [files...] [flags]
An inline `orch:allow <gate> — <reason>` waives one finding on the line it sits
on, or alone on the line directly above it. Matched as a substring, so any
comment syntax carries it. This check reports the markers that silence
nothing: a gate name no marker can waive, or a reason shorter than a cause.
Waivable gates: comment-prose, litter, minimal-code, secrets, signature.
Honoured overrides are recorded as verdict `override` and counted by `orch stats`.

orch guard artifacts#

Deny disposable build junk (.o, .pyc, .exe, …) beside source

orch guard artifacts [files...|dir] [flags]
Field lesson: compiler outputs next to shared source poison multi-agent floors.
Flags staged paths or walks a directory (skips tests/, out/, build/, .git).
Extensions: .o .obj .pyc .class .exe .map .dll/.so … plus IDE junk and numbered backups (file.ext.~1~).

orch guard banned-stack#

Deny an import or manifest dependency the owner declared banned

orch guard banned-stack [files...] [flags]
DEV_PRACTICES.md:65-66 — "declare your stack (anti LLM fashion)". Declare
each banned name once under workspace.banned_stacks in `orch.yaml` (name +
reason); an empty list means this gate says nothing.

Checks both surfaces: an import in source (same per-language resolution as
`orch guard cross-project`) and a manifest entry (package.json,
requirements.txt, pyproject.toml, Gemfile, *.csproj, Cargo.toml, go.mod).

With no args, checks staged files.

orch guard code-lang#

Check code identifiers/strings against workspace.code_lang

orch guard code-lang [root] [flags]
Uses workspace.code_lang from `orch.yaml` (owner decision for shipping code) —
any supported ISO 639-1 code (en es pt fr de it), also "xx-YY":
  <supported>  — identifiers + user-visible strings in that language; comments may be any language
  unset        — skip
  other        — no checker yet

English is never flagged inside identifiers (library APIs and language
keywords are English by convention) unless guard.code_lang_strict: true.
UI copy belongs in i18n dictionaries (paths like i18n/, es.json are exempt).
Field lesson: chatting with the LLM in your own language must not leak into
identifiers or raises.

--count walks the tree and prints hits per detected language without denying
(exit 0 always) — run it before switching guard.profile to strict on an
existing codebase.
bandera tipo valor por defecto persistente ayuda
--count bool false no count hits without denying (exit 0 always)

orch guard comment#

Deny if exported shared symbols lack a one-line purpose comment

orch guard comment <shared-file> [flags]

orch guard comment-prose#

Note long/narrative comment blocks (advisory, never denies)

orch guard comment-prose [path] [flags]
Flags, per code file: comment blocks of 6+ consecutive lines outside the
file header, package/module doc, license blocks and generated files; and any
comment block with a narrative marker (ISO date, "before the fix", "used to",
"we saw", "the founder", "historically"). Advisory in every guard.profile —
exit code is always 0.

--count prints one summary row instead of every hit.
bandera tipo valor por defecto persistente ayuda
--count bool false no print one summary row instead of every hit

orch guard conflict-markers#

Deny git merge-conflict markers left in a file

orch guard conflict-markers [files...] [flags]

orch guard control-bytes#

Deny invisible control bytes in source (except tab/LF/CR)

orch guard control-bytes [files...] [flags]

orch guard cross-project#

Deny a file inside one registered project importing another registered project

orch guard cross-project [files...] [flags]
DEV_PRACTICES.md:30 — "products compose shared code; they do not import
product-to-product." Needs 2+ entries in cfg.Projects; fewer means there is no
second owner to hit and this is a no-op. Resolves imports per the file's own
language (`internal/langspec`): Go, TypeScript/JavaScript (relative and
aliased), Python, C# and Ruby. An import that resolves to the shared root
instead of a registered project always passes.

With no args, checks staged files.

orch guard ddl#

Require seeder/repository companion for migration/CREATE TABLE changes

orch guard ddl [files...] [flags]
Defaults are Go globs plus workspace.primary_languages' own conventions; override with guard.ddl.{seeder,repository,migration}_globs in `orch.yaml`.

orch guard docs#

Deny an unreferenced new doc, or a header count that does not match the file

orch guard docs [root] [flags]
Genesis origin: gate-docs.mjs R1/R3, generalized (no TRACKER/DECISIONES naming).
R1  a .md under any docs/ folder that no sibling doc, README.md, AGENTS.md or
    CLAUDE.md references by name.
R3  "N items/lines/tables" claimed in the first 20 lines vs the real count in
    the same file.
Only files <= 200 KB. Advisory in profile lite, blocking in strict/shared.

--count walks the tree and prints hits without denying (exit 0 always).
bandera tipo valor por defecto persistente ayuda
--count bool false no count hits without denying (exit 0 always)

orch guard dup#

Deny if file duplicates a shared symbol; report copied function bodies (clones)

orch guard dup <file> [flags]

orch guard encoding#

Deny missing UTF-8 charset / mojibake in HTML, email, and source a compiler reads in a legacy code page

orch guard encoding [files...] [flags]
LLMs often forget charset when writing HTML or emails (especially non-English copy).
Checks: meta charset=utf-8 or Content-Type charset=utf-8; classic mojibake patterns (café).
Also: a source file in a language whose seed sets bom_required (Delphi today) holding
any byte above ASCII and no UTF-8 byte-order mark — the compiler reads the file in the
machine's legacy code page and every such character ships as two, in every script.
Stack-specific DB/string APIs belong in that layer's SHARED.md — not this gate.

orch guard env-drift#

Deny keys lost or emptied between an .env example and its instance

orch guard env-drift [root] [flags]
Genesis origin: check-env-key-loss.py + the emptied-secret case of
check-env-value-drift.py, scoped to what needs no server access: compares
.env.example/.env.template/.env.sample against .env/.env.local in the same
folder. Reports KEY NAMES ONLY — never a value — for a key missing in the
instance, or present but emptied where the example has a non-empty placeholder.

--count reports hits without denying (exit 0 always).
bandera tipo valor por defecto persistente ayuda
--count bool false no count hits without denying (exit 0 always)

orch guard explain#

Say what every rule would answer about one file, and whether a commit carrying it would be denied

orch guard explain <file> [repo] [flags]
bandera tipo valor por defecto persistente ayuda
--new bool false no judge it as a file this change creates (litter and docs rules differ)

orch guard gofmt#

Deny a Go file whose content is not what gofmt would write

orch guard gofmt [files...] [flags]

orch guard hooks#

``Install git pre-commit/pre-push hooks that run `orch guard```

orch guard hooks [flags]

orch guard hooks install#

Write .git/hooks/pre-commit + pre-push (`orch`-marked)

orch guard hooks install [repo] [flags]

orch guard hooks run#

Run pre-commit checks on staged files (used by git hooks)

orch guard hooks run [repo] [flags]
bandera tipo valor por defecto persistente ayuda
--commit-msg string `` no commit-msg stage: judge the staged test deletions against this message file (internal)
--lesson-ok string `` no reason: commit although a lesson enforce clause refuses the staged paths (counted; env ORCH_LESSON_OK)
--pre-push bool false no pre-push stage: judge the pushed ranges read from stdin against the publish scope (internal)
--session string `` no session id baked into a session's own git hook (internal)

orch guard hooks status#

Show whether `orch` git hooks are installed

orch guard hooks status [repo] [flags]

orch guard hooks uninstall#

Remove `orch`-marked pre-commit/pre-push hooks only

orch guard hooks uninstall [repo] [flags]

orch guard ide-hook#

Internal: Claude/Cursor wire entry (soft-skip outside workshop)

orch guard ide-hook [flags]

orch guard json-dup#

Deny a key declared twice inside one JSON object

orch guard json-dup [files...] [flags]
Every decoder keeps the last of a repeated key and drops the rest in silence, so
the file says one thing and the program reads another. Decoding into a map cannot
answer this: the duplicate is gone by the time the map exists.

Found on this repo's own dictionaries: one key was a string at one line and an
object at another, the object won, and the template asking for the string had been
falling back to its default. The test comparing the two locales could not see it,
because it compared maps that had already collapsed.

Language-agnostic, and a duplicate key has one possible verdict, so it denies.

orch guard lang#

Check workshop docs against workspace.docs_lang

orch guard lang [root] [flags]
Uses workspace.locale from `orch.yaml` (owner decision for docs/prose) —
any supported ISO 639-1 code (en es pt fr de it), also "xx-YY":
  <supported>  — deny prose in any other supported language (own language allowed)
  unset        — skip
  other        — no marker set yet

This is separate from workspace.code_lang (see `orch guard code-lang`).
Chat/docs may be in one language while code stays in another.

--count walks the tree and prints hits per detected language without denying
(exit 0 always) — run it before switching guard.profile to strict on an
existing codebase.
bandera tipo valor por defecto persistente ayuda
--count bool false no count hits without denying (exit 0 always)

orch guard litter#

Deny new agent-scratch files/dot-directories outside .sandbox/<seat>/ or docs

orch guard litter [files...] [flags]
New paths only — editing an existing file is never litter. Denies:
  - any new dot-directory an agent creates (.notes/, .scratch/, .claude/state/, …);
    only .sandbox/, `.orch/`, .git/, .cursor/rules/, .github/, .claude/settings.local.json
    (and the legacy .claude/settings.json), .gitignore, .gitattributes, .editorconfig,
    .mcp.json are wired by `orch` itself.
  - a new .md/.txt/.log/.rtf/.out/.csv/.html (outside web/assets) or a
    notes/report/summary/plan/todo/scratch/analysis/findings/research-named file.
  - a new test/fixture (_test.go, *.test.*, *.spec.*, or under tests/ test/
    __tests__/ spec/ fixtures/ testdata/) with no source file it belongs to
    in the same change set — exploratory tests belong in .sandbox/<seat>/tests/.
  - any test/fixture under a configured shared layer — shared trees stay library
    code only; agent tests go under the project's .sandbox/<seat>/.

Falls back to git's changed files with no args. --count reports hits without
denying (exit 0 always).
bandera tipo valor por defecto persistente ayuda
--count bool false no count hits without denying (exit 0 always)

orch guard lock#

Deny if shared/** path has no valid lock for --holder

orch guard lock <path> [flags]
bandera tipo valor por defecto persistente ayuda
--holder string `` no session/agent holding the lock

orch guard machine-path#

Deny one machine's absolute home path (Users/<name>, /home/<name>) in a versioned file

orch guard machine-path [files...] [flags]

orch guard minimal-code#

Report a single-implementation interface, an unread field or a single-use wrapper (advisory)

orch guard minimal-code [files...] [flags]
Principle 2. Minimum code for what was asked — check: nothing speculative, no single-use abstraction.

Narrowed to three shapes a check can see, each named in its own message:
  single-implementation interface  an interface this change declares that one
                                  type in the same change implements
  field nothing reads             a struct field or config key no .go file in
                                  the repo mentions again
  single-use wrapper              a function whose body is one call forwarding
                                  its own arguments, with one caller

Advisory, exit 0 always. Go only: readers are counted by identifier occurrence
across the repo's .go files, so a name used in a comment or a string counts as
read — the check under-reports rather than accuse.

orch guard principles#

Show which elemental principles `orch` enforces and which are guidance

orch guard principles [flags]

orch guard profile#

``Show or set guard.profile in `orch.yaml```

orch guard profile [lite|shared|strict|bring|none] [flags]
bandera tipo valor por defecto persistente ayuda
--yes bool false no confirm switching to strict despite existing lang/code-lang hits

orch guard race-test#

Report concurrency added to a package whose tests only run sequentially (advisory)

orch guard race-test [files...] [flags]
A change that adds a goroutine launch, a channel or a sync/atomic reach to a
package, where no test in that package runs two things at once — no goroutine of
its own, no WaitGroup, no t.Parallel.

The defect it exists for is recent and real: an ask launched its escalation with
nothing waiting on it, and the write that escalation performed landed after the
call had returned. No sequential test could see that, and none did for a round.

Advisory, exit 0 always. Plenty of concurrent code is exercised from another
package and a check reading one package cannot see that. Go only.

orch guard reproduce#

Deny a change whose own new tests pass against the pre-change source

orch guard reproduce [repo] [flags]
Principle 5. Reproduce before you fix — check: a failing test or repro exists before the patch.

Every Test* the change adds or modifies runs with the change's non-test .go
files reverted to the git base, through `go test -overlay`: a test that
passes there did not reproduce the bug, so it does not prove the fix.

Nothing is written into the checkout, and the scope is the change's own tests
(`mutate.DefaultReproMax` at most, each run bounded). Skips with a named
reason when the checkout has no base commit, when the change adds no test, and
when a test does not compile against the base.
bandera tipo valor por defecto persistente ayuda
--base string `` no git rev holding the pre-change source (default: merge-base with the base branch)

orch guard rules#

List and validate the workshop's own gates (`.orch/gates/user/manifest.json`)

orch guard rules [flags]
bandera tipo valor por defecto persistente ayuda
--accept string `` no pin these gate ids (comma-separated, empty/bare means all) at their current strength
--project string `` si project root whose manifest (.orch/gates/manifest.json) joins the workshop's (default: the project containing the cwd)

orch guard rules run#

Dry-run the user gates over an explicit file list

orch guard rules run --files a,b [flags]
bandera tipo valor por defecto persistente ayuda
--files string `` no comma-separated paths, relative to the workshop root
--on string seal no cut point(s) to simulate: seal,pre-commit,pre-push,ide-pre,ide-post

orch guard schema-bump#

Deny a column added to a table definition with no schema version bump

orch guard schema-bump [repo] [flags]
An additive schema change only reaches a database that already exists when
the version it compares itself against moves. Columns were added here with the
constant left alone: every existing database stayed without them and a command
died with `no such column`, while a fresh database passed every test.

orch guard scope-growth#

Report a change set that outgrew its ledger item with no ask raised (advisory)

orch guard scope-growth [repo] [flags]
Principle 8. Stop and ask when blocked or scope grows — check: blocker named, no guessing past it.

Measured instead of asserted. The clarify gate already covers delegation;
this is the other half:
the open `.workflow/LEDGER*.md` item naming the most files this change
touches declares N files, the change touches 2N or more, and the session has no
row in agent_asks.

Advisory, exit 0 always. Silent when one ask exists, when no open item names any
changed file, and when the item declares folders only (a folder is not a count).

orch guard secrets#

Deny a credential (provider key, PEM block, high-entropy assignment) in source

orch guard secrets [files...] [flags]
Provider key shapes (AWS, GitHub, OpenAI/Anthropic, Google, Slack, Orchemax's own),
a PEM private-key header, or an assignment to a credential-looking name
(token/secret/password/api_key/private_key) whose value is long and
high-entropy. Never prints the matched text — only the file, the line and
which pattern fired. Skips .env.example/.env.template outright.

orch guard shared-brand#

Deny registered project id / path references inside shared layers

orch guard shared-brand [files...] [flags]

orch guard shared-root#

Deny loose source files at shared-layer roots (must live in a subfolder)

orch guard shared-root [dir...] [flags]
Agents often drop new modules at a shared-layer root instead of the right package folder.
With no args, scans every shared root from `orch.yaml`. With args, each path is a
shared-layer root to check (non-recursive: only direct children).

Allowed at the root: docs/meta (.md, .gitignore, .gitattributes, …).
Denied: source extensions for any language (.go .ts .js .py .rs .cs …).

orch guard shared-shadow#

Deny a project file whose path mirrors one already under a shared root

orch guard shared-shadow [files...] [flags]
Genesis origin: check-shared-not-shadowed.mjs. A product with its own copy of a
file that a shared layer already provides silently wins over the shared
version wherever local beats shared — the shared code is never exercised, and
the gap surfaces months later in a different product. Uses the shared roots
already registered in `orch.yaml`.

--count reports hits without denying (exit 0 always).
bandera tipo valor por defecto persistente ayuda
--count bool false no count hits without denying (exit 0 always)

orch guard shell-check#

Internal: pi-extension sibling of ide-hook; reads a shell command on stdin

orch guard shell-check [flags]
bandera tipo valor por defecto persistente ayuda
--cwd string `` no cwd the command was issued from
--tool string `` no name of the calling tool (Bash, PowerShell, …)

orch guard signature#

Deny non-constant-time comparisons on a signature/HMAC/token

orch guard signature [files...] [flags]
Denies ==, !=, ===, strcmp(, .equals( on an operand whose identifier looks like
hmac/signature/sig/token/digest/mac — those exit at the first differing byte, so
response time leaks how much of the expected value the caller already guessed.
Suggests the constant-time helper for the file's language (Go
subtle.ConstantTimeCompare, Node crypto.timingSafeEqual, Python
hmac.compare_digest, PHP hash_equals, and equivalents elsewhere).
Already-safe lines (ConstantTime*, EqualHashString, timingSafeEqual, …) are skipped.

--count reports hits without denying (exit 0 always).
bandera tipo valor por defecto persistente ayuda
--count bool false no count hits without denying (exit 0 always)

orch guard template-drift#

Deny a key-set mismatch between a *.template.json/*.example.json and its instance

orch guard template-drift [template-files...] [flags]
Genesis origin: check-config-template-drift.py. A deployment does not overwrite
the live config.json on purpose (it holds machine-only state), so a key the
template just added never arrives on its own — the feature it gates goes
disabled without an error. Compares key PATHS only; values are never read.
config.template.json / config.example.json diff against config.json next to it.

--count reports hits without denying (exit 0 always).
bandera tipo valor por defecto persistente ayuda
--count bool false no count hits without denying (exit 0 always)

orch guard test-dup#

Report a test whose body repeats another test's, literals included (advisory)

orch guard test-dup [files...] [flags]
A Test function whose body, as gofmt renders it with comments dropped, is
another test's body. Two tests asserting the same thing with the same literals
are one test under two names, and the second name is a claim the suite does not
keep.

The criterion is the whole body, not "covers the same symbol": measured over
2040 test functions, shared symbols gave 774 notes and identifier-blind shapes
gave 33 — nearly all legitimate parameterized siblings, a Python case beside a
Ruby one. Identical literals gave one, and it was a test whose name promised
something its copied body never asserted.

Advisory, exit 0 always: a deliberate regression pin is a real reason to keep a
twin, and no check can tell that from an accident. Go only.

orch guard test-residue#

Deny paths a test run creates under a source root, gitignored included

orch guard test-residue <snapshot-file> [repo] [flags]
Two calls around the suite:
  `orch guard test-residue .sandbox/tree.snap --save`
  `go test ./...`
  `orch guard test-residue .sandbox/tree.snap`

The snapshot is `git status --porcelain --ignored`, the only listing that
shows gitignored litter: a suite that seeds .orch/ in its own package is
invisible to plain `git status`, which is how it survived. Any path the
second call finds under a source root that the first did not have is
denied. Source roots default to internal, cmd, src, app, lib and pkg; a
registered project's own roles replace that default when they resolve.
The snapshot also carries a sha256 per live agent config (.claude/,
.openclaude/ and .cursor/ hook files) at the root and in every registered
project: those are gitignored, so a run that EDITED one is invisible to a
path diff — and a hook command a test left behind blocks the next session.
bandera tipo valor por defecto persistente ayuda
--save bool false no Write the baseline snapshot instead of comparing against it

orch guard tracker#

Validate TRACKER state table (T1–T5: status · SPEC · evidence · no prose · row shape)

orch guard tracker [TRACKER.md|dir] [flags]
Agnostic checks inspired by workshop field experience:
  T1 — only SPEC|TODO|WIP|DONE|VERIFIED|BLOCKED|DROPPED
  T2 — SPEC rows must point at an existing .md
  T3 — VERIFIED rows need real evidence (not empty/ok/done)
  T4 — table present ⇒ no narrative dump (>12 consecutive prose lines)

Prose-only trackers without a status table soft-skip (exit 0).
When PATH is a directory, walks **/TRACKER.md (bounded).

orch guard unproven-gate#

Deny new gate source added with no test touched in the same change set

orch guard unproven-gate [files...] [flags]
The mirror of the litter rule: a new test with no source change is litter, and
new gate source with no test is a gate nobody has watched fail.

The shape is measured. Over the 49 commits that added gate source to
internal/guardrails, exactly one touched no test, and that one shipped a filter
hiding six gates from a whole directory with two surviving mutants. Two stricter
shapes were tried against the same history and rejected: "a test file of the same
name" flags 8 of 66 sources, and "a test naming one of its symbols" flags 5 of 9,
because an unexported symbol cannot be named from an external test package.

A MODIFIED test counts. Only ADDED source counts: editing a gate that already has
tests is ordinary work.

orch guard unwire#

Remove what Orchemax wrote to disk: IDE hook entries, .mcp.json Orchemax servers, git hooks — workshop and every registered project

orch guard unwire [flags]
bandera tipo valor por defecto persistente ayuda
--dry-run bool false no list what would be removed and change nothing
--git bool true no also uninstall `orch` git hooks under project/shared (--git=false to keep them)
--project bool false no project scope only: leave every user-scope file (~/.claude, ~/.openclaude, OpenCode plugin, agy) alone

orch guard upsert#

Deny ON CONFLICT/ON DUPLICATE KEY/MERGE upserts with no matching UNIQUE/PK

orch guard upsert [files...] [flags]
Genesis origin: check-upsert-has-unique.py. PostgreSQL refuses an ON CONFLICT
without a matching constraint (loud); MSSQL/MySQL silently duplicate the row
instead (quiet, permanent). Reads UNIQUE/PRIMARY KEY declarations from CREATE
TABLE / CREATE UNIQUE INDEX / ALTER TABLE ADD CONSTRAINT across the given
files, then checks every ON CONFLICT(cols)/ON DUPLICATE KEY UPDATE/MERGE ON(...)
in them. A table never seen declared here is skipped (doubtful, not a fail).

--count reports hits without denying (exit 0 always).
bandera tipo valor por defecto persistente ayuda
--count bool false no count hits without denying (exit 0 always)

orch guard weakened#

Report a test that survived a change and now verifies less (advisory)

orch guard weakened [files...] [flags]
A Test function still present in the change whose body gained a Skip, or whose
assertion count fell, read against the file's copy at HEAD.

Principle 7 — never make a check pass by weakening it — had no gate, and prose
does not stop a model that has already convinced itself. A suite stays green
precisely because the check stopped looking, which is why this is the shape a
green run hides.

Narrow on purpose: a deleted test is visible in the diff and is somebody's
decision, a new test is not a weakening, and a rewrite with the same count is
refactoring. Assertions inside same-file helpers count, so moving one into a
helper is not a loss.

Advisory, exit 0 always. Go only.

orch guard wire#

Install marked git/Claude/OpenClaude/Cursor/Copilot/agy adapters for this workshop

orch guard wire [flags]
bandera tipo valor por defecto persistente ayuda
--agy bool false no register `orch`'s MCP server in agy's GLOBAL config (agy has no per-workspace MCP config)
--allow-user-scope bool false no non-interactive consent for --scope user; --yes alone never grants it
--claude bool false no wire Claude Code settings.local.json (project scope by default; soft-skip outside workshop)
--copilot bool false no no-op: headless copilot never loads repo hooks (item 136) — Copilot stays sealing-only
--cursor bool false no wire workshop .cursor/hooks.json
--git bool false no install git pre-commit/pre-push on project+shared repos
--openclaude bool false no wire OpenClaude .openclaude/settings.local.json (Notification toast; project scope by default)
--opencode bool false no wire the user-scope OpenCode plugin and sync the User ORCH_GATEWAY_KEY (needs --scope user)
--profile bool false no ``use guard.profile from `orch.yaml```
--project bool false no alias of --scope project
--scope string project no project (default: only files inside the workshop) | user (~/.claude + ~/.openclaude settings, agy's global MCP config, the OpenCode plugin)

orch home#

Show where account files live vs this workshop's `.orch` folder

orch home [flags]

orch index#

Index the workshop (every registered project and shared path) into the symbol registry

orch index [flags]
bandera tipo valor por defecto persistente ayuda
--watch bool false si fsnotify reindex with 300ms debounce

orch index shared#

Alias for `orch index` — it never covered only paths.shared

orch index shared [flags]

orch init#

Start a workshop: bind this folder if needed, then lay out projects, shared, AI doctrine, git

orch init [flags]
Run in the folder you want as your workshop. If it is not bound yet, init binds it first
(bind + layout in one step), then offers the layout. With --dry-run it only reports it would bind.

Asks docs locale, shared folders, project/apps, optional git identities, and
whether to install `orch guard` hooks. Seeds English thin CLAUDE.md +
DEV_PRACTICES.md + GATES.md + doctrine/README.md + per-project docs/TRACKER,
installs sealed `orch-*` skills, git-inits each project/shared (never the
workshop root), and wires includeIf identities when profiles are given.

Layout hint: `doctrine/` = cross-project law (you fill); workshop-root `docs/` =
optional workshop notes; each project's `docs/` = that project's TRACKER/PRODUCT.

Existing workshop: decline the recommended layout and enter your real
shared/product paths. To replace doctrine after a wipe, delete old CLAUDE.md /
AGENTS.md / gates docs (or pass --force).

  `orch init`
  `orch init --recommend`          # suggest shared/<lang>/ + projects/<app>/
  `orch init --dry-run`
  `orch init --force`              # overwrite non-empty seeded docs
  `orch init --yes`                # accept defaults for every prompt — no stdin required
  `orch init --refresh-seeds`      # update only DEV_PRACTICES.md's principles section
                                  # + every project's AGENTS.md pointer; nothing else touched

--yes skips the interactive wizard entirely and
applies defaults (docs locale/code_lang/comment_lang en, address informal, no shared/projects, no git
identities, guard.profile unset → lite). Combine with --recommend to seed
the recommended shared/<lang>/ + projects/<app>/ layout instead of an empty
one, still with no prompts.

Docs: https://docs.orchemax.com/how-to/organise-a-workshop/

bandera tipo valor por defecto persistente ayuda
--dry-run bool false no print plan without writing
--force bool false no overwrite non-empty seeded doctrine files
--recommend bool false no default to recommended shared/\<lang>/ + projects/\<app>/ layout
--refresh-seeds bool false no update only the `orch`-owned principles section/block (DEV_PRACTICES.md + every project's AGENTS.md pointer) — skips the wizard, leaves everything else untouched
--yes bool false no Accept defaults for every prompt — no stdin required

orch install#

Copy this Orchemax binary to its per-OS folder and add it to your user PATH

orch install [flags]
Windows: `%LOCALAPPDATA%\Programs\orch\orch.exe`, folder added to the user PATH (no admin).
macOS/Linux: ~/.local/bin/orch (mode 0755), one `export PATH` line added to your shell profile when missing.
Running it again changes nothing and says "already installed". `orch uninstall --scope user` removes it.

orch land#

Land audited branches as one merge train: merge, regenerate, verify, fast-forward main and the checkout

orch land <session|branch>... [--push <remote:branch>] [--install] [flags]
Lands audited session branches as one merge train. Each branch needs an accept verdict on its
current head (`orch verdict`). The train starts from main, merges every branch and then the
checkout branch, runs land.regenerate and commits what they changed, runs land.verify, then
fast-forwards main and the checkout and checks that main, the checkout and the train tip are
the same commit. Refuses a checkout that is bare or has uncommitted changes.

--push remote:branch pushes the landed tip. --install runs land.build, copies land.install into
the install directory keeping one rollback copy, prunes older copies, and restarts the gateway
only when no worker runs.

With --push and land.ci_workflow set, Orchemax first reads the latest remote CI run of the push
branch (needs gh on PATH): a failed run refuses the landing unless --ci-override "<reason>";
a running one is waited for up to land.ci_wait_sec (default 600).

Config: land.regenerate and land.verify (command lists), land.build (command), land.install
(path of the built binary, relative to the checkout), land.ci_workflow, land.ci_wait_sec.
bandera tipo valor por defecto persistente ayuda
--ci-override string `` no reason to land although the remote CI of the push branch is red (recorded and counted)
--cycle-override string `` no reason to land although a learning-cycle row is not yet memorized (recorded and counted)
--force-load string `` no reason to land although another heavy load runs (a worker, a test run, another land; recorded and counted)
--install bool false no build land.build and install land.install after landing
--known-red-ok string `` no reason to land although the last land recorded a red test on main that this train does not touch (recorded and counted)
--lesson-ok string `` no reason to land although a lesson enforce clause refuses these targets (recorded and counted; env ORCH_LESSON_OK)
--push string `` no push the landed tip to \<remote:branch>
--queued bool false no land the audited fast-lane branches that are due (waited land.fast_wait_min, or no worker runs)
--repo string . no the checkout to land into

orch learn#

The lesson playbook: add, list, reject, restore (delta-updated, never rewritten)

orch learn [flags]

orch learn add#

Add a lesson (an active rule_key bumps helpful instead)

orch learn add --rule-key <key> --title <title> --evidence <commit/audit/session id> [body...] [flags]
bandera tipo valor por defecto persistente ayuda
--enforce string `` no the check that would have caught it: \<action>:\<verdict>:\<pattern> (action dispatch|brief|audit|land|write|commit; verdict refuse|warn; pattern a path glob for write/commit, else a regex)
--evidence string `` no commit/audit/session id backing the lesson (required)
--paths string `` no comma-separated paths the lesson is about
--rule-key string `` no normalized identity of the rule (required)
--scope string local no repo|org|product|user|local
--title string `` no short title (required)

orch learn curate#

Propose merging near-duplicate lessons (dry run; --apply snapshots then supersedes)

orch learn curate [flags]
bandera tipo valor por defecto persistente ayuda
--apply bool false no snapshot the store, then supersede the duplicates

orch learn list#

Print the playbook: id, scope, helpful/harmful, status, title, evidence

orch learn list [--all] [flags]
bandera tipo valor por defecto persistente ayuda
--all bool false no include retired lessons

orch learn mechanism#

Mark a lesson as enforced by a built mechanism, with the gate and the test that prove it

orch learn mechanism <id|rule_key> --gate <file:line> --test <TestName> [--item <id>] [--commit <ref>] [flags]
bandera tipo valor por defecto persistente ayuda
--commit string `` no commit ref that landed it; a recurrence dated before it is not a failure of the mechanism
--gate string `` no file:line of the gate that enforces the lesson (required)
--item string `` no ledger item id that built it
--test string `` no name of the test that proves the gate; must exist in a tracked file (required)

orch learn propose#

Propose lessons from repeated guard denies (proposed, never active)

orch learn propose [flags]

orch learn recur#

Record that a failure matched an existing lesson (never creates one)

orch learn recur <id|rule_key> --evidence <session id / what happened> [flags]
bandera tipo valor por defecto persistente ayuda
--at string `` no when it happened, RFC3339 (default now); before the mechanism's commit it is not a failure of it
--caught bool false no a gate caught it before harm (the mechanism held; reopens nothing)
--enforce string `` no store the check that would have caught it: \<action>:\<verdict>:\<pattern> (see learn add --enforce)
--evidence string `` no session id / what happened (required)
--item string `` no ledger item id that will build the check
--no-check-reason string `` no why no check can exist for this lesson (stored with the recurrence, counted)

orch learn reject#

Retire a lesson with reason "rejected by user"

orch learn reject <id> [flags]

orch learn restore#

Re-activate a retired lesson

orch learn restore <id> [flags]

orch load#

Mark a heavy load (a test run) that runs outside dispatch

orch load [flags]

orch load hold#

``Count a heavy load until its lease expires (--for), or until a process exits (--pid), or `orch load release```

orch load hold <reason> [flags]
bandera tipo valor por defecto persistente ayuda
--for duration 0s no hold for this long whatever process ran the command (default 2h without --pid)
--pid int 0 no process that holds the load; a dead pid's hold is ignored

orch load release#

Drop a heavy-load hold: a lease (--lease) or a process's; with no flag, the default leases and the parent's hold

orch load release [flags]
bandera tipo valor por defecto persistente ayuda
--lease string `` no key of the lease to drop
--pid int 0 no process that held the load

orch locale#

Show or set the workshop language knobs

orch locale [flags]
The language knobs in `orch.yaml` under workspace:
  locale        the language Orchemax and the agents address you in
  docs_lang     what files on disk are written in (default: locale, else en)
  code_lang     what code identifiers and config/rule strings are written in
  comment_lang  what code comments are written in (default: code_lang)
  address       informal | formal | vos

  `orch locale show`                   # effective value and where it came from
  `orch locale set <knob> <value>`     # write one key (`orch.yaml` is backed up first)

orch locale set#

``Write one workspace language key into `orch.yaml```

orch locale set <knob> <value> [flags]

orch locale show#

Print the effective language knobs and their source

orch locale show [flags]

orch map#

What a file or symbol is for, and who calls it

orch map [path|symbol] [flags]
Prints the purpose of a file (its header comment or a docs/PURPOSES.tsv row), its package and its callers; for a symbol, its `orch:export` purpose, file and callers. With no argument it lists every file with its purpose. Reads the index built by `orch index`.

orch mcp#

Start the `orch` tools server for agents (stdio)

orch mcp [flags]

orch memory#

Save and recall durable notes for agents (local)

orch memory [flags]

orch memory condense#

Shrink oversized workshop memory files through the gateway (never automatic)

orch memory condense [flags]
Condenses .workflow/BOARD.md and `.orch/LAST_SESSION.md` when they pass the size threshold.
`## Clarified` and `## Ownership` sections and every open checkbox item are preserved byte-for-byte —
only narration and finished notes are summarized. The original is kept beside the file.
Requires a running gateway (`orch gateway`) with a working upstream.
bandera tipo valor por defecto persistente ayuda
--dry-run bool false no report what would change without writing
--file stringSlice [] no file(s) to condense (default: BOARD.md and LAST_SESSION.md)
--model string `` no model to summarize with (default: the gateway's own choice)
--threshold-bytes int 0 no only condense files larger than this (default 16384)

orch memory conflicts#

List active memories with same type+title but different body

orch memory conflicts [flags]

orch memory export#

Export estate as OKF-lite markdown (v0.2-compatible)

orch memory export [dir] [flags]
bandera tipo valor por defecto persistente ayuda
--all bool false no include expired/superseded
--limit int 5000 no max rows

orch memory forget#

Expire a memory (soft)

orch memory forget <id> [flags]

orch memory import#

Import OKF-lite markdown into the estate

orch memory import [dir] [flags]

orch memory list#

List recent active memories

orch memory list [flags]
bandera tipo valor por defecto persistente ayuda
--limit int 20 no max rows
--type string `` no filter type

orch memory recall#

Search saved memories

orch memory recall [query...] [flags]
bandera tipo valor por defecto persistente ayuda
--limit int 8 no max hits
--type string `` no filter type

orch memory remember#

Store a typed memory

orch memory remember [text...] [flags]
bandera tipo valor por defecto persistente ayuda
--no-supersede bool false no do not supersede same type+title
--source string `` no source agent/session
--tags string `` no comma tags
--title string `` no short title (default: truncated body)
--type string fact no memory type
--user-request string `` no verbatim user words asking to remember (fires the gate's fifth rule)

orch memory supersede#

Mark old memory superseded by new id, recording why

orch memory supersede <old-id> <new-id> <reason...> [flags]

orch memory sweep#

Expire memories past retention_days

orch memory sweep [flags]

orch msg#

Send messages between agent sessions

orch msg [flags]

orch msg ack#

Ack message as recipient (session and/or agent must match)

orch msg ack <id> [flags]
bandera tipo valor por defecto persistente ayuda
--agent string `` no recipient agent
--session string `` no recipient session

orch msg age#

Backdate message created_at (dogfood / tests)

orch msg age <id> [flags]
bandera tipo valor por defecto persistente ayuda
--hours int 2 no hours in the past

orch msg gc#

Purge old bus history (acked/unread/log/notices) per bus.* retention

orch msg gc [flags]

orch msg handoff#

Write brief under data/handoffs and send kind=handoff

orch msg handoff [flags]
bandera tipo valor por defecto persistente ayuda
--body string `` no alias for summary
--from-agent string `` no sender agent
--from-session string `` no sender session
--summary string `` no handoff summary
--to-agent string `` no target agent
--to-session string `` no optional target session

orch msg inbox#

List messages for session and/or agent

orch msg inbox [flags]
bandera tipo valor por defecto persistente ayuda
--after int64 0 no only rows with id greater than this
--agent string `` no agent id
--limit int 50 no max rows
--session string `` no session id
--unread bool true no only unread
--wait int 0 no block up to N seconds for a message when the inbox is empty (ceiling 600)

orch msg log#

Show bus activity log (`.orch/bus.log`)

orch msg log [flags]
bandera tipo valor por defecto persistente ayuda
--follow, -f bool false no follow new lines (Ctrl+C to stop)
--tail, -n int 40 no last N lines (0 = all)

orch msg peers#

List other sessions (optional: family view with --session)

orch msg peers [flags]
bandera tipo valor por defecto persistente ayuda
--chairs bool false no live Chairs of this workshop and every trusted workshop (address, agent, since, next line)
--format string table no table|json (roster mode)
--session string `` no from-session → project kinship roster (parent/child/sibling)

orch msg read#

Mark message read (legacy; prefer ack)

orch msg read <id> [flags]

orch msg roster#

Show parent/child/sibling sessions for a session

orch msg roster [flags]
bandera tipo valor por defecto persistente ayuda
--format string table no table|json
--session string `` no from-session id

orch msg send#

Send a note, handoff, or alert to another session or agent

orch msg send [flags]
Send a note, handoff, or alert to another session or agent.

--to-project takes a project id of this workshop, or a project in another trusted Orchemax workshop as
`<workshop>/<project>`: the id exactly as `orch project list` prints it there, `<workshop>/<project-id>`,
or `<workshop>/<short-name>`. Cross-workshop mail is marked with its origin workshop; the receiver
replies by passing that origin back to --to-project.
bandera tipo valor por defecto persistente ayuda
--body string `` no short message body
--from-agent string `` no sender agent id
--from-session string `` no sender session id
--kind string note no note|handoff|alert
--name string `` no target display name / session / agent when using --to-role
--parent-id int64 0 no optional parent message id (thread)
--payload string `` no optional file path (brief)
--to-agent string `` no target agent id
--to-project string `` no registered project id (live chair, or mailbox if that project is asleep)
--to-role string `` no parent|child|sibling (requires --from-session)
--to-session string `` no target session id
--wake bool false no if nobody answers to that seat name, re-dispatch it with this body as its prompt (plan/quota checked first)

Ejemplo:

  orch msg send --to-project beta/invoicing --body "invoice API changed"

orch msg stale#

List unread alerts older than --older-min

orch msg stale [flags]
bandera tipo valor por defecto persistente ayuda
--older-min int 15 no alert age in minutes

orch msg wait#

Block until a message newer than --after arrives for the session, print it, exit 0 (prints timeout otherwise)

orch msg wait [flags]
bandera tipo valor por defecto persistente ayuda
--after int64 0 no only messages with id greater than this (default: the newest id now)
--agent string `` no agent id
--session string `` no session id
--timeout int 0 no seconds to block (default 300, ceiling 600)

orch nightly#

Land every accepted session in one train and leave a morning report

orch nightly [flags]

orch nightly run#

Land every accepted, unlanded session of the project (`orch land <ids> --install`) and write nightly/<date>.md

orch nightly run [--dry-run] [flags]
Collects the sessions of the project with an accept verdict that are not landed, in acceptance order,
and runs the same land as `orch land <ids> --install`. The report (landed, refused with the land's
reason, duration, installed build) is written under the data dir; the Chair start brief carries its
summary until `orch nightly status` is read. --dry-run prints the land command and writes nothing.
bandera tipo valor por defecto persistente ayuda
--dry-run bool false no print the land command and write nothing
--repo string . no the checkout to land into

orch nightly status#

Print the latest nightly report and mark it read

orch nightly status [flags]

orch notify#

Outbound webhooks and Telegram notifications on sealing/promote events

orch notify [flags]
notify.webhooks and notify.telegram in `orch.yaml` deliver sealed/failed/promoted/
needs_approval/needs_answer events — status and summary only, never diffs or
file contents. needs_answer also carries the worker's question, so the human
who reads it can answer with /answer <id> <text> or `orch ask answer`.

orch notify events#

Print the versioned outbound event catalog (n8n/Zapier contract)

orch notify events [flags]

orch notify telegram#

Telegram long-polling bot (notifications + /status /approve /reject /answer)

orch notify telegram [flags]

orch notify telegram pair#

Link this workspace to your Telegram chat (prints a link, waits for /start)

orch notify telegram pair [flags]
Prints the bot's t.me link, waits for you to send /start, then adds that chat
to notify.telegram.chat_allowlist in `orch.yaml` and sends one test event.
Requires notify.telegram.bot_token_env to already name an env var holding the
BotFather token.

orch notify telegram run#

Run the Telegram long-poll worker standalone (foreground)

orch notify telegram run [flags]

orch notify test#

Send a synthetic event to every configured webhook, Telegram chat and the desktop

orch notify test [flags]
bandera tipo valor por defecto persistente ayuda
--desktop bool false no force the desktop toast channel on for this test
--event string sealed no sealed|failed|promoted|needs_approval|needs_answer|notification

orch pack#

Install/update/remove team gates, rules and skills from a pack

orch pack [flags]

orch pack install#

Install a pack's gates/rules/skills into this workspace

orch pack install <path|git-url> [flags]
<path> is a local directory holding MANIFEST.yaml at its root.
A git URL is cloned fresh with "git clone --depth 1" (add --ref for a branch/tag).

Orchemax ships no pack of its own — every language gets the same starting point;
bring your own pack, local or from a git remote.
bandera tipo valor por defecto persistente ayuda
--ref string `` no git branch/tag to clone (git sources only)

orch pack list#

List installed packs

orch pack list [flags]

orch pack remove#

Uninstall a pack, keeping any file the workshop edited

orch pack remove <name> [flags]

orch pack update#

Refresh an installed pack's unmodified files from its recorded source

orch pack update <name> [flags]

orch policy#

``Effective guard/review/budget/notify policy from `orch.yaml```

orch policy [flags]

orch policy diff#

Diff the effective policy sections against a git ref (git diff --no-index)

orch policy diff <git-ref> [flags]

orch policy show#

Print the policy sections `orch.yaml` actually has

orch policy show [flags]

orch presence#

System tray presence (opens `orch ui`; not a TUI)

orch presence [flags]
Orchemax presence is a small system-tray helper for the local workshop.

It is not a TUI and never shows Team commerce (billing, members, overlook).
Left-click opens `orch ui` (the workshop). The menu shows plan / link / gateway /
workers / HITL at a glance, can restart the gateway service, and quits only the
tray helper — the gateway keeps running.

  `orch presence run`              # tray in background (terminal returns)
  `orch presence run --foreground` # keep this terminal attached (Ctrl+C quits)
  `orch presence install`          # start at user login
  `orch presence uninstall`
  `orch presence status`

Use `orch ui` directly when you want the full board without the tray.

orch presence install#

Register presence to start at user login

orch presence install [flags]

orch presence run#

Run the system tray helper (background by default)

orch presence run [flags]
bandera tipo valor por defecto persistente ayuda
--foreground bool false no keep presence in this terminal (Ctrl+C quits the tray)

orch presence status#

Show presence login autostart registration

orch presence status [flags]

orch presence uninstall#

Remove presence login autostart

orch presence uninstall [flags]

orch procs#

List the long-lived `orch` processes and the build each one is running

orch procs [flags]
bandera tipo valor por defecto persistente ayuda
--sweep bool false no first delete the records of processes that have exited

orch project#

Register projects in `orch.yaml` (does not create folders)

orch project [flags]

orch project add#

Register an existing folder as a project

orch project add <path> [flags]
Register an existing folder. Relative paths resolve from cwd first, then workspace root.
Examples (any layout you already use):
  `orch project add .`
  `orch project add apps/billing`
  `orch project add products/billing`
  `orch project add services/api`
bandera tipo valor por defecto persistente ayuda
--docs string `` no docs folder for this project (default when --yes: docs)
--kind string `` no optional kind label (e.g. go, web)
--name string `` no optional short name (default: folder name)
--yes bool false no non-interactive: accept the default docs folder (docs)

orch project list#

List registered projects (shows a project's running Chair, if any)

orch project list [flags]

orch project remove#

Unregister a project (does not delete folders)

orch project remove <path-or-name> [flags]

orch project set#

Set a project field (chair_goal: the Chair goal file, relative to the project root)

orch project set <id> chair_goal <path> [flags]

orch recover#

Rebuild a project from its newest local backup bundle (never into a non-empty folder)

orch recover <project> [flags]
bandera tipo valor por defecto persistente ayuda
--from string `` no bundle file to recover from (default: the newest for the project)
--to string `` no folder to recover into (default: the project path, only when missing or empty)

orch repro#

Run one test N times on HEAD and on the base and print both fail rates

orch repro <TestName> [flags]
Runs the test N times on HEAD and N times on the base (a temporary worktree under `.sandbox/`,
removed afterwards) and prints `head: F/N failed · base: F/N failed · host cpu X%`.
Cite that line before blaming a branch for a failure. A Go package (--pkg) is built once per side and run
with `-test.run '^<TestName>$'`; any other language runs its test adapter's command ({test} is the name).
A language with no adapter fails naming the file to add. Orchemax never changes your working tree.
bandera tipo valor por defecto persistente ayuda
--base string main no base ref to compare with
--count int 10 no runs per side
--dir string . no worktree or repo to measure (HEAD side)
--pkg string `` no Go package path to test (relative to the module, e.g. ./internal/cli)

orch seat#

Live seat status, wait, report, and read (PTY host observability)

orch seat [flags]
Observe interactive seats without scraping vendor UIs as policy truth.
Authoritative states come from `orch seat report` (or process exit marks).
Tail-buffer hints may set maybe_blocked for UX only — never for wait --until blocked.

orch seat attach#

Reattach this terminal to a detached seat-hold

orch seat attach [session-id] [flags]
Dials the hold ipc_addr from seat state and runs the seat host UI until
disconnect. Parent console modes are restored on exit.

orch seat detach#

Mark seat UI detached (hold keeps the agent PTY alive)

orch seat detach [session-id] [flags]
Detach the UI from a hosted seat-hold: the hold keeps the agent PTY alive.
Requires ipc_addr in `.orch/seats/<id>.json`. Not a mux sidebar — Orchemax has no session TUI.
Native-child seats (default OpenCode) cannot detach — exit kills the agent.

orch seat read#

Read seat tail file (`.orch/seats/<id>.tail.txt`)

orch seat read [session-id] [flags]
Reads the live seat transcript snapshot.
With --deep, asks seat_host to page child alt-screen history (OpenCode-style)
or dump a larger VT scrollback (Claude-family), then prints the refreshed tail.
bandera tipo valor por defecto persistente ayuda
--deep bool false no ask live seat_host to page/collect more history
--deep-timeout int 15 no seconds to wait for seat_host deep collect
--lines int 0 no last N lines (0 = all; with --deep default 120)

orch seat report#

Write authoritative seat state (source=report)

orch seat report <session-id> [flags]
bandera tipo valor por defecto persistente ayuda
--pid int 0 no agent process id
--preset string `` no agent preset id
--resume-ref string `` no vendor session id for later resume
--state string `` no working|ready|blocked|exit
--summary string `` no short human summary

orch seat status#

Show seat lifecycle state (and optional maybe_blocked hint)

orch seat status [session-id] [flags]
bandera tipo valor por defecto persistente ayuda
--json bool false no print JSON
--session string `` no seat session id

orch seat wait#

Poll until authoritative seat state matches --until

orch seat wait [session-id] [flags]
bandera tipo valor por defecto persistente ayuda
--json bool false no print JSON on success
--timeout int 30 no seconds to wait
--until stringArray [] no authoritative state to accept (repeatable)

orch server#

Link this workshop to your Orchemax account (optional)

orch server [flags]

orch server entitlements#

Pull policy hints from server (fallback: local policy when offline)

orch server entitlements [flags]

orch server keys#

Provider keys held by your Orchemax account (Team and above)

orch server keys [flags]
On Team and Enterprise the provider key lives on the server and every
machine leases a short-lived copy, so rotating here rotates everywhere.

  `orch server keys add <provider> <key>…`   # park or rotate a ring
  `orch server keys list`                    # hints only, never the secret

Below Team the keys stay on your own machine: use `orch gateway keys`.

orch server keys add#

Park or rotate one provider's key ring on the server

orch server keys add <provider> <key>... [flags]

orch server keys list#

What the server holds, by hint

orch server keys list [flags]

orch server language#

Show or set the language your account notifications are written in

orch server language [en|es-US] [flags]
A team seat never signs into the web platform, so this is where its holder
changes the language Orchemax writes to them in. Authorization is the device
link: the server only ever sets the language of the person this device belongs
to. With no argument it shows what is stored and what the server accepts.

Store token and verify ping

orch server link [flags]
bandera tipo valor por defecto persistente ayuda
--token string `` no bearer token
--url string `` no server base URL (default server.url)

orch server login#

Sign in to Orchemax and link this device

orch server login [flags]
bandera tipo valor por defecto persistente ayuda
--device string `` no device id (default cli-\<hostname>)
--password string `` no account password
--url string `` no Orchemax base URL
--username string `` no account username

orch server notices#

Fetch member notices from server (channels are server-side)

orch server notices [flags]

orch server push-event#

Push a work event to the server

orch server push-event [flags]
bandera tipo valor por defecto persistente ayuda
--agent string `` no agent id
--session string `` no session id
--type string task_done no event type

orch server status#

Ping server.url healthz

orch server status [flags]

Remove local server token/link state

orch server unlink [flags]

orch server watch#

Hold the live server channel open and drain mail as it arrives

orch server watch [flags]
Subscribes to the server's doorbell (SSE) and drains through the same sync pull `orch server entitlements` uses. The doorbell only says an outbox id exists, so a workshop several events behind still catches up in one pull. When the stream does not hold, the fallback poll keeps draining.
bandera tipo valor por defecto persistente ayuda
--poll duration 0s no fallback drain interval when the stream does not hold (0 = 60s)

orch session#

Session commands

orch session [flags]

orch session close#

Close a running seat (the id in the open-agents message)

orch session close <session-id> [flags]
Ends the seat so another agent can open in that workshop.

Copy the id from the message:

  already N open agents (plan allows N); Chair session <id> (…) — `orch session close <id>`

A live process for that seat is stopped first.
bandera tipo valor por defecto persistente ayuda
--close-override string `` no reason to close a Chair session although Chair edits are pending or the live handoff is older than the last land (recorded and counted)
--cycle-override string `` no reason to end a Chair session although a learning-cycle row is not yet memorized (recorded and counted)

orch session last#

Print `.orch/LAST_SESSION.md` (resume card for your last seat)

orch session last [flags]

orch session leadership#

Content-free CTO 1-pager from local gateway usage + session pulses

orch session leadership [flags]
bandera tipo valor por defecto persistente ayuda
--out string `` no write markdown to file instead of stdout

orch session list#

List session snapshots

orch session list [flags]
bandera tipo valor por defecto persistente ayuda
--since string `` no only sessions updated at/after this RFC3339 timestamp
--status string `` no filter by status (blocked|completed|done|failed|no-work|no_work|ok|queued|running|unverified; done/ok = completed)

orch session overlook#

Content-free CTO overlook as one self-contained offline HTML file (guard, session shape, tool catalogue, savings, governance)

orch session overlook [flags]
bandera tipo valor por defecto persistente ayuda
--out string `` no write html to this path instead of \<data>/overlook/overlook.html

orch session rename#

Set display name (like claude /rename)

orch session rename <session-id> <name> [flags]

orch session seal#

Write the session card from a snapshot (default: this Chair seat, else the newest Chair)

orch session seal [session-id] [flags]
bandera tipo valor por defecto persistente ayuda
--cycle-override string `` no reason to end a Chair session although a learning-cycle row is not yet memorized (recorded and counted)
--via string `` no how a Chair seal was started (exit hook, terminate handler); set by Orchemax itself

orch session show#

Show one session: plan, status, exit, verification, log, supervisor, usage

orch session show <session-id> [flags]

orch session transcript#

Print Claude/OpenClaude chat text (scroll outside the broken TUI mouse)

orch session transcript [vendor-uuid] [flags]
Reads the newest local JSONL under ~/.openclaude/projects/<slug>/ (or ~/.claude/)
and prints user/assistant turns as markdown. Agent TUIs often trap the mouse
wheel in the prompt box; this is the reliable way to re-read a long reply.

Omit the uuid to use the newest transcript for this workshop. Saves a copy to
`.orch/transcripts/latest.md`. Pass --open to open that file in the default editor.
bandera tipo valor por defecto persistente ayuda
--open bool false no open `.orch/transcripts/latest.md` in the default editor

orch shared#

Register shared folders in `orch.yaml` by language (does not create folders)

orch shared [flags]

orch shared add#

Register an existing folder under shared.<lang>

orch shared add <path> [flags]
Path only. Language defaults to workspace.primary_languages (or the only shared.* bucket).
Pass --lang only to override (e.g. assets for css/js).
Example: `orch shared add C:\Dev\my-workshop\features`
bandera tipo valor por defecto persistente ayuda
--lang string `` no optional language bucket (default: workspace.primary_languages or sole shared.*)

orch shared list#

List shared folders by language

orch shared list [flags]

orch shared remove#

Unregister a shared folder (does not delete folders)

orch shared remove <path> [flags]
bandera tipo valor por defecto persistente ayuda
--lang string `` no optional — limit remove to one language bucket

orch stats#

Gate verdicts recorded so far: denies/warns/oks by guard, surface, and the top rules

orch stats [flags]
bandera tipo valor por defecto persistente ayuda
--json bool false no print JSON instead of a table
--since string `` no only events at or after this date (YYYY-MM-DD or RFC3339)
--week bool false no only the last 7 days, with what was blocked by category and by seat

orch status#

Show the workshop for this folder, including host load and the scheduler queue depth (same view as `orch workshop show`)

orch status [flags]
bandera tipo valor por defecto persistente ayuda
--perf bool false no Also print goroutines/heap/DB/reaper footprint (this process, plus `orch` daemon if one is running) — ledger R5-E2E item 81

orch task#

Create and run tasks for worker agents

orch task [flags]

orch task add#

Create a task (optionally pre-assign agent)

orch task add [flags]
bandera tipo valor por defecto persistente ayuda
--agent string `` no optional assignee
--body string `` no task body / prompt
--body-file string `` no read body from file
--context string `` no standing background for the worker (not an instruction)
--context-file string `` no read context from file
--criterion stringSlice [] no acceptance criterion (repeatable); comes back met/not in the verification report
--ledger string `` no ledger item ref
--title string `` no short title

orch task assign#

Assign task to an agent

orch task assign <id> <agent> [flags]

orch task claim#

Atomically claim one ledger checklist item (shared_locks key ledger:<path>#<N>)

orch task claim <ledger-file> <item-number> [flags]
bandera tipo valor por defecto persistente ayuda
--holder string `` no session id claiming the item
--ttl-min int 15 no TTL minutes

orch task done#

Mark task done/failed

orch task done <id> [done|failed] [flags]

orch task list#

List tasks

orch task list [flags]
bandera tipo valor por defecto persistente ayuda
--limit int 50 no max rows
--status string `` no filter: open|assigned|queued|running|done|failed

orch task release#

Release a ledger item claim (holder must match, or --holder *)

orch task release <ledger-file> <item-number> [flags]
bandera tipo valor por defecto persistente ayuda
--holder string `` no session id

orch task run#

Dispatch assigned task (chair → agent session)

orch task run <id> [flags]
bandera tipo valor por defecto persistente ayuda
--actor string `` no policy actor (default: ORCH_ACTOR or local)
--force bool false no bypass clarify_before_spawn ledger gate
--inplace bool false no run in project root (shared disk)
--keep-worktree bool false no keep worktree after run
--name string `` no session display name (default: agent id)
--project string `` no git repo path (default: registered project containing cwd)
--session string `` no session id (default: timestamp-hex-agent, one per run even for a retried task)
--timeout int 0 no agent timeout seconds (0=agents.timeout_sec)
--wait bool true no block until the worker seals (--wait=false returns as soon as it starts)

orch task show#

Show a task with its verification report (guardrails, tests, review)

orch task show <id> [flags]

orch test#

Run the project's tests, skipping the ones already proven on identical inputs

orch test [test args] [flags]
Orchemax runs the project's tests for you: Go packages through `go test`, serving the tests it already proved
on identical inputs; any other language through its test adapter (projects[].tests or the shipped default), whole.
Proofs come from the seal's store and this seat's own; only this seat's store is written here.
ORCH_TEST_REUSE=0 forces a real run. A language with no adapter fails naming the file to add.

orch try#

Build and install audited branches to test them live, without the land's test suite

orch try <session|branch>... [--rollback] [flags]
Merges the audited branches (the same candidates `orch land` takes, each with an accept verdict on
its current head) onto main in a train directory, runs land.build and installs land.install keeping
one rollback copy. It runs no land.verify and no test suite, and moves no branch, the checkout or
any remote. `orch status` labels the installed build `(orch try, unverified)` until a later
`orch land --install` replaces it; `orch land` verifies and integrates.

--rollback restores the previous install and clears the label.
bandera tipo valor por defecto persistente ayuda
--repo string . no the checkout whose main the candidates merge onto
--rollback bool false no restore the previous install and clear the unverified label

orch ui#

Open the local web console (background by default)

orch ui [flags]
Starts a small local web UI (default http://127.0.0.1:8790) for usage,
settings, and status. By default the UI runs in the background, the browser
opens, and your terminal returns. Use --foreground to keep the server in this
terminal (Ctrl+C stops it). Everything it edits also lives in `orch.yaml`.
bandera tipo valor por defecto persistente ayuda
--foreground bool false no keep UI in this terminal (Ctrl+C stops it)
--no-browser bool false no do not open the browser (background mode)

orch uninstall#

Remove everything `orch` left — workshop state, and (with --scope user) machine-wide wiring

orch uninstall [flags]
--dry-run by default: prints the full plan, deletes nothing.

Workspace scope (default):
  1. deletes `orch-regenerated` + `orch-runtime` + agent-litter, same as
     `orch workspace clean --apply --group orch-regenerated --group orch-runtime --group agent-litter`
  2. with a second confirmation, also relocates `orch.yaml` and the rest of
     `.orch/` — including `.orch/gates/user/`, `.orch/packs/` and `orch.db` — into
     <workspace>/`orch-uninstall-<timestamp>`/. Nothing is ever hard-deleted
     unless --purge is given; `<workspace>/gates/` is never touched; "yours-keep" paths are moved there too, never
     destroyed, so they can be recovered after the fact.

User scope (--scope user): removes only what `orch` itself wrote outside this
workspace — ~/.claude/settings.json hooks + `mcpServers.orch`,
`~/.claude/orch-mcp.json`, `~/.cursor/mcp.json`'s `mcpServers.orch`, the home
skill trios, agy's global MCP entry, the OpenCode plugin + its opencode.json
provider block, and User env ORCH_GATEWAY_KEY (also clears leftover
OPENCODE_DISABLE_MOUSE from older installs). Never touches a file it did not
write into. Needs --allow-user-scope for a non-interactive run; --yes alone
never grants it (mirrors `orch guard wire --scope user`).

  `orch uninstall --dry-run`
  `orch uninstall --yes`
  `orch uninstall --yes --scope user --allow-user-scope`
  `orch uninstall --yes --purge`
bandera tipo valor por defecto persistente ayuda
--allow-user-scope bool false no non-interactive consent for --scope user; --yes alone never grants it
--dry-run bool false no print the plan only (default without --yes/--allow-user-scope input already requires confirmation)
--purge bool false no hard-delete instead of relocating to a recovery folder
--scope string project no project (this workspace, default) | user (machine-wide files `orch` wrote)
--yes bool false no skip the workspace-scope confirmations (never grants --scope user)

orch usage#

Tokens by session, worker and model, plus bytes crush kept off the wire

orch usage [flags]
bandera tipo valor por defecto persistente ayuda
--defer stringSlice [] no with --injected: weigh a `context.defer_tools` choice before making it — these tool names leave tools/list and reach the agent through tools_search instead
--defer-suggest bool false no with --injected: derive a `context.defer_tools` list instead of weighing one — every offered tool the workspace's injected text does not name, with what deferring them would save
--export string `` no write the gen_ai.*-keyed usage export instead, one JSON line per session and per tool row (only value: jsonl)
--format string table no table|json
--governance bool false no print the conflict rate and the clone advisory count per session instead (item 38: cross-session file collisions, clone advisories)
--injected bool false no print the per-surface injected-bytes budget instead (ledger R11 item 8: tools/list, sealed skills, AGENTS.md/CLAUDE.md, per-hook injections)
--leaks bool false no print leak telemetry per session instead (item 26: rereads, repeats, oversized results, silent streaks)
--limit int 0 no also include the N most recent attempts (json)
--savings bool false no print measured crush/context_externalize/context_retrieve/memory_recall bytes plus ratio-estimated tokens against the injection cost instead (ledger R21 item 13)
--session string `` no restrict --savings to one session (default: $ORCH_SESSION)
--workers bool false no print the worker rollup instead (item 65: wall time, status, files, guardrails, tool calls, tokens, cost by session/worker/task/CLI/project/day)

orch usage export#

Export usage as OTLP/HTTP JSON traces to a collector, or as gen_ai.*-keyed JSONL

orch usage export [flags]
Sends one CLIENT span per gateway model call, carrying the OpenTelemetry GenAI
attributes (gen_ai.system, gen_ai.request.model, gen_ai.operation.name,
gen_ai.usage.input_tokens/output_tokens) plus `orch.session` and `orch.agent`.

Nothing leaves the machine until you name a collector: no prompt, no completion,
no file content — the attempt ledger behind this never stored any. Counters,
model names and session ids only.

  `orch usage export`                                   # JSONL on stdout
  `orch usage export --otlp http://127.0.0.1:4318`      # /v1/traces is appended
  `orch usage export --otlp $URL --since 24h --header "authorization=Bearer $T"`
bandera tipo valor por defecto persistente ayuda
--batch int 0 no spans per POST (0 = default)
--header stringArray [] no extra HTTP header for the collector, key=value (repeatable)
--otlp string `` no OTLP/HTTP collector base URL or full /v1/traces endpoint (opt-in; empty = JSONL on stdout)
--since string `` no only attempts at or after this point: a duration (24h, 7d) or an RFC3339 timestamp

orch verdict#

Record an accept, reject or fix verdict (needed before promote); --file stores the whole report

orch verdict <session> accept|reject|fix --evidence "<line>" | --file <report> [flags]
bandera tipo valor por defecto persistente ayuda
--evidence string `` no one line saying what you checked (required without --file)
--file string `` no report file stored beside the seal evidence (first line is the evidence by default)
--sibling-ok string `` no reason to accept although an accepted sibling conflicts or fails together with this session (recorded and counted)

orch verify#

Checks that judge the change, not the whole repo

orch verify [flags]

orch verify mutate#

Alter changed lines and report the mutations the tests fail to catch

orch verify mutate [path] [flags]
Mutates only inside the changed Go lines: working tree and staged against HEAD,
plus what the branch committed since the merge base. Operators are comparison
flips, && <-> ||, true <-> false, and removing the body of an err guard.

--base <rev> replaces the merge-base diff with a straight diff from <rev> to
HEAD, so a whole closed round (many commits, no open branch to detect a merge
base from) can be audited in one run instead of reporting nothing.

Each mutant reaches the compiler through go test -overlay from a temp dir, so
nothing is written into the checkout, and only that package's own tests run. A
surviving mutation means the line changed and every test still passed. A mutant
that does not compile is reported as not done, never as a survivor.
bandera tipo valor por defecto persistente ayuda
--base string `` no audit a whole round: diff from this commit to HEAD instead of the auto-detected merge base
--max int 40 no stop after this many mutants
--strict bool false no exit non-zero when a mutation survives
--timeout duration 2m0s no per-package test timeout; a run that hits it counts as caught
--whole string `` no audit a package: mutate every line of every non-test .go file under this directory, ignoring the diff

orch verify precheck#

Run the seal's cheap checks (call lines, dead code, generated files) on this branch

orch verify precheck [path] [flags]
Runs the checks the seal runs, against merge-base..HEAD plus the working
tree, prints the same notes, and exits non-zero when the seal would deny.
Run it before the final report; the seal notes a precheck that never ran.
bandera tipo valor por defecto persistente ayuda
--base string `` no diff from this commit instead of the merge base with main
--brief string `` no file holding the brief, so Done-means test names and dead-code severity match the seal

orch verify receipt#

Checks the dispatch/seal/promote hash chain end to end and names the first broken line

orch verify receipt [path] [flags]
Recomputes each line's hash and checks it links to the line before it.
An altered line fails at that line's own content hash; a removed line fails at
the line right after it, whose prev no longer matches its new predecessor.

Defaults to the workspace receipt (.orch/receipt.ndjson) resolved from --config;
pass a path to check any other receipt file.

orch version#

Print version

orch version [flags]

orch webhook#

Inbound webhook receiver: turn a signed POST into a task

orch webhook [flags]
`orch webhook serve` runs a small local HTTP server (loopback by default)
with three routes — /task, /github, /slack — each verified by HMAC and, unless
already approved, gated behind webhook.require_approval (see "`orch notify`" for
the outbound side). Configure webhook.secret_env, webhook.allow and
webhook.templates in `orch.yaml`.

orch webhook serve#

Run the inbound webhook HTTP server

orch webhook serve [flags]
bandera tipo valor por defecto persistente ayuda
--addr string 127.0.0.1:8790 no listen address (loopback only unless --allow-remote)
--allow-remote bool false no allow binding a non-loopback address (dangerous)

orch webhook test#

``POST a signed sample payload to a running `orch webhook serve```

orch webhook test [flags]
bandera tipo valor por defecto persistente ayuda
--addr string http://127.0.0.1:8790 no ``base URL of a running `orch webhook serve```
--agent string cursor no agent for the /task sample
--approve bool false no mark the /task sample pre-approved
--dispatch bool false no ask the /task sample to dispatch
--project string `` no project path for the sample (default: registered project)
--prompt string reply with the word ok no prompt text for the sample
--route string task no task|github|slack
--template string `` no template name (task/slack samples)

orch worker#

Tools for the worker seats Orchemax dispatches

orch worker [flags]

orch worker brief#

Print the sections an Orchemax worker receives for a brief, each with its size (read-only)

orch worker brief <prompt-file> [flags]
bandera tipo valor por defecto persistente ayuda
--project string `` no project path (default: registered project containing cwd, else the workshop)

orch workshop#

Show the workshop for this folder, or bind another path

orch workshop [path] [flags]
Workshop = folder with `orch.yaml` + `.orch/` (where you run `orch` day to day).

  `orch workshop`           # print resolved workshop for the current folder
  `orch workshop list`      # trusted workshops on this machine
  `orch workshop forget <path>`  # drop from trust list (files stay)
  `orch workshop <path>`    # create/init that folder as a workshop (then cd there)
  `orch workshop show`
  `orch workshop use <path>`
  `orch status`              # alias for: `orch workshop show`

`orch.exe` on PATH is unrelated — it does not store a workspace pointer.
Outside a workshop: loose mode. Relative paths are from the current directory.

orch workshop check#

List what this workshop has on disk and `orch.yaml` does not declare

orch workshop check [flags]
An undeclared folder is not an error — it is why a gate goes quiet.
A project nobody registered is outside quota, locks and cross-project
alerts; a shared root nobody declared is a place search-before-create
never looks. Each line names the command that fixes it.
bandera tipo valor por defecto persistente ayuda
--json bool false no machine-readable findings

orch workshop clean#

Inventory (and, with --apply, remove) everything `orch` or its agents left here

orch workshop clean [flags]
Dry-run by default — this command never deletes without --apply.

Walks the workspace and every registered project/shared root, grouping what
it finds:
  `orch-regenerated`  everything init/setup/project add/wire recreate
  `orch-runtime`      worktrees, dispatch logs, supervisor state, sandbox scratch
  agent-litter      dot-directories/scratch files an agent left outside .sandbox/
  yours-keep        `orch.db`, `.orch/gates/user/`, `.orch/packs/` — never a valid --group

Only `orch`-touchable or litter-shaped paths are listed; ordinary project
files are never enumerated.

  `orch workspace clean`
  `orch workspace clean --json`
  `orch workspace clean --apply --group agent-litter --group orch-runtime --yes`
  `orch workspace clean --apply --group orch-regenerated --purge --yes`

--apply moves matched paths to <workspace>/`.orch/trash/<timestamp>/` unless
--purge hard-deletes them instead. To wipe a workspace entirely (including
`orch.yaml` itself), see: `orch uninstall`.
bandera tipo valor por defecto persistente ayuda
--apply bool false no delete the selected --group(s) (default is dry-run/inventory only)
--dry-run bool false no force a dry run even with --apply (already the default without --apply)
--group stringArray [] no group to delete with --apply (repeatable): `orch-regenerated`|`orch-runtime`|agent-litter
--json bool false no print the dry-run inventory as JSON
--purge bool false no ``hard-delete instead of moving to `.orch/trash/<ts>/```
--yes bool false no skip the confirmation prompt

orch workshop forget#

Remove a folder from this machine's trusted workshop list

orch workshop forget [path] [flags]

orch workshop list#

List trusted workshops registered on this machine

orch workshop list [flags]

orch workshop show#

Print the workshop this install is bound to (same view as `orch status`)

orch workshop show [flags]

orch workshop use#

Point this install at a workshop folder

orch workshop use [path] [flags]

orch worktree#

Git worktree lifecycle for `orch` sessions (status, prune, promote)

orch worktree [flags]
Repos are first-class: each dispatch session gets branch `orch/<session>` under paths.worktrees.
Promote merges into the base branch (fail-closed on conflicts). Never auto-pushes to remote.

orch worktree base#

Show resolved base branch for promote

orch worktree base [flags]
bandera tipo valor por defecto persistente ayuda
--base string `` no override base branch
--project string `` no git repo path

orch worktree promote#

Merge `orch/<session>` into base (fail-closed on conflicts; no auto-push)

orch worktree promote <session> [flags]
bandera tipo valor por defecto persistente ayuda
--base string `` no base branch
--event bool true no emit content-free `orch.git.promote` when linked
--guard-ddl bool true no require seeder/repository companions for DDL in the session branch
--project string `` no git repo path
--strategy string merge no merge|rebase

orch worktree prune#

Remove orphan worktree dirs and orphan `orch/*` branches

orch worktree prune [flags]
bandera tipo valor por defecto persistente ayuda
--base string `` no base branch hint
--project string `` no git repo path

orch worktree remove#

Remove a session worktree and its `orch/<session>` branch

orch worktree remove <session> [flags]
bandera tipo valor por defecto persistente ayuda
--base string `` no unused
--project string `` no git repo path

orch worktree status#

List `orch` session worktrees (dirty / orphan flags)

orch worktree status [flags]
bandera tipo valor por defecto persistente ayuda
--base string `` no base branch (default: ORCH_GIT_BASE or main/master)
--json bool false no JSON output
--project string `` no git repo path (default: registered project / workspace)

Modo avanzado / protocolo de agentes#

52 comandos. No aparecen en el listado por defecto de orch --help: existen para flujos manejados por agentes y usuarios avanzados, y pueden cambiar sin ciclo de deprecacion. Colapsado por defecto; expandir para leer.

Mostrar comandos ocultos

orch context#

Configure how large prompts are compressed to save tokens

orch context [flags]

orch context get#

Print a context blob the gateway externalized (for seats without the Orchemax MCP)

orch context get <id|marker> [flags]

orch context setup#

``Suggest context flags (Y/n) and save `orch.yaml```

orch context setup [flags]
bandera tipo valor por defecto persistente ayuda
--yes bool false no accept all suggestions without prompts

orch context show#

Show effective context.guidance flags

orch context show [flags]

orch daemon#

Background local service for the workspace database (advanced)

orch daemon [flags]

orch discover#

Suggest projects and shared folders from your workspace (you confirm)

orch discover [flags]

orch discover apply#

Confirm proposal into `orch.yaml` (registers paths only)

orch discover apply [flags]
bandera tipo valor por defecto persistente ayuda
--all bool false no apply every project + shared suggestion
--project stringSlice [] no project id(s) to register from proposal

orch discover run#

``Scan workspace and write `.orch/discover.proposal.json```

orch discover run [flags]

orch discover show#

Print saved discover proposal

orch discover show [flags]

orch gateway login#

experimental

Sign the gateway in to a provider account (only where the provider allows it)

orch gateway login <openai|copilot> [flags]
Experimental — not a product feature. Signs the gateway in with your own plan
so upstream calls are billed to it instead of an API key.

  `orch gateway login openai`    # ChatGPT/Codex, OAuth PKCE on a loopback callback
  `orch gateway login copilot`   # GitHub Copilot, device flow (RFC 8628)

Tokens are stored in machine-home with 0600 and never printed. Anthropic is not
offered: claude.ai plan credentials are never collected or intermediated.

orch gateway logout#

experimental

Forget a stored provider account login

orch gateway logout <openai|copilot> [flags]
Experimental — not a product feature. Forgets a stored provider account login.

orch harness#

Detect AI tools and workshop doctrine surfaces

orch harness [flags]

orch harness doctrine#

Which rules in your doctrine files a gate enforces, and which are still prose

orch harness doctrine [file...] [flags]
Reads each doctrine document statement by statement. A statement that gives an order is a rule, and a rule counts as enforced only when it names a gate this build exposes, that checks a practice, and whose own documented subject shares a word with the rule. With no arguments it reads the doctrine layers `orch harness scan` found.
bandera tipo valor por defecto persistente ayuda
--gated bool false no also list the rules that ARE enforced
--json bool false no emit the audit as JSON

orch harness scan#

Agents on PATH + Claude/Cursor/OpenCode settings + doctrine files

orch harness scan [flags]

orch hook#

Internal: harness context hooks (Claude Code, OpenCode)

orch hook [flags]
Wired by `orch guard wire`, each gated by its own `orch.yaml` consent:
  post-tool        Claude Code PostToolUse and OpenCode tool.execute.after
                   — context.hooks.post_tool (legacy scalar context.hooks: true)
  cursor-post-tool cursor-agent postToolUse — context.hooks.post_tool
  pre-compact      Claude Code PreCompact — context.hooks.pre_compact
  notification     Claude Code Notification (needs permission / waiting for input)
                   — raises the desktop toast and Telegram, gated by notify.desktop
Cursor cannot replace a Shell/Read result (its updated_mcp_tool_output is MCP-only,
and a Read payload carries content_length, not the file), so its hook answers with
additional_context naming the cheaper `orch` tool. GitHub Copilot CLI never loads repo-level
hooks in headless -p mode (item 136, verified live) — `orch guard wire --copilot` refuses and
writes nothing; Copilot is sealing-only. agy has none. Codex CLI cannot replace tool output at all.

orch hook cursor-post-tool#

Internal: nudge cursor-agent toward `orch` read tools after a bulky result (postToolUse)

orch hook cursor-post-tool [flags]

orch hook notification#

Internal: raise the desktop/Telegram channels when a CLI stops for the human (Notification)

orch hook notification [flags]

orch hook post-tool#

Internal: shrink a tool result read from stdin (PostToolUse)

orch hook post-tool [flags]

orch hook pre-compact#

Internal: condense workshop memory before the harness compacts (PreCompact)

orch hook pre-compact [flags]
Runs the same condenser as `orch memory condense` on .workflow/BOARD.md and
`.orch/LAST_SESSION.md`. Native compaction summarizes the whole transcript and
keeps no original; condensing first means the board survives byte-for-byte in
its `## Clarified` sections and open checkboxes, with the original kept beside
the file. Enabling context.hooks.pre_compact is the owner's standing consent for that.

orch hook session-end#

Internal: hand the Chair seat's seal to a detached process (SessionEnd)

orch hook session-end [flags]

orch hook write-dup#

Internal: name the duplicate a Write/Edit just created (PostToolUse)

orch hook write-dup [flags]

orch housekeeping-pass#

Run one background-duty pass on this build (internal)

orch housekeeping-pass [flags]

orch inventory#

Check registered shared folders against the symbol index

orch inventory [flags]

orch ledger#

Check the requirements list before spawning lots of work

orch ledger [flags]

orch ledger board#

Print the ledger with (claimed: <session>) next to claimed items (task_claim); never rewrites the file

orch ledger board <file> [flags]

orch ledger check#

Validate ## Clarified + checkbox items (exit 1 on fail)

orch ledger check [dir] [flags]

orch lock#

Lock shared folders so two agents do not edit the same files

orch lock [flags]

orch lock acquire#

Acquire lock on shared path (holder=session id)

orch lock acquire <path> [flags]
bandera tipo valor por defecto persistente ayuda
--holder string `` no session id holding the lock
--ttl-min int 15 no TTL minutes

orch lock release#

Release lock (holder must match, or --holder *); reindexes symbols + notifies peers

orch lock release <path> [flags]
bandera tipo valor por defecto persistente ayuda
--holder string `` no session id

orch lock status#

Show one lock or list held locks

orch lock status [path] [flags]

orch notify-hook#

Command Code hook: drain `orch` bus/notices → additionalContext JSON (stdout)

orch notify-hook [flags]
bandera tipo valor por defecto persistente ayuda
--agent string `` no ```orch` agent id (baked by inject)``
--session string `` no ```orch` session id (baked by inject)``

orch refine#

Suggest small harness/prompt improvements from recent runs

orch refine [flags]
Looks at recent run evidence and can propose tiny updates to memory
or prompt notes. Default is a dry-run proposal; pass --apply to write.
Undo reverses the last apply. Does not rewrite your core `orch.yaml` guidance.
bandera tipo valor por defecto persistente ayuda
--apply bool false no apply patches (default is dry-run proposal only)
--instructions string `` no focus observation / policy to persist
--log-tail int 80 no bus.log + `.orch-agent.log` lines to scan for fail/error/timeout
--scope string global no local|global (recorded; workspace store is shared)

orch refine history#

List recent refine events

orch refine history [flags]
bandera tipo valor por defecto persistente ayuda
--limit int 20 no max events

orch refine run#

Propose (and optionally apply) refine patches

orch refine run [flags]
bandera tipo valor por defecto persistente ayuda
--apply bool false no apply patches (default is dry-run proposal only)
--instructions string `` no focus observation / policy to persist
--log-tail int 80 no bus.log + `.orch-agent.log` lines to scan for fail/error/timeout
--scope string global no local|global (recorded; workspace store is shared)

orch refine show#

Show supplemental prompt_notes.md

orch refine show [flags]

orch refine undo#

Undo last applied refine (forget memories / strip matching prompt lines)

orch refine undo [flags]

orch resume#

Load a session snapshot from SQLite

orch resume <session-id> [flags]

orch seat hold#

Long-lived seat-hold (internal; owns ConPTY for detach/reattach)

orch seat hold --session ID --root PATH -- -- agent argv... [flags]
bandera tipo valor por defecto persistente ayuda
--dir string `` no agent working directory
--height int 24 no initial PTY height
--preset string `` no agent preset id
--root string `` no workspace root
--session string `` no seat session id
--tail string `` no path for live seat tail
--width int 80 no initial PTY width

orch skill#

Inspect the sealed `orch-*` skills

orch skill [flags]

orch skill#

Inspect the sealed `orch-*` skills

orch skill [flags]

orch skill export#

Write each sealed `orch-*` skill as <dir>/<name>/SKILL.md

orch skill export [flags]
bandera tipo valor por defecto persistente ayuda
--dir string skills no output directory

orch skill export#

Write each sealed `orch-*` skill as <dir>/<name>/SKILL.md

orch skill export [flags]
bandera tipo valor por defecto persistente ayuda
--dir string skills no output directory

orch skill lint#

Print each sealed skill's bytes vs ceiling and flag narrative lines

orch skill lint [flags]

orch skill lint#

Print each sealed skill's bytes vs ceiling and flag narrative lines

orch skill lint [flags]

orch symbols#

Query the shared symbol registry

orch symbols [flags]

orch symbols arch#

Directories with symbol counts and the edge counts between them

orch symbols arch [flags]

orch symbols impact#

Symbols in changed files plus their callers (default: the working tree diff)

orch symbols impact [path...] [flags]
bandera tipo valor por defecto persistente ayuda
--range string `` no revision range, e.g. main...HEAD

Search shared symbols

orch symbols search <q> [flags]
bandera tipo valor por defecto persistente ayuda
--project string `` no registered project id — only hits under that project's path

orch symbols seed#

Write missing `orch:export` tags from language AST (bootstrap)

orch symbols seed [path...] [flags]
No args → all shared.<lang> folders. With paths → those folders only.
Idempotent; purpose is always `exported`. Reindexes each rooted folder.

orch symbols snippet#

One symbol body by line range instead of the whole file

orch symbols snippet <symbol> [flags]
bandera tipo valor por defecto persistente ayuda
--max-lines int 120 no cap on body lines

orch symbols trace#

Callers and callees of one symbol, with a confidence per edge

orch symbols trace <symbol> [flags]
bandera tipo valor por defecto persistente ayuda
--depth int 2 no hops, 1-5
--direction string both no callers|callees|both

orch worker-run#

Finish a prepared dispatch session (internal supervisor)

orch worker-run [flags]
bandera tipo valor por defecto persistente ayuda
--session string `` no session id prepared by dispatch