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). 177 comandos en total, 118 ocultos (ver "Modo avanzado / protocolo de agentes" mas abajo).

orch#

OrcheMax (Orche) — run AI coding agents together on your projects

orch [flags]
OrcheMax — also Orchest; short name Orche — 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 still:  orch

First-time setup
  1. Put orch.exe in any folder and add that folder to your user PATH
     (that folder stays empty of Orche files — PATH only)
  2. Create or cd into your code workspace
  3. Run:  orch setup
     → defaults to this folder; projects/shared are relative names
     → writes orch.yaml + .orch/ here
  4. Optional:  orch init
     → ordered layout (shared + projects), thin CLAUDE/TRACKER, git per folder

Connect LLM providers (user-wide — once for all workspaces)
  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

  Workspace orch.yaml can still override ai.providers if you need a special case.

Start working (from inside your workspace)
  See “Detected agents” below — open one with:  orch <name>
  orch ui              # optional local web console
  orch workspace       # show resolved workshop for this folder

Tips
  Type your prompt inside the agent UI — not as arguments to orch.
  Outside the workspace: loose mode (gateway OK; no locks/bus/project control).
  Agents that know Orche use MCP — see docs/PROTOCOL-AGENT.md.
  Bare "orch" prints this help. Use:  orch <command> --help
  Power-user / agent protocol commands are hidden from this list; they still work.

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

orch agents#

Detect coding agents installed on your PATH

orch agents [flags]
Scans your PATH for known agent CLIs (Claude, OpenCode, Cursor, …)
and records what was found. First-time setup can auto-add missing launch
presets; later scans only propose changes until you apply.

  orch agents scan    # look for agents; write a snapshot
  orch agents show    # print last scan
  orch agents apply   # add newly found agents to orch.yaml (keeps your edits)

orch agents apply#

Add newly found agents to orch.yaml (never overwrites your edits)

orch agents apply [flags]

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

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 gateway#

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

orch gateway [flags]
The Orche gateway is a small local proxy (default http://127.0.0.1:8788).
Agents talk to Orche; Orche 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#

Keep the gateway running on Windows (optional scheduled task)

orch gateway autostart [flags]

orch gateway autostart install#

Write .orch/run-gateway.ps1 + register OrchGateway watchdog task

orch gateway autostart install [flags]
Generates .orch/run-gateway.ps1 (loads User API key env + optional .orch/keys.env)
and registers a Current-User minute watchdog scheduled task (no elevation; replaces
HeadroomDev/OmniRouteDev). Script no-ops if the gateway port is already listening.
Use --dry-run to print script + task XML without writing or registering.
bandera tipo valor por defecto persistente ayuda
--dry-run bool false no print script+XML; do not write or register
--every int 5 no watchdog interval minutes
--name string OrchGateway no schtasks task name

orch gateway autostart status#

Show whether OrchGateway task is registered

orch gateway autostart status [flags]
bandera tipo valor por defecto persistente ayuda
--name string OrchGateway no schtasks task name

orch gateway autostart uninstall#

Remove OrchGateway scheduled task

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

orch gateway connect#

Point agents at this gateway (OpenCode writes config automatically)

orch gateway connect [claude|openai|opencode|commandcode] [flags]
Connects agent apps to the local OrcheMax gateway.

  orch gateway connect opencode     # writes ~/.config/opencode/opencode.json (automatic)
  orch gateway connect commandcode  # prints env for Command Code
  orch gateway connect openai       # prints env + OpenCode snippet
  orch gateway connect claude       # prints Anthropic env

OpenCode is applied automatically. Other agents still need a one-time paste.

Start the gateway first:  orch gateway

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
bandera tipo valor por defecto persistente ayuda
--live bool false no set ai.mode=live (needs provider via gateway setup)

orch gateway key#

Manage virtual keys agents use to call the local gateway

orch gateway key [flags]

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 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 Orche 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 run#

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

orch gateway run [flags]

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 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 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 home#

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

orch home [flags]

orch init#

Prepare an ordered workshop (projects, shared, AI doctrine, git)

orch init [flags]
Run inside a bound workshop (after orch setup / orch workspace).

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 + per-project TRACKER, installs sealed orch-*
skills, git-inits each project/shared (never the workshop root), and wires
includeIf identities when profiles are given.

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

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

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:
  orch project add .
  orch project add products/saint
  cd products && orch project add saint
bandera tipo valor por defecto persistente ayuda
--kind string `` no optional kind label (e.g. go, web)
--name string `` no optional short name (default: folder name)

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 server#

Link this workspace 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]

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 setup#

