Documentation index · Operations · Agent protocol
This document reflects the current CLI surface in internal/praector/cli.go.
For exact parser behavior on an installed version, praector <command> --help is authoritative.
praector --version
praector <command> --helpProject-aware commands resolve context in this order where applicable:
- explicit
--project/ID; PRAECTOR_PROJECT_IDfor managed worker context;- nearest ancestor
.praector/project.tomlmarker.
Global state defaults to ~/.praector; override with PRAECTOR_HOME.
praector init [--name NAME] [--base-branch BRANCH] [--opencode PATH_OR_NAME]Registers the current Git repository as a Project and writes .praector/project.toml.
Example:
praector init --opencode /home/user/bin/opencodepraector run OBJECTIVE [--title TITLE] [--project PROJECT] [--detach] [--max-workers N]Attached mode runs until the Collection becomes COMPLETE or BLOCKED.
Detached mode only queues the Collection:
praector run --detach "Add enterprise SSO"
praector daemonBefore creating durable work, praector run preflights Git, Dolt, Praector itself, the configured OpenCode command, and repository validity.
praector status [TARGET] [--project PROJECT] [--no-reconcile]TARGET may be a Collection or Task ID. With no target, shows the current Project and its Collections.
By default status reconciles collection terminal state, so it may write durable state (superseded-review-lineage repair, revision reconciliation, and status transitions) and create Dolt commits, exactly as before. Pass --no-reconcile (alias --observed) to render the stored state from a single batched snapshot with zero writes — no lineage repair, no revision satisfy, no status flip, and no dolt add/commit.
Examples:
praector status
praector status COL-abc123
praector status T-def456praector graph [COLLECTION] [--project PROJECT] [--edges]Displays Tasks and dependency relationships for a Collection. With no Collection, defaults to the latest Collection in project context. --edges additionally lists the verifies carry edges (repair-lineage coverage) so operators can see which implementation each review verifies without raw Dolt SQL.
A Collection held BLOCKED prints a blocked by: line naming the mechanical holding predicate (COVERAGE_GAP, OPEN_REVISIONS, CRITIC_STALE, or DELIVERY_POLICY) instead of a speculative diagnosis.
praector daemon [--once] [--max-workers N]
An unrecognized dependency cycle in upgraded state does not terminate the global daemon. That Collection is marked `BLOCKED` and quarantined from scheduling while other Collections continue. Recognized historical plan-review cycles are repaired automatically before reconciliation.Only one scheduler owner may execute at a time.
--once reconciles/runs available work until no runnable work remains, then exits.
When enabled via ~/.praector/config.toml [mcp] or PRAECTOR_MCP (default off), a running daemon also hosts a loopback-only MCP listener so agents can drive the same durable control plane. Binding a non-loopback address requires the separate, default-off [mcp] allow_external / PRAECTOR_MCP_ALLOW_EXTERNAL opt-in (no authentication added). It has no CLI flag; see OPERATIONS.md.
praector doctorChecks:
git;dolt;opencodeon PATH;- Dolt state bootstrap;
- project marker/registration when present;
- configured project OpenCode command.
praector logs TARGET [--tail N]TARGET may be a Task or Collection ID.
Examples:
praector logs T-abc --tail 120
praector logs COL-abc --tail 50Attempt log paths are stored before OpenCode launches, so --tail can inspect a running Attempt.
praector events [TARGET] [--project ID] [--collection COL-ID] [--type EVENT_TYPE] [--since CURSOR] [--limit N]Reads the durable events log directly from the store, so it works with no daemon running. TARGET is a COL-*, T-*, or PRJ-* id (inferred like the other read commands); --project/--collection override the scope and --type filters by event_type.
Rows are returned deterministically oldest-first ordered by created_at then id, each showing the EVT/COL/T/ATTEMPT ids, the event_type, and the payload. The final line prints a next_cursor token; pass it back unchanged as --since CURSOR to page forward. --since is an exclusive composite (created_at, id) cursor, so paging never repeats or skips a row. A project-scoped listing (no collection/task filter) is permitted but always bounded by --limit (finite default) because the events table has no project_id index.
A supplied scope id must exist: like collection show, graph, and task show, events fails closed on a mistyped target with the same not-found message the store itself produces, whether the scope was given as the positional TARGET or as the equivalent flag:
praector events COL-DEADBEEF # praector: collection not found: COL-DEADBEEF (exit 1)
praector events --collection COL-DEADBEEF
praector events T-deadbeef # praector: task not found: T-deadbeef (exit 1)
praector events --project PRJ-nope # praector: project not found: PRJ-nope (exit 1)A --project whose project is not the owner of the supplied --collection is rejected the same way rather than returning an empty page. A --project given as a project name or root path resolves to that project's id and returns its rows. None of this changes the empty-but-valid case: an existing scope that simply has no matching events is still a successful, empty page with no next_cursor, so a --since paging loop over a quiet scope still terminates cleanly. A malformed --since token keeps reporting the invalid-cursor error ahead of any scope resolution.
praector events COL-abc --type TASK_CREATED
praector events COL-abc --since CURSOR --limit 50The events command is native-only (like the MCP surface). See State and Recovery for the event-log and cursor semantics.
praector collection show COL-IDPrints Collection JSON including Tasks, planning policy, revision history, acceptance history, and critic_revalidation. The revalidation block shows the latest critic, its sealed material-plan fingerprint, the current material fingerprint, baseline source, compatibility mode when applicable, and whether the critic is currently stale. Baseline sources distinguish initial_plan_seal, initial_policy_plan_seal, revision_plan_seal, material_revalidation, and legacy-only compatibility_plan_seal. A final plan-review task and its critic seal are published atomically, so fresh revision work cannot be mislabeled as compatibility state.
praector collection revise COL-ID \
--reason "Concrete acceptance defect or required correction" \
[--detach] \
[--max-workers N]Reopens a COMPLETE, unaccepted Collection after operator/human acceptance finds a real defect. Praector creates a durable OPEN revision and an Acceptance revision coordinator task. The revision reason is mandatory acceptance input, not a suggestion.
The Collection cannot become COMPLETE again until at least one post-revision implementation is completed and receives a fresh independent review with verdict=pass. If the coordinator fails to create repair work, the open revision keeps the Collection blocked. Accepted Collections cannot be revised in place; start a new Collection for follow-up changes.
Example:
praector collection revise COL-abc \
--reason "Rate-limit prune/check/append is not atomic under concurrent requests; synchronize it and add a concurrency regression test."praector collection diff COL-ID [--target BRANCH] [--stat]Compares the Collection integration branch to the target branch, defaulting to the Project base branch.
Examples:
praector collection diff COL-abc --stat
praector collection diff COL-abc --target developpraector collection pr COL-ID \
[--draft] \
[--title TITLE] \
[--base BRANCH] \
[--remote REMOTE] \
[--dry-run] \
[--refresh-copy] \
[--open]Publishes a reviewed COMPLETE Collection integration branch as a GitHub pull request using the authenticated gh CLI. The command applies the same acceptance-grade validation used by direct acceptance: every completed implementation must have a completed independent review with verdict=pass, and required critic freshness must be current.
Defaults:
- head = the Collection integration branch;
- base = Project base branch, or the base already recorded for an existing Collection PR;
- remote = configured base-branch remote, then
origin, then the sole remaining remote; - title = the single completed implementation title when there is exactly one, otherwise the Collection title;
- body = deterministic summary/changes/verification/unresolved sections assembled from durable Task results; implementation
pr_summary/changesare preferred, with a findings/evidence fallback for older Collections.
Idempotency:
- an existing recorded PR is reused;
- an existing GitHub PR with the same head branch is adopted and recorded;
- a completed revision pushes the same Collection branch and therefore updates the existing open PR;
- a closed/merged PR is never silently replaced with a duplicate;
- a directly accepted or already-contained candidate cannot create a redundant new PR.
--dry-run performs no push and no GitHub/Dolt mutation. --draft, --title, and --base are creation-time semantics; reruns preserve the existing PR contract. Existing open PR bodies are not overwritten by default; --refresh-copy explicitly replaces the body with the current deterministic Praector-generated copy. --open opens the resulting PR in the browser.
PR delivery does not call praector collection accept; Collection execution state, PR delivery state, and direct acceptance records remain distinct.
praector collection accept COL-ID \
[--target BRANCH] \
[--no-ff] \
[--dry-run] \
[--cleanup] \
[--delete-branches]Default behavior is fast-forward-only.
Recommended workflow:
praector collection diff COL-abc --stat
praector collection accept COL-abc --dry-run
praector collection accept COL-abcUse --no-ff only after intentionally reviewing a diverged target. --delete-branches requires --cleanup.
Acceptance validation requires a COMPLETE Collection and explicit passing independent review for completed implementation work.
See WORKSPACES.md.
praector collection cleanup COL-ID [--delete-branches] [--force]Default behavior removes Praector worktrees for a completed, accepted Collection.
--forceallows worktree cleanup before acceptance.- branch deletion still requires an acceptance record and only deletes branches whose tips are reachable from the accepted target.
praector project listpraector project show [--project PROJECT]Inspect the built-in runtime profile contracts that are injected into every managed Attempt:
praector profile list
praector profile show coordinator
praector profile show explore
praector profile show critic
praector profile show plan_review
praector profile show adviseprofile list shows capability mode (read-only/write) and the human-facing role title. profile show prints the mandatory embedded prompt from internal/assets/prompts/<profile>.md. See PROFILES.md.
praector task show T-IDPrints durable Task JSON, including decoded result/dependencies where applicable.
praector task list [--collection COL-ID] [--project PROJECT]Defaults to the latest Collection in context.
praector task retry T-ID [--reason TEXT] [--detach] [--max-workers N]Creates a fresh replacement Task for a FAILED task instead of erasing/reusing its exhausted Attempt history. The failed Task is marked SUPERSEDED, hard dependents are rewired to the replacement, prerequisite dependencies are inherited, and the Collection returns to RUNNING. By default Praector resumes the Collection immediately; use --detach to queue the replacement for an existing daemon.
This is the preferred recovery path for transient harness/provider failures after the normal attempt budget has been exhausted.
praector task request \
[--task CALLER] \
--profile explore|critic|plan_review|research|implement|review|advise \
--title TITLE \
(--objective OBJECTIVE | --objective-file PATH | --objective-file - | -) \
--reason REASON \
[--blocking] \
[--depends-on T-ID ...] \
[--workspace auto|inherit|collection|isolated]Managed workers normally omit --task; PRAECTOR_TASK_ID identifies the caller.
Exactly one objective source is required: --objective TEXT, or --objective-file PATH, or stdin via --objective-file - / a lone - positional. File and stdin objectives are stored byte-exactly (parity with result submit --stdin/--file), so a long or substitution-prone objective can be written to a file or piped rather than pasted into a shell word — backtick or $(...) command substitution can then never bake live command output into a durable objective. More than one source, or an unreadable file, fails closed without creating a task. The MCP praector_task_request schema is unchanged (objective stays a required string); this input hygiene is CLI-side only, parsing into the identical service input.
See AGENT_PROTOCOL.md.
--depends-on accepts only exact IDs of durable tasks that already exist in the same Collection. Praector rejects missing or cross-Collection task IDs before publishing the requested task, so symbolic placeholders such as invented T-* names must never be used.
Coordinator-only graph mutation:
praector task add-dependency T-TASK --on T-PREREQ [--caller T-COORDINATOR]Coordinator-only replacement/rewire:
praector task supersede T-OLD \
--with T-REPLACEMENT \
--reason REASON \
[--caller T-COORDINATOR]praector context show [--task T-ID]Returns durable Project/Collection/Task/dependency/memory/decision context. Managed workers normally use the current PRAECTOR_TASK_ID.
praector coordinator attention \
[--task T-ID] \
--reason REASON \
[--blocking]Workers use this when the graph/plan itself needs reconsideration.
praector result show [T-ID]With no ID inside a managed worker, defaults to the current PRAECTOR_TASK_ID.
praector result submit \
[--task T-ID] \
[--stdin | --file PATH | --summary TEXT] \
[--status complete|waiting|failed]Structured stdin is preferred:
cat result.json | praector result submit --stdinReview completion requires verdict: pass|fail in the JSON payload.
praector memory add \
[--project PROJECT] \
[--collection COL-ID] \
[--task T-ID] \
[--scope project|collection] \
[--state candidate|accepted] \
[--kind KIND] \
--text TEXTDefaults: scope=collection, state=candidate, kind=finding.
praector memory list \
[--project PROJECT] \
[--collection COL-ID] \
[--state candidate|accepted]Default state is accepted.
praector decision add \
[--project PROJECT] \
[--collection COL-ID] \
[--task T-ID] \
--statement TEXT \
[--rationale TEXT]Praector supplies environment variables used by the CLI to identify current context. The exact set is internal implementation detail, but worker-facing commands are designed to work without manually supplying Project/Collection/Task IDs in the common case.
Do not build external integrations around undocumented internal environment-variable names; prefer explicit CLI IDs when invoking Praector outside a managed worker.
praector collection show COL-... includes both planning_policy and delivery_policy. Direct mutation requests are marked implementation_required: true; they cannot reach COMPLETE without completed implementation and passing review. A genuinely stale required critic also blocks COMPLETE and praector collection accept; workspace-only base-SHA bookkeeping does not count as material plan change.
Coordinator-requested plan_review is always treated as blocking, even if the caller omits --blocking; the latest active critic is automatically attached as a prerequisite when present. The same atomic mutation attaches that plan review as a prerequisite of all existing nonterminal implementation tasks. Final plan review is single-flight: if a non-failed nonterminal plan_review already exists, the request reuses it and atomically attaches new prerequisites/caller/implementation gates instead of creating another review generation. A blocking caller is never retained as a prerequisite of that same review; if the review currently waits on that caller, the handoff atomically flips the edge direction. Required write work is additionally protected at claim time. The deterministic policy backstop defers automatic Policy plan review creation while any coordinator remains active, preventing duplicate plan-review tasks for the same graph. If the coordinator terminates without creating the required review, policy creates the fallback afterward. A required critic is sealed to the material plan at first final review handoff; later material contract/dependency changes stale it and force fresh critic plus coordinator incorporation before plan review or implementation can be claimed. The seal is written atomically with coordinator-created plan-review publication, and human revision handoffs are labeled revision_plan_seal rather than upgrade compatibility.