microvm agent-prompt
1. Synopsis
Section titled “1. Synopsis”Hand a coding agent in a running agent VM one task, headless, as the non-root user
microvm agent-prompt <task> [options]2. Parameters
Section titled “2. Parameters”| Parameter | Kind | Type | Required | Default | Choices | Help |
|---|---|---|---|---|---|---|
task |
positional | string |
yes | none | any | The task, as prose. Passed to the agent’s headless command single-quoted for sh |
--agent |
flag | enum |
no | none | claude-code, codex |
Which installed agent to prompt. Omitted reads the guest marker and takes the one it names |
--timeout |
flag | string |
no | 900 |
any | How long to wait for the agent, in seconds. Agent tasks run minutes, not seconds |
--detach |
flag | boolean |
no | none | any | Start the agent and return immediately, without waiting and without acking |
--exec-id |
flag | string |
no | none | any | Use this exec id instead of a fresh one, making a retry idempotent |
--endpoint |
flag | string |
no | none | any | The VM’s endpoint, as reported by run |
--agent-token |
flag | string |
no | none | any | The agent token delivered to the VM at launch |
--microvm-id |
flag | string |
no | none | any | The MicroVM id, needed to mint the endpoint proxy token |
--name |
flag | string |
no | none | any | The name run --keep --vm-name registered, standing in for the whole triple |
--port |
flag | string |
no | none | any | The daemon’s port inside the guest |
--state-dir |
flag | path |
no | none | any | Where the local state lives — the name registry, and exec’s per-VM history. Defaults to $MICROVM_STATE_DIR or ~/.microvm/runs |
--region |
flag | enum |
no | none | us-east-1, us-east-2, us-west-2, eu-west-1, ap-northeast-1 |
AWS region. Defaults to $AWS_REGION, then $AWS_DEFAULT_REGION, then us-east-1 |
--unlisted-region |
flag | string |
no | none | any | Use a region this client has not seen carry MicroVMs. Costs you the diagnostic |
The 3 global flags (--json, --dense, --quiet) are accepted here as on every command, and are left out of the table above for that reason; see Global flags.
3. Response
Section titled “3. Response”On success stdout carries one envelope whose type is microvm.agent.prompt. Its data object carries these keys: execId, agent, model, phase, exitCode, stdout, stderr, truncated.
The envelope describes the fields around data. Response types lists every type the CLI emits and which commands share each one.
4. Failures
Section titled “4. Failures”A failure exits with one of the statuses on Exit codes and writes the error shape on The envelope: a stable code to branch on, an exitCode that matches the process status, a human-readable error, and suggestions.
Where a failure is one this project has measured on the platform, the envelope’s finding names the section of the platform notes that documents it. The exit-code table links each one.
5. Provenance
Section titled “5. Provenance”This page is generated from docs/manifest.json, the output of microvm manifest, which the CLI derives from its own argument tree. This page reads the agent-prompt entry of data.commands. site/scripts/gen-reference.mjs writes it into the site’s content directory on every pnpm run sync, so an edit made here is overwritten by the next run.
To change the page, change the source. Regenerate the source with mise run manifest from the repository root; mise run manifest:check fails when the committed file no longer matches what the binary emits.