API

CLI Reference

Complete reference for all vmsan commands and flags

Global flags

FlagDescription
--jsonOutput structured JSON
--verboseShow detailed debug output

Commands

vmsan create

Create and start a new microVM.

FlagTypeDefaultDescription
--vcpusstring1Number of vCPUs
--memorystring128Memory in MiB
--runtimestringbaseRuntime label (base, node22, python3.13)
--diskstring10gbRoot disk size
--from-imagestringBuild rootfs from a Docker/OCI image
--kernelstringPath to kernel image (auto-detected if omitted)
--rootfsstringPath to rootfs image (auto-detected if omitted)
--timeoutstringAuto-shutdown timeout (e.g. 1h, 30m, 2h30m)
--projectstringProject label for grouping VMs
--snapshotstringSnapshot ID to restore from
--publish-portstringPorts to forward (comma-separated)
--network-policystringallow-allNetwork mode: allow-all, deny-all, custom
--allowed-domainstringAllowed domains (comma-separated, wildcard *)
--allowed-cidrstringAllowed CIDR ranges (comma-separated)
--denied-cidrstringDenied CIDR ranges (comma-separated)
--bandwidthstringMax bandwidth (e.g. 50mbit)
--no-seccompbooleanfalseDisable seccomp-bpf filter
--no-pid-nsbooleanfalseDisable PID namespace isolation
--no-cgroupbooleanfalseDisable cgroup resource limits
--no-netnsbooleanfalseDisable per-VM network namespace
--connectbooleanfalseAuto-connect to shell after creation
--silentbooleanfalseSuppress all output

vmsan list

List all VMs. Alias: ls.

vmsan start

Start a stopped VM.

ArgumentRequiredDescription
vm-idyesThe VM to start

vmsan stop

Stop a running VM.

ArgumentRequiredDescription
vm-idyesThe VM to stop

vmsan remove

Remove a VM and its chroot directory. Alias: rm.

ArgumentRequiredDescription
vm-idyesThe VM to remove

vmsan connect

Open an interactive shell to a running VM.

ArgumentRequiredDescription
vm-idyesThe VM to connect to

vmsan upload

Upload a file to a running VM.

ArgumentRequiredDescription
vm-idyesTarget VM
local-pathyesLocal file path
remote-pathyesDestination path inside the VM

vmsan download

Download a file from a running VM.

ArgumentRequiredDescription
vm-idyesSource VM
remote-pathyesFile path inside the VM
local-pathyesLocal destination path

vmsan network

Update the network policy on a running VM.

ArgumentRequiredDescription
vm-idyesThe VM to update
FlagTypeRequiredDescription
--network-policystringyesNetwork mode: allow-all, deny-all, custom
--allowed-domainstringnoAllowed domains (comma-separated)
--allowed-cidrstringnoAllowed CIDR ranges (comma-separated)
--denied-cidrstringnoDenied CIDR ranges (comma-separated)

Programmatic API

vmsan also exports a TypeScript API for programmatic use:

example.ts
import { VMService, vmsanPaths, FirecrackerClient } from "vmsan";

const paths = vmsanPaths();
const service = new VMService(paths);

Key exports include VMService, FirecrackerClient, AgentClient, NetworkManager, Jailer, and ShellSession.

Copyright © 2026