Bind this folder as your Orche workspace (orch.yaml + .orch)

orch setup [flags]
Run from your code workspace (create it and cd there first).

Orche will:
  • Use the current folder as the workspace (press Enter), or another path you type
  • Write orch.yaml and .orch/ here
  • Ask for optional project/shared folders as relative names (e.g. billing, shared)
  • Remind you that live agents need LLM provider API keys (env vars) — optional add one row
  • Put orch.exe's folder on your user PATH if needed (PATH only — no files there)

After setup: orch init (ordered layout + AI doctrine) → set the key env var → orch gateway → orch opencode | claude | …
Outside the workspace Orche runs loose (gateway/optimizations; no locks/bus).
More providers later:  orch gateway setup --help

--prune-path skips the interactive wizard and only reconciles the user PATH,
dropping dead orch entries (old installs, leftover go-build/Temp dogfood
dirs) while never touching entries orch cannot attribute to itself. Add
--dry-run to print what would be removed without changing anything.

Docs: https://docs.orchemax.com/quickstart/
bandera tipo valor por defecto persistente ayuda
--dry-run bool false no With --prune-path, print what would be removed without changing PATH
--prune-path bool false no Only reconcile the user PATH (drop dead orch entries), skip the interactive wizard

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 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 usage#

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

orch usage [flags]
bandera tipo valor por defecto persistente ayuda
--format string table no table|json
--governance bool false no print conflict_rate/duplicate_rate per session instead (item 38: cross-session file collisions, clone advisories)
--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)

orch version#

Print version

orch version [flags]

orch workspace#

Show the workshop for this folder, or initialize another path

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

  orch workspace           # print resolved workshop for the current folder
  orch workspace <path>    # create/init that folder as a workshop (then cd there)
  orch workspace show
  orch workspace use <path>

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 workspace show#

Print the workspace this install is bound to

orch workspace show [flags]

orch workspace use#

Point this install at a workspace folder

orch workspace 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#

118 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 agy#

Open agy in your project (interactive)

orch agy [flags]
Starts agy with its normal chat UI in the project for your current folder.

Just run:
  orch agy

Then type your message inside agy — do not pass the prompt as orch arguments.
For a one-shot scripted run without the UI, use:
  orch dispatch --agent agy --prompt "…"

Orche stays underneath (session, tools, locks, gateway when enabled).
One running interactive agent counts as one active seat until you quit.
bandera tipo valor por defecto persistente ayuda
--actor string `` no policy actor
--force-chair bool false no allow a second live Chair in the same project (ghost seats after kill are auto-cleared)
--name string `` no session display name
--project string `` no override project (default: registered project containing cwd)
--session string `` no session id

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> [flags]
bandera tipo valor por defecto persistente ayuda
--answer string `` no the answer (must be one of the offered options, when the ask has any)
--by string `` no who answered (default human)

orch ask list#

List asks (default: the open ones)

orch ask list [flags]
bandera tipo valor por defecto persistente ayuda
--limit int 50 no max rows
--session string `` no filter by asker or addressee session
--status string open no open|answered|timeout|all

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 install#

Write guidance files + MCP from chair.guidance flags

orch chair install [flags]
bandera tipo valor por defecto persistente ayuda
--dry-run bool false no list paths without writing
--target string all no all|project|claude|cursor|commandcode|opencode (comma-ok)

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 claude#

