Skip to content

CLI

The microvm CLI provides the following subcommands (crates/microvms-cli/Cargo.toml:21-23).

Use --name for a VM registered locally. To transfer a record from another machine, pipe it into microvm attach --from -, then use its registered name. Attached commands also accept --agent-token-file <FILE|->. The attach and tunnel commands accept --identity-host-seed-file <FILE|-> for the host seed.

The credential file flags read a regular file or stdin with -, remove trailing line endings, and refuse an empty value. The group and other permission bits must be clear on Unix. Only one input may read stdin, including exec --stdin and stdin --data -. Literal secret flags remain supported and print a warning recommending these input paths.

microvm run [OPTIONS] [BINARY_OR_DIR]

Build an image, launch a VM, run a command, report the cost, tear it down.

crates/microvms-cli/src/commands/lifecycle.rs:437

Flags:

microvm quickstart [OPTIONS]

Zero to a live exec: provision the daemon, build, launch, run, report, tear down.

crates/microvms-cli/src/commands/lifecycle.rs:962

Flags:

microvm build [OPTIONS] [BINARY]

Build a MicroVM image and wait for it to be usable.

crates/microvms-cli/src/commands/lifecycle.rs:1436

Flags:

microvm agent-up [OPTIONS] --vm-name <NAME> [BINARY]

Bring up a VM with a coding agent in it: image, launch, model credentials, non-root user.

crates/microvms-cli/src/commands/agent.rs:237

Flags:

microvm agent-prompt [OPTIONS] <TASK>

Hand a coding agent in a running agent VM one task, headless, as the non-root user.

crates/microvms-cli/src/commands/agent.rs:766

Flags:

microvm exec [OPTIONS] [COMMAND]

Run one command in a MicroVM that is already running.

crates/microvms-cli/src/commands/attached.rs:245

Flags:

microvm wait [OPTIONS]

Wait until a kept MicroVM answers: RUNNING, and then its daemon.

crates/microvms-cli/src/commands/lifecycle.rs:2184

Flags:

microvm health [OPTIONS]

Ask a running MicroVM’s daemon whether it is up, and what its identity repair did.

crates/microvms-cli/src/commands/attached.rs:947

Flags:

microvm keepalive [OPTIONS]

Keep a running MicroVM awake while work runs inside it, by polling its health.

crates/microvms-cli/src/commands/attached.rs:838

Flags:

microvm ack [OPTIONS] <EXEC_ID>

Release a finished exec’s buffered output, which starts its collection clock.

crates/microvms-cli/src/commands/attached.rs:1152

Flags:

microvm kill [OPTIONS] <EXEC_ID>

Stop a running exec: SIGTERM its whole process group, SIGKILL after the daemon’s grace.

crates/microvms-cli/src/commands/attached.rs:1193

Flags:

microvm ps [OPTIONS]

List what is running in a MicroVM: every exec’s process group and its live pids.

crates/microvms-cli/src/commands/attached.rs:1245

Flags:

microvm stdin [OPTIONS] <EXEC_ID>

Write to a running exec’s stdin, and optionally close it.

crates/microvms-cli/src/commands/attached.rs:1336

Flags:

microvm cp [OPTIONS] <SRC> <DST>

Copy a file or a tar archive between here and a running MicroVM.

crates/microvms-cli/src/commands/attached.rs:1502

Flags:

microvm exists [OPTIONS] <PATH>

Say whether a path exists in a running MicroVM.

crates/microvms-cli/src/commands/attached.rs:1654

Flags:

microvm sync [OPTIONS] <DIR>

Sync a project directory into a running MicroVM’s /workspace, uploading only what changed.

crates/microvms-cli/src/commands/attached.rs:1813

Flags:

microvm attach --from <FILE|-> [--name <NEW_NAME>] [--verify-identity]
microvm attach --name <NAME> --microvm-id <ID> --endpoint <URL> --agent-token-file <FILE|-> [--identity-host-seed-file <FILE|-> --identity-vm-public-key <BASE64>] [--verify-identity]

