Operator CLI and MCP reference
Every operator command and MCP tool for Operator jobs, saved procedures, plans, gates, and the catalog, with scopes, output, exit codes, and the never-retried writes.
The infraone operator command is part of the npm package @allocator-one/infraone, which also provides infraone harness, the issue-tracker client. Both share one login and accept the same arguments. The packages @allocator-one/operator and @allocator-one/harness-cli are retired: remove them with npm rm -g @allocator-one/operator @allocator-one/harness-cli before you install @allocator-one/infraone, because their operator and harness commands clash with the ones the new package installs. Those two names still work as short aliases of infraone operator and infraone harness.
No command and no MCP tool approves anything. Write and send capabilities, and every change set Operator proposes, are approved by a person in the app. The commands print the approval link instead.
The commands act with the same authority as the app: as the signed-in person, with that person's current role and the organization's Operator settings and budgets. They can do nothing the workbench would refuse.
Starting a new job from an objective, from the terminal or an MCP agent, is coming in a later release. Today a job starts in the app, from a released plan, or with infraone operator procedure run.
Conventions
- Identifiers. Job, procedure, and plan identifiers are UUIDs. Gate commands take an issue identifier such as
OPS-12. A capability identifier looks likecrm.party.search. A malformed identifier is refused before anything is sent. - Output. Every command except
infraone operator mcpaccepts--json, which replaces the human output with the response data as JSON. stdout carries data only. Diagnostics, such as paging notices, go to stderr. - Host notice. Every command that writes prints
→ https://harness.infra.one(or the host it used) on stderr. - By reference. Job commands show states, codes, counts, identifiers, and links. They never show a job's objective text, what Operator read, a change set's values or targets, or a skill's content. Open the workbench link to read those in the app.
Access
| Command group | Scope | Who |
|---|---|---|
jobs, job, watch, tools, tool, skills, procedure show | operator:read | An admin or member of the organization the credential is bound to, with Operator switched on there |
steer, cancel, pause, continue, procedure save, procedure run | operator:write | As above, plus the per-command rule listed with each command |
plan show, conditions | harness:read | Staff standing in the organization's tracker |
plan create, plan edit, plan release, plan hold | harness:write | Staff standing in the organization's tracker; releasing a plan with Operator steps also needs the right to run Operator |
gate satisfy, gate unsatisfy | harness:read and harness:write | Staff standing in the organization's tracker; only an owned gate's owner can tick it |
assignments | An outside expert's credential | The outside expert it belongs to |
A browser login is one of two kinds, set by your standing in the organization's tracker when you sign in:
- A full login, for tracker staff, carries every scope above except the outside expert's.
- An Operator-only login, for members without staff standing, carries only
operator:readandoperator:write. It reaches the first two rows and nothing else: the plan, gate, and issue-tracker commands answer403with "This token may not access the Harness API".
An aone_ API token carries only the scopes it was created with. See Set up the operator CLI and MCP server.
Jobs
infraone operator jobs
Lists the Operator jobs you can see in the workbench, newest first: identifier, state, what the job waits on, kind, owner, plan step, and last update. After the table it lists the approval link of every job waiting for approval.
| Option | Meaning |
|---|---|
--status <states> | Comma-separated job states, or the aliases open (not done), waiting, and done. |
--mine | Only jobs you own. |
--limit <n> | Jobs per page, 1 to 50. The default is 20. |
--all | Follow every page, 50 jobs each unless --limit says otherwise, for up to 100 pages. Past that it stops, exits 1, and asks you to narrow the list. |
Job states: draft, planning, ready, running, waiting_for_approval, waiting_for_human, paused, failed, needs_reconciliation, completed, and cancelled.
A page can come back short, or even empty, while older jobs exist, because jobs you may not see are removed after the page is read. stderr says so.
infraone operator job <job-id>
Shows one job: state, plan version, progress, remaining window and budget, spend, the change set waiting for approval with its approval link, the grant, verification status, effect counts, blockers, artifacts, the pinned skill, people, saved procedures, and the controls you can use in the workbench.
| Option | Meaning |
|---|---|
--changes | Shows the job's latest change set instead, by reference: its identifier, version, status, digest, plan version, and maximum effect count, and each action's type, version, order, effect count, required capabilities, and digest, with the approval link. "No pending change set" means Operator has proposed nothing yet; change_set is null under --json. |
--people | Shows who is on the job instead: the requester, the execution principal (the person the job runs as), the owner, the approvers, and the collaborators. A person the job does not name shows as a user identifier. Email addresses are never returned. |
Pass both options to see both views. --changes reads the job and then its change set; if a new change set lands between the two reads, stderr says so and you run the command again.
infraone operator watch <job-id>
Prints the job's events and state changes as they happen until the job ends or a person has to act.
- It polls every 2 seconds, and every 10 seconds while the job is paused or waits for a person.
- A person has to act exactly when the job's
waiting_onis set:approval,person,reconciliation,verification, ordelivery.watchstops there and prints the link to act on, which is the approval link when the job waits for approval. - A job paused with nothing for a person to do, such as one whose deliveries are still sending, resumes by itself, so
watchkeeps following it. - It only reads, so it retries a failed poll three times, after 1, 2, and 4 seconds, or later when the server sends
Retry-After. It retries when the API is unreachable, answers with a 5xx, or rate-limits. - When the reader of its output goes away, as in
infraone operator watch <id> | head -1, it stops polling and exits0.
| Option | Meaning |
|---|---|
--after <seq> | Start after this event sequence instead of replaying the history. The default 0 replays everything. |
--through-waits | Keep following while a person has to act instead of stopping. It prints each new approval link and never exits 4. |
--json | Print one document when the watch ends: the outcome, the job's last state, the events read (identifiers, codes, numbers, and booleans only), and next_after to resume from. |
When a poll still fails after its retries, or you press Ctrl-C, stderr names the --after value to resume from, and --json still prints the events read so far.
Job controls
steer, cancel, pause, and continue act the way the workbench's controls do, under the same rules and with your current rights. Each prints the job as infraone operator job shows it afterwards; --json returns the same document.
infraone operator steer <job-id> <instruction>
Posts the instruction in the job's room, attributed to you. The job's owner and collaborators may steer it wherever the app offers Steer. Work the instruction changes needs a fresh approval in the app, because earlier approvals stop applying to it. Steering a running job stops its current run so it can take the instruction.
- The instruction is 1 to 10,000 characters once trimmed and is sent trimmed. A blank or longer instruction is refused before anything is sent, whether it comes from the command line or from a file.
- Quote it. Unquoted words that look like options, such as
--json, are read as options. Put--before an instruction that starts with-. --instruction-file <path>reads the instruction from a file, or from stdin with-, and takes any text as it is. Instruction words and--instruction-filetogether are a usage error.
infraone operator cancel <job-id>
Ends the job. Effects that already committed stay committed, and the command prints their counts; staged effects that never ran count as unknown. Only the job's execution principal may cancel it.
infraone operator pause <job-id>
Holds a running job for a person without resetting its active-time budget. Continue it to run again. Only the job's execution principal may pause it.
infraone operator continue <job-id>
Opens a new audited window for a job that ran out of time or waits on a person, or retries a failed run or verification, as Continue does in the app. Only the job's execution principal may continue it. Approval still happens in the app, at the job's approval link.
Saved procedures
infraone operator procedure save <job-id> --name <name>
Saves a job's recipe as a versioned procedure, as Save procedure does in the app. Only the job's owner can save it, and only once the job completed with its work verified and has work to repeat. The name is trimmed and kept to 200 characters. Saving again saves another procedure.
infraone operator procedure show <procedure-id>
Prints the procedure's name, the job it was saved from and that job's link, the current version, each version's recipe digest, capability identifiers, and action roster, and the JSON schema of the parameters a run takes. It never shows a version's recipe or anything the saved job read.
infraone operator procedure run <procedure-id>
Starts a new job from the procedure, as Rerun does in the app. Nothing of the saved job carries over: no grant, approval, delegation, collaborator, or read material. The run has fresh inputs, your own current rights, and a change set that needs its own approval in the app. The command prints the new job's link.
| Option | Meaning |
|---|---|
--version <n> | Run only while version n is still current. |
--param <name=value> | A parameter as a string. Repeatable. |
--param <name:=json> | A parameter as a JSON value, for example --param count:=3. |
--params-file <path> | All parameters as one JSON object, from a file or from stdin with -. Not combinable with --param. |
--group <id> | The contact group to reconcile, when the procedure's scoped inputs require contact_reconciliation. |
--source <id> | The uploaded file to reconcile against, with --group. |
A malformed --param, an unreadable or invalid --params-file, both parameter forms together, a --version that is not a positive integer, a single-value option given twice, or a --group or --source with surrounding whitespace exits 2 before anything is sent.
When the new procedure or job can't be read back as you, the answer is only its identifier and link.
Writes are never retried
steer, cancel, pause, continue, procedure save, and procedure run are not idempotent. Each is sent once and never retried, not after a timeout and not after a 5xx: a second continue opens another window, a second save saves another procedure, and a second run starts another job. The exit code says whether trying again is safe:
- Exit
3only when the request never reached the server: the name did not resolve, the connection was refused, or the TLS handshake failed. Nothing changed. - Exit
1with "Outcome unknown" when it may have reached the server: a timeout, a dropped connection, an answer that could not be read, or a 5xx. Check what the error names first,infraone operator job <id>, the job's procedures, orinfraone operator jobsfor a run's new job, before you try again.
A 503 service_unavailable from procedure run is the exception: the server refused the run before starting it. A continue that answers 404 may still have happened if the job went out of your sight as it was continued; check infraone operator job <id> first.
Plans and gates
infraone operator plan create --file <path>
Creates a plan from a JSON file (.json) or a YAML file (anything else, and stdin with --file -) of up to 8 MB. The plan starts held: nothing runs until a person releases it. An invalid plan creates nothing; the command exits 1 and lists every violation by the step key it concerns. See Plans for the document format.
| Option | Meaning |
|---|---|
--team <key> | The root's team and the default team for people's steps. Falls back to HARNESS_TEAM, then the repository's .harness-cli/config.json. |
--idempotency-key <key> | 1 to 200 printable ASCII characters. If a create times out, run it again with the same key to get the same plan back instead of a duplicate. |
infraone operator plan show <plan-id>
Prints the plan's status, root, revision, budgets, and spend estimate, then every step in tree order with its key, executor, state, and status, followed by the edges between steps and each step's wait conditions. A step's status is ready, held (edited since the release), not in revision (added after it), waiting (on a wait condition), container, done, cancelled, archived, or -. Each gate shows its key and owner, and a Waiting for section lists the open gates each step waits for, with the gate's owner and the people who can tick it, or nobody can tick.
infraone operator plan edit <plan-id> --file <path>
Changes step executors and keys, naming each step by its step key or issue identifier, and the budgets retry_budget and spend_budget_cents. Editing a released step holds it until the plan is released again. A budget change needs the plan held first.
infraone operator plan release <plan-id>
Releases the plan as you: it freezes the next revision and lets ready steps run.
| Option | Meaning |
|---|---|
--collaborator <id-or-email> | A person of the organization for the plan room where its Operator steps run. Repeatable, up to 20. |
--retry-budget <n> | Retries per failed Operator step. |
--spend-budget-cents <n> | The plan's spend budget, in cents. A plan with Operator steps needs one to be released. |
infraone operator plan hold <plan-id>
Pauses every step until the plan is released again.
infraone operator gate satisfy <issue> <gate> and infraone operator gate unsatisfy <issue> <gate>
Ticks or unticks a gate wait condition. <gate> is the gate's key, its label, or its condition identifier, all shown by infraone operator conditions. None outranks the others: when <gate> exactly matches more than one gate, the command refuses and lists each one's identifier, key, and label, and you pass the identifier of the one you mean. Only when nothing matches exactly does a key or label match ignoring case, and that is refused too when more than one gate matches. After a tick, the output says whether other wait conditions still hold the issue.
Only an owned gate's owner can tick it, and only its owner or tracker staff can untick it. Anyone else gets 403 not_gate_owner, with an error that names the gate's owner.
infraone operator conditions <issue>
Lists an issue's wait conditions, oldest first: each one's box, what it waits for (a gate's label, key, and owner), when and by whom it was satisfied, and its identifier.
infraone operator assignments
For an outside expert invited to a plan and signed in with their expert credential: lists the plan steps assigned to them that they still hold, with each step's state, due date, open blockers, and the gates they own on it. An expert credential reaches only assignments, and conditions and gate satisfy or gate unsatisfy on the expert's own gates. Every other command that reads or changes data answers 403 expert_bound_credential; login, logout, whoami, and version keep working. Any other credential gets 403 expert_credential_required from assignments.
A server without the plan API answers the plan and gate commands with a 404, and the error says the server may predate plans.
Catalog
infraone operator tools
Lists the capabilities Operator can use now in your organization, in identifier order, 25 to a page: identifier, kind, domain, and summary. A capability that ships disabled or is switched off on the platform never appears.
| Option | Meaning |
|---|---|
--domain <domain> | Only this domain. |
--cursor <cursor> | Continue from the cursor named in the previous page's notice. |
--all | Follow every page, up to 200. |
infraone operator tools search <query>
Searches the capabilities Operator can use now by keyword, best match first, 15 to a page, with a score column. The query is at most 200 bytes. It takes --domain, --cursor, and --all.
infraone operator tools domains
Lists every domain that holds a capability Operator can use now, with how many. It takes no --domain, --cursor, or --all.
infraone operator tool <capability-id>
Shows one capability with its domain, kind, mode and effect, summary, approval rule, description, and whole input schema. --schema result shows a read's result schema instead; only a read has one. A capability that doesn't exist, ships disabled, or is switched off answers the same 404.
infraone operator skills
Lists the skills assigned to Operator in your organization: invocation name, title, the SHA-256 of the skill's content, and identifier. A skill's content and description are never returned.
Sign-in and housekeeping
| Command | What it does |
|---|---|
infraone operator login | Browser sign-in, for a full or an Operator-only login (see Access). --no-browser prints the URL and asks you to paste the token, --url <host> signs in to another host, and --timeout <ms> changes how long it waits for the browser (default 3 minutes). CLI 1.15.0 cannot store an Operator-only login: it checks the new login against the tracker, which refuses it. |
infraone operator logout | Revokes the stored login on the server and deletes it locally. It signs out infraone harness too. |
infraone operator whoami | Shows the host, where it came from, and the credential source, after verifying the credential against the tracker. In CLI 1.15.0 that check refuses an Operator-only login. |
infraone operator version | Shows the CLI and server API versions. It works before you sign in, and so does infraone operator --version. |
infraone operator mcp | Runs the MCP server over stdio. See MCP tools. |
infraone operator --help lists the Operator commands first, then the issue-tracker commands under "Issues:", then sign-in and housekeeping under "General:". This page covers the Operator commands only.
Exit codes
| Code | Meaning |
|---|---|
0 | Success. For watch, the job completed, or the reader of its output went away. |
1 | The command failed: an API error (the message gives the HTTP status and any per-field errors or plan violations), an answer whose content the CLI cannot use, a partial failure, or a local refusal. For the Operator writes, "Outcome unknown" means the request may have landed, including when the answer could not be read. |
2 | Usage or configuration error, including "not signed in" outside a terminal. Nothing was sent. |
3 | The API was unreachable, or answered with a body that is not JSON. For the Operator writes, exit 3 means the request never reached the server, so nothing changed. |
4 | watch only: a person has to act on the job. The link to act on is on stdout. |
5 | watch only: the job failed or was cancelled. |
130 | watch only: interrupted with Ctrl-C. stderr names the --after value to resume from. |
Refusals
The server's message comes first, followed by what it means.
| Status | Code | Meaning |
|---|---|---|
400 | bad_request | The request carried a field the server does not accept. Nothing changed; update the CLI. |
400 | invalid_cursor | The paging cursor is stale. Start the listing again. |
403 | forbidden | The credential lacks the scope the command needs, or you are a guest or outside the organization. With the message "This token may not access the Harness API", an Operator-only login was used on a plan, gate, or issue-tracker command. |
403 | actor_required | The credential acts as no person. |
403 | operator_not_permitted | You have no admin or member role in the organization the credential is bound to. |
403 | operator_disabled | Operator is switched off for the organization. |
403 | run_bound_credential | A credential bound to a single automated run cannot use Operator. Use a browser login. |
403 | principal_required | cancel, pause, and continue belong to the job's execution principal. The owner or a collaborator can still steer. |
403 | owner_required | procedure save: only the job's owner can save it. |
403 | not_gate_owner | gate satisfy or gate unsatisfy: only the gate's owner can tick it. The error names the owner. |
404 | not_found | The job or procedure does not exist, is in another organization, or is not shared with you. All three answer alike. |
409 | invalid_state | The app wouldn't offer the control now: Steer on a finished, failed, or awaiting-approval job, or one needing reconciliation; Cancel on a job that already ended; Pause on a job that isn't running; Continue with nothing to continue. |
409 | reconciliation_required | Partial effects need reconciling in the app first. |
409 | deliveries_unsettled | A delivery is still sending, or its outcome is unknown. If infraone operator job shows the job waiting on delivery, settle it in the app; an unknown delivery never settles by itself. Otherwise try again once it has sent. |
409 | principal_inactive | The job's execution principal no longer holds the rights to run it. Nothing changed. |
409 | cancellation_scope_changed | cancel: the job's work changed while it was being cancelled. It was not cancelled; read it and decide again. |
409 | version_conflict, concurrent_change | procedure run: the named version is no longer current, or the procedure changed as the run started. No job was started. |
422 | invalid_instruction, validation_error | steer: the instruction is blank or too long, or the job's room refused it. procedure save: the name holds control characters. |
422 | not_saveable | procedure save: the job isn't completed and verified, or has no work to repeat. |
422 | invalid_rerun | procedure run: the inputs don't fit the parameters, or your current rights don't cover the run. No job was started. |
503 | service_unavailable | procedure run: Operator's operational profile is unavailable. No job was started. |
MCP tools
infraone operator mcp serves 72 tools over stdio under the server name operator; infraone harness mcp serves the same tools under the name harness. Register one of the two, not both, or every tool appears twice. Each result is compact JSON of the response data. A notice the CLI would print on stderr, such as a paging notice, arrives as a second text item.
The server resolves the credential on every call, the way the CLI does, so a login completed while it runs takes effect without a restart. It never opens a browser: without a credential, a tool returns an error asking for a terminal login or an API token.
| Tool | Matches | Notes |
|---|---|---|
jobs_list | infraone operator jobs | status is a list of job states and aliases; mine, limit, all. |
job_show | infraone operator job | Also returns the requester, execution principal, participants, and approvers. |
job_changes | infraone operator job --changes | change_set is null while the job has proposed nothing. |
job_steer | infraone operator steer | instruction is plain text. Not idempotent. |
job_cancel | infraone operator cancel | Marked destructive. Not idempotent. |
job_pause | infraone operator pause | Not idempotent. |
job_continue | infraone operator continue | Not idempotent. |
procedure_save | infraone operator procedure save | job_id, name. Not idempotent. |
procedure_show | infraone operator procedure show | Read-only. |
procedure_run | infraone operator procedure run | parameters is an object, beside version, group_id, and source_resource_id. Not idempotent. |
plan_create | infraone operator plan create | Takes the plan as an object in plan, with team and idempotency_key beside it. |
plan_show | infraone operator plan show | Read-only. |
plan_edit | infraone operator plan edit | Takes steps, retry_budget, and spend_budget_cents directly. |
plan_release | infraone operator plan release | collaborators (up to 20), retry_budget, spend_budget_cents. |
plan_hold | infraone operator plan hold | |
gate_set | infraone operator gate satisfy and unsatisfy | issue, gate (a key, label, or condition identifier), and satisfied. |
condition_list | infraone operator conditions | Read-only. |
assignment_list | infraone operator assignments | Read-only. Outside experts' credentials only. |
tools_search | infraone operator tools and tools search | Without query it browses the index; domain, cursor, all. |
skills_list | infraone operator skills | Read-only. |
The other tools cover the issue tracker. The plan, gate, and condition tools need a full login, as their commands do. There is no MCP tool for watch, tool, tools domains, or job --people, and none for login, logout, whoami, or version. There is no tool that starts a new job yet; one is coming in a later release. To follow a job, poll job_show until state is completed, failed, or cancelled, or until waiting_on is set; then give a person the approval_url or the workbench link, because no tool approves anything.
Read-only tools carry readOnlyHint. The job controls, job_continue, procedure_save, and procedure_run carry idempotentHint: false. When one of them fails with an error that says the outcome is unknown, read the job with job_show before calling it again. Only an error that says "cannot reach the API" means the request never reached the server.
Configuration
| Variable or file | Effect |
|---|---|
HARNESS_API_TOKEN | An aone_ API token. It takes precedence over the stored login. For headless use only. |
HARNESS_API_URL | The target host. HTTPS, or HTTP against localhost only. |
HARNESS_TEAM | The default team for plan create. |
HARNESS_ACTOR | Write attribution for headless use. Never set it in an interactive session. |
~/.config/harness/credentials.json | The stored login, shared by infraone operator and infraone harness, mode 0600. |
Both commands read the same HARNESS_* variables, files, and repository configuration. A global install upgrades itself when the server refuses an outdated CLI with HTTP 426, then re-runs the command; npx runs, project-local installs, CI, and infraone operator mcp never upgrade themselves.