Open claude in your project (interactive)

orch claude [flags]
Starts claude with its normal chat UI in the project for your current folder.

Just run:
  orch claude

Then type your message inside claude — do not pass the prompt as orch arguments.
For a one-shot scripted run without the UI, use:
  orch dispatch --agent claude --prompt "…"

Orche stays underneath (session, tools, locks, gateway when enabled).
One running interactive agent counts as one active seat until you quit.
bandera tipo valor por defecto persistente ayuda
--actor string `` no policy actor
--force-chair bool false no allow a second live Chair in the same project (ghost seats after kill are auto-cleared)
--name string `` no session display name
--project string `` no override project (default: registered project containing cwd)
--session string `` no session id

orch codex#

Open codex in your project (interactive)

orch codex [flags]
Starts codex with its normal chat UI in the project for your current folder.

Just run:
  orch codex

Then type your message inside codex — do not pass the prompt as orch arguments.
For a one-shot scripted run without the UI, use:
  orch dispatch --agent codex --prompt "…"

Orche stays underneath (session, tools, locks, gateway when enabled).
One running interactive agent counts as one active seat until you quit.
bandera tipo valor por defecto persistente ayuda
--actor string `` no policy actor
--force-chair bool false no allow a second live Chair in the same project (ghost seats after kill are auto-cleared)
--name string `` no session display name
--project string `` no override project (default: registered project containing cwd)
--session string `` no session id

orch commandcode#

Open commandcode in your project (interactive)

orch commandcode [flags]
Starts commandcode with its normal chat UI in the project for your current folder.

Just run:
  orch commandcode

Then type your message inside commandcode — do not pass the prompt as orch arguments.
For a one-shot scripted run without the UI, use:
  orch dispatch --agent commandcode --prompt "…"

Orche stays underneath (session, tools, locks, gateway when enabled).
One running interactive agent counts as one active seat until you quit.
bandera tipo valor por defecto persistente ayuda
--actor string `` no policy actor
--force-chair bool false no allow a second live Chair in the same project (ghost seats after kill are auto-cleared)
--name string `` no session display name
--project string `` no override project (default: registered project containing cwd)
--session string `` no session id

orch context#

Configure how large prompts are compressed to save tokens

orch context [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 copilot#

Open copilot in your project (interactive)

orch copilot [flags]
Starts copilot with its normal chat UI in the project for your current folder.

Just run:
  orch copilot

Then type your message inside copilot — do not pass the prompt as orch arguments.
For a one-shot scripted run without the UI, use:
  orch dispatch --agent copilot --prompt "…"

Orche stays underneath (session, tools, locks, gateway when enabled).
One running interactive agent counts as one active seat until you quit.
bandera tipo valor por defecto persistente ayuda
--actor string `` no policy actor
--force-chair bool false no allow a second live Chair in the same project (ghost seats after kill are auto-cleared)
--name string `` no session display name
--project string `` no override project (default: registered project containing cwd)
--session string `` no session id

orch cursor#

Open cursor in your project (interactive)

orch cursor [flags]
Starts cursor with its normal chat UI in the project for your current folder.

Just run:
  orch cursor

Then type your message inside cursor — do not pass the prompt as orch arguments.
For a one-shot scripted run without the UI, use:
  orch dispatch --agent cursor --prompt "…"

Orche stays underneath (session, tools, locks, gateway when enabled).
One running interactive agent counts as one active seat until you quit.
bandera tipo valor por defecto persistente ayuda
--actor string `` no policy actor
--force-chair bool false no allow a second live Chair in the same project (ghost seats after kill are auto-cleared)
--name string `` no session display name
--project string `` no override project (default: registered project containing cwd)
--session string `` no session id

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 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 claude | orch opencode | orch commandcode | orch cursor | …
bandera tipo valor por defecto persistente ayuda
--actor string `` no policy actor (default: ORCH_ACTOR or local)
--agent string default no agent id (.agents/<id>.md)
--force bool false no bypass clarify_before_spawn ledger gate
--inplace bool false no run in project root (shared disk; multi-agent coord)
--keep-worktree bool false no keep worktree after run
--name string `` no session display name (default: agent id; like claude -n)
--project string `` no git repo path (default: registered project containing cwd)
--prompt string `` no prompt text
--prompt-file string `` no read prompt from file
--session string `` no session id (default: timestamp-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)

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 grok#

Open grok in your project (interactive)

orch grok [flags]
Starts grok with its normal chat UI in the project for your current folder.

Just run:
  orch grok

Then type your message inside grok — do not pass the prompt as orch arguments.
For a one-shot scripted run without the UI, use:
  orch dispatch --agent grok --prompt "…"

Orche stays underneath (session, tools, locks, gateway when enabled).
One running interactive agent counts as one active seat until you quit.
bandera tipo valor por defecto persistente ayuda
--actor string `` no policy actor
--force-chair bool false no allow a second live Chair in the same project (ghost seats after kill are auto-cleared)
--name string `` no session display name
--project string `` no override project (default: registered project containing cwd)
--session string `` no session id

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 artifacts#

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

orch guard artifacts [files...|dir] [flags]
Field lesson: compiler outputs next to shared units poison multi-agent floors.
Flags staged paths or walks a directory (skips tests/, out/, build/, .git).
Extensions: .dcu .dcp .o .obj .exe .map .pyc .class .local … and Delphi Unit.pas.~1~ backups.

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):
  en     — identifiers + user-visible strings in English; comments may be any language
  unset  — skip
  other  — skip until a checker exists

Spanish UI copy belongs in i18n dictionaries (paths like i18n/, es.json are exempt).
Field lesson: chatting in Spanish with the LLM must not put Spanish into identifiers or raises.

orch guard comment#

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

orch guard comment <shared-file> [flags]

orch guard control-bytes#

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

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

orch guard ddl#

Require seeder/repository companion for migration/CREATE TABLE changes

orch guard ddl [files...] [flags]

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 and email templates

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é).
FireDAC / Delphi WideString rules stay workshop-specific — not this gate.

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]

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 lang#

Check workshop docs against workspace.locale

orch guard lang [root] [flags]
Uses workspace.locale from orch.yaml (owner decision for docs/prose):
  en     — deny Spanish markers in docs
  es     — Spanish docs allowed (English-only docs check off)
  unset  — skip

This is separate from workspace.code_lang (see orch guard code-lang).
Chat/docs may be Spanish while code stays English.

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 profile#

Show or set guard.profile in orch.yaml

orch guard profile [lite|shared|strict|bring|none] [flags]

orch guard shared-brand#

Deny product brand / products/<id> references inside shared layers

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

orch guard tracker#

Validate TRACKER state table (T1–T4: status · SPEC · evidence · no prose)

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 unwire#

Remove orch-marked IDE hooks (and optionally git hooks)

orch guard unwire [flags]
bandera tipo valor por defecto persistente ayuda
--git bool false no also uninstall orch git hooks under project/shared

orch guard wire#

Install marked git/Claude/Cursor adapters for this workshop

orch guard wire [flags]
bandera tipo valor por defecto persistente ayuda
--claude bool false no wire ~/.claude/settings.json (user scope; soft-skip outside workshop)
--cursor bool false no wire workshop .cursor/hooks.json
--git bool false no install git pre-commit/pre-push on project+shared repos
--profile bool false no use guard.profile from orch.yaml

orch harness#

Detect AI tools and workshop doctrine surfaces

orch harness [flags]

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)
  pre-compact Claude Code PreCompact — context.hooks.pre_compact
Copilot CLI (postToolUse.modifiedResult) and Cursor (updated_mcp_tool_output)
expose the same capability but orch has no wiring path for either harness yet,
so neither is installed. Codex CLI cannot replace tool output at all.

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 index#

Index shared code into the symbol registry

orch index [flags]

orch index shared#

Scan paths.shared and upsert symbols

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

orch inventory#

Check registered shared folders against the symbol index

orch inventory [flags]

orch kimi#

Open kimi in your project (interactive)

orch kimi [flags]
Starts kimi with its normal chat UI in the project for your current folder.

Just run:
  orch kimi

Then type your message inside kimi — do not pass the prompt as orch arguments.
For a one-shot scripted run without the UI, use:
  orch dispatch --agent kimi --prompt "…"

Orche stays underneath (session, tools, locks, gateway when enabled).
One running interactive agent counts as one active seat until you quit.
bandera tipo valor por defecto persistente ayuda
--actor string `` no policy actor
--force-chair bool false no allow a second live Chair in the same project (ghost seats after kill are auto-cleared)
--name string `` no session display name
--project string `` no override project (default: registered project containing cwd)
--session string `` no session id

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 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

orch memory supersede#

Mark old memory superseded by new id

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

orch memory sweep#

Expire memories past retention_days

orch memory sweep [flags]

orch mimo#

Open mimo in your project (interactive)

orch mimo [flags]
Starts mimo with its normal chat UI in the project for your current folder.

Just run:
  orch mimo

Then type your message inside mimo — do not pass the prompt as orch arguments.
For a one-shot scripted run without the UI, use:
  orch dispatch --agent mimo --prompt "…"

Orche stays underneath (session, tools, locks, gateway when enabled).
One running interactive agent counts as one active seat until you quit.
bandera tipo valor por defecto persistente ayuda
--actor string `` no policy actor
--force-chair bool false no allow a second live Chair in the same project (ghost seats after kill are auto-cleared)
--name string `` no session display name
--project string `` no override project (default: registered project containing cwd)
--session string `` no session id

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
--agent string `` no agent id
--limit int 50 no max rows
--session string `` no session id
--unread bool true no only unread

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
--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]
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-role string `` no parent|child|sibling (requires --from-session)
--to-session string `` no target session id

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 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 opencode#

Open opencode in your project (interactive)

orch opencode [flags]
Starts opencode with its normal chat UI in the project for your current folder.

Just run:
  orch opencode

Then type your message inside opencode — do not pass the prompt as orch arguments.
For a one-shot scripted run without the UI, use:
  orch dispatch --agent opencode --prompt "…"

Orche stays underneath (session, tools, locks, gateway when enabled).
One running interactive agent counts as one active seat until you quit.
bandera tipo valor por defecto persistente ayuda
--actor string `` no policy actor
--force-chair bool false no allow a second live Chair in the same project (ghost seats after kill are auto-cleared)
--name string `` no session display name
--project string `` no override project (default: registered project containing cwd)
--session string `` no session id

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 session#

Session commands

orch session [flags]

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]

orch session rename#

Set display name (like claude /rename)

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

orch session seal#

Write .orch/LAST_SESSION.md from a snapshot (default: newest)

orch session seal [session-id] [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 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|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: task-<id>)
--timeout int 0 no agent timeout seconds (0=agents.timeout_sec)

orch zcode#

Open zcode in your project (interactive)

orch zcode [flags]
Starts zcode with its normal chat UI in the project for your current folder.

Just run:
  orch zcode

Then type your message inside zcode — do not pass the prompt as orch arguments.
For a one-shot scripted run without the UI, use:
  orch dispatch --agent zcode --prompt "…"

Orche stays underneath (session, tools, locks, gateway when enabled).
One running interactive agent counts as one active seat until you quit.
bandera tipo valor por defecto persistente ayuda
--actor string `` no policy actor
--force-chair bool false no allow a second live Chair in the same project (ghost seats after kill are auto-cleared)
--name string `` no session display name
--project string `` no override project (default: registered project containing cwd)
--session string `` no session id