Register a name for a running MicroVM this state directory did not launch.

crates/microvms-cli/src/commands/attached.rs:2002

Flags:

microvm adopt [OPTIONS]

Adopt a MicroVM this invocation didn’t launch, through core’s lifecycle guards, and report what they read.

crates/microvms-cli/src/commands/attached.rs:126

Flags:

microvm tunnel [OPTIONS] <LOCAL[:GUEST]>

Tunnel arbitrary TCP to a guest port, so psql or ssh here reaches a server in the VM.

crates/microvms-cli/src/commands/attached.rs:2494

Flags:

microvm port-forward [OPTIONS] <LOCAL[:GUEST]>

Serve a guest port on localhost, so a browser here reaches a server in the VM.

crates/microvms-cli/src/commands/attached.rs:2348

Flags:

microvm shell [OPTIONS]

Open an interactive root shell in a running MicroVM, a real PTY, with job control, signals, and resize.

crates/microvms-cli/src/commands/attached.rs:2782

Flags:

microvm suspend [OPTIONS] <MICROVM_ID>

Freeze a MicroVM.

crates/microvms-cli/src/commands/lifecycle.rs:2027

Flags:

microvm resume [OPTIONS] <MICROVM_ID>

Thaw a suspended MicroVM and report its endpoint.

crates/microvms-cli/src/commands/lifecycle.rs:2108

Flags:

microvm terminate [OPTIONS] <MICROVM_ID>

Tear down a MicroVM, and optionally its image and build log group.

crates/microvms-cli/src/commands/lifecycle.rs:2229

Flags:

microvm ls [OPTIONS]

List what this CLI created and could not confirm it deleted; --remote asks the account too.

crates/microvms-cli/src/commands/local.rs:52

Flags:

microvm history [OPTIONS] <VM_ID>

Print what was asked of one MicroVM and what the platform reported back.

crates/microvms-cli/src/commands/local.rs:549

Flags:

microvm names [OPTIONS]

List the names this machine’s registry holds, or delete one whose VM is gone.

crates/microvms-cli/src/commands/local.rs:635

Flags:

microvm logs [OPTIONS] <IMAGE_NAME>

Name an image’s build log group and print the aws logs tail command that reads it.

crates/microvms-cli/src/commands/local.rs:780

Flags:

microvm image-versions [OPTIONS] <IMAGE>

List an image’s versions: each one’s build state, whether RunMicrovm launches it, and what it was built with.

crates/microvms-cli/src/commands/image.rs:18

Flags:

microvm image-set-status [OPTIONS] <IMAGE> <VERSION> <STATUS>

Retire an image version (INACTIVE) or restore it (ACTIVE), and read the change back.

crates/microvms-cli/src/commands/image.rs:50

Flags:

microvm image-builds [OPTIONS] <IMAGE> <VERSION>

List an image version’s builds, one per Graviton generation, or read one with --build-id.

crates/microvms-cli/src/commands/image.rs:83

Flags:

microvm cost [OPTIONS]

Estimate the cost of a run or a plan.

crates/microvms-cli/src/commands/cost.rs:29

Flags:

microvm egress-posture [OPTIONS]

The egress posture run with these options would report, without launching.

crates/microvms-cli/src/commands/local.rs:864

Flags:

microvm doctor [OPTIONS]

Check every prerequisite and say which one is wrong.

crates/microvms-cli/src/commands/doctor.rs:33

Flags:

microvm manifest [OPTIONS]

Emit the whole command surface, its exit codes, and its envelope schema.

crates/microvms-cli/src/commands/local.rs:933

Flags:

microvm constants [OPTIONS]

Emit every service constraint this client believes, for the drift gate.

crates/microvms-cli/src/commands/local.rs:956

Flags:

microvm dockerfile [OPTIONS]

Print the Dockerfile stanza that wraps any base image with agentd.

crates/microvms-cli/src/commands/local.rs:994

Flags:

These pages cite many of the same source files as this one.