Skip to content

CLI reference

Run Capsem commands on your computer. Commands accept a VM name or immutable ID where VM appears below; commands explicitly taking NAME require a persistent VM name. Use capsem COMMAND --help for that installed version’s complete option help.

Create and access

CommandContract
capsem create [OPTIONS] --image IMAGE [CMD…]Create a detached VM. Naming it makes it persistent.
capsem shell [VM]Open the TUI; optionally focus one VM. Creates and deletes nothing. -n NAME also selects a name.
capsem exec VM COMMAND [--timeout SECONDS] [--target workload|vm]Execute a shell command. Image VMs default to their workload; otherwise the VM. Returns the command’s exit code.
capsem run [OPTIONS] --image IMAGE [CMD…]Run the image’s workload in a new temporary VM; remove the VM afterward.
capsem run 'COMMAND'Run a shell command in a new temporary VM; remove the VM afterward.

Put options before --image: everything after its image reference is the workload command, including values beginning with --.

Create/run optionMeaning / default
-n, --name NAMECreate only: persistent VM name. Omitted: temporary VM.
--cpu NCPU cores; default 4.
--ram NMemory in GiB; default 12.
-e, --env KEY=VALUERepeatable. Container environment with an image; VM environment without one.
--network NAMERepeatable named private network. Shell-only capsem run does not support it.
--from NAMECreate only: clone a persistent VM; optionally select a new image.
--timeout SECONDSRun only: maximum workload duration.
-p, --publish HOST:GUESTPublish a loopback port over vsock; host port 0 selects a free port. Requires an image.
--registry-user USERRegistry username; password/token comes from CAPSEM_REGISTRY_PASSWORD.
--registry-ca PATHAdditional PEM CA trusted for that registry pull only.

Image references are catalog names from capsem images, docker://IMAGE for Docker Hub, or registry-qualified references. Admission policy still applies. See Build your own image.

Retain and remove

CommandEffect
capsem suspend VMSave running state and release CPU/RAM; persistent VMs only.
capsem resume NAMEResume saved state, start a retained VM, or attach to one already running. Alias: capsem attach.
capsem restart NAMEReboot a persistent VM.
capsem fork VM NAME [-d DESCRIPTION]Copy files/setup into another persistent VM; does not copy running programs.
capsem persist VM NAMEGive a running temporary VM a persistent name.
capsem delete VMDelete the VM and its retained state. Alias: capsem rm.
capsem purge [--all]Remove temporary VMs; --all includes persistent VMs and requires confirmation.

capsem stop stops the background service; it is not a per-VM stop command. Use the UI or SDK’s VM stop operation when you want a retained VM shut down.

Inspect and transfer

CommandOptions / behavior
capsem list-q, --quiet: IDs only. Alias: capsem ls.
capsem info VM--json: typed VM information.
capsem logs VMSerial and process logs; --tail N.
capsem history VM--tail N defaults to 500; --all, --search TEXT, --layer all|exec|audit, --json.
capsem cp SRC DSTExactly one side is VM:PATH; the other is a local path. Download to - for stdout.
capsem imagesImage catalog. capsem images --help lists prefetch options.
capsem assets status [--json]Runtime asset readiness.
capsem assets ensure [--json]Repair missing/corrupt runtime assets.

File transfer requires a running VM’s security ledger. Relative paths select its workspace; exact guest path handling is specified by the file API.

Private networks

CommandEffect
capsem network create NAMECreate a named network.
capsem network listList networks.
capsem network inspect NETWORKIdentity and members.
capsem network connect VM NETWORKAttach a VM.
capsem network disconnect VM NETWORKDetach a VM.
capsem network delete NETWORKRetire an empty network.
capsem network logs NETWORKAudit records; -f, --limit, --vm, --type, --decision.

Member traffic uses any protocol and bypasses HTTP inspection. See network connections.

MCP and standalone proxy

capsem mcp servers lists configured servers; capsem mcp tools [--server NAME] lists tools; capsem mcp refresh rediscovers tools. capsem mcp call SERVER__TOOL --args '{}' sends JSON arguments through policy. See the MCP reference.

capsem proxy --help describes the VM-free OpenAI-compatible endpoint and its provider selection. It processes only requests sent to that endpoint.

Service and updates

CommandEffect
capsem statusService and asset readiness.
capsem start / capsem stopStart/stop the background service.
capsem installRegister the service. The native package installer normally does this.
capsem versionInstalled version and build information.
capsem update --checkRefresh update status without applying changes.
capsem update --yes [--channel stable|nightly]Apply the complete installed package/runtime update.
capsem update --corp URLProvision corporate configuration; cannot combine with --assets.
capsem update --assets [--manifest URL]Diagnostic runtime-asset repair or corporate asset selection.
capsem uninstallRemove service, binaries, and data; requires confirmation unless --yes.

Manifest/corp inputs are URLs. Local files require file:///absolute/path. Corporate channel selection is locked; see Manifest reference.

Diagnostics

capsem doctor [--bundle] runs diagnostics in a fresh VM. capsem debug (alias of capsem support-bundle) writes a redacted support archive. Options include --output, --sessions (default 3, maximum 10), --max-session-bytes (default 50 MiB), and --include-rootfs. --no-redact disables redaction.

capsem completions bash|zsh|fish|powershell prints shell completions.