Skip to content

CLI Commands

CommandDescription
mvmctl up --flake <ref>Build and run a VM from a Nix flake (aliases: run, start)
mvmctl up --template <name>Run from a pre-built template (skip build)
mvmctl up --name <name>Specify VM name (auto-generated if omitted)
mvmctl up --profile <variant>Flake package variant (e.g. worker, gateway)
mvmctl up --cpus N --memory SIZEOverride vCPU count and memory (supports 512M, 4G, etc.)
mvmctl up -p HOST:GUESTForward a port mapping into the VM (repeatable)
mvmctl up -e KEY=VALUEInject an environment variable (repeatable)
mvmctl up -v host:guest:sizeMount a volume into the VM (repeatable)
mvmctl up -dRun in background (detached mode, via launchd)
mvmctl up --forwardAuto-forward declared ports after boot (blocks until Ctrl-C)
mvmctl up --hypervisor <backend>Force backend: firecracker, apple-container, docker, or qemu
mvmctl up --config <path>Runtime config (TOML) for persistent resources/volumes
mvmctl up --metrics-port PORTBind a Prometheus metrics endpoint (0 = disabled)
mvmctl up --watch-configReload ~/.mvm/config.toml automatically when it changes
mvmctl up --watchWatch flake for changes and auto-rebuild + reboot
mvmctl up --network-preset <preset>Network egress policy: unrestricted (default), none, registries, dev
mvmctl up --network-allow host:portAllow egress to specific host:port (repeatable, mutually exclusive with preset)
mvmctl up --seccomp <tier>Seccomp profile: essential, minimal, standard, network, unrestricted (default)
mvmctl up --secret KEY:hostBind a secret to a domain (repeatable; see Config & Secrets)
mvmctl up --network <name>Named dev network to attach VM to (default: “default”)
mvmctl down [name]Stop VMs by name, or all if omitted
mvmctl down -f <config>Stop only VMs defined in specified config
mvmctl lsList running VMs (aliases: ps, status)
mvmctl ls -aShow all VMs including stopped
mvmctl ls --jsonOutput as JSON
mvmctl forward <name> -p PORTForward a port from a running VM to localhost
mvmctl logs <name>View guest console logs (-f to follow, -n for line count)
mvmctl logs <name> --hypervisorView Firecracker hypervisor logs
mvmctl diff <name>Show filesystem changes in a running VM (created/modified/deleted since boot)
mvmctl diff <name> --jsonOutput filesystem diff as JSON
CommandDescription
mvmctl bootstrapFull setup from scratch: Homebrew deps (macOS), Lima, Firecracker, kernel, rootfs
mvmctl bootstrap --productionProduction mode (skip Homebrew, assume Linux with apt)
mvmctl setupCreate Lima VM and install Firecracker assets (requires limactl)
mvmctl setup --recreateStop microVM, rebuild rootfs from upstream squashfs
mvmctl setup --forceRe-run all setup steps even if already complete
mvmctl setup --lima-cpus N --lima-mem NConfigure Lima VM resources (defaults: 8 CPUs, 16 GiB)
mvmctl dev [up]Auto-bootstrap if needed, start dev VM, drop into shell. Uses Apple Container on macOS 26+, Lima otherwise.
mvmctl dev up --project ~/dirAuto-bootstrap then cd into a project directory
mvmctl dev up --metrics-port PORTBind a Prometheus metrics endpoint (0 = disabled)
mvmctl dev up --watch-configReload ~/.mvm/config.toml automatically when it changes
mvmctl dev up --limaForce Lima backend even on macOS 26+
mvmctl dev downStop the Lima development VM
mvmctl dev shellOpen a shell in the running Lima VM
mvmctl dev shell --project ~/dirOpen shell and cd into a project directory
mvmctl dev statusShow dev environment status (Lima VM, Firecracker, Nix versions)
mvmctl doctorRun system diagnostics and dependency checks
mvmctl doctor --jsonOutput diagnostics as JSON
mvmctl updateCheck for and install mvmctl updates
mvmctl update --checkOnly check for updates, don’t install
mvmctl update --forceForce reinstall even if already up to date
mvmctl update --skip-verifySkip cosign signature verification
CommandDescription
mvmctl build <path>Build from Mvmfile.toml in the given directory
mvmctl build --flake <ref>Build from a Nix flake (local or remote)
mvmctl build --flake <ref> --profile <variant>Build a specific flake package variant
mvmctl build --flake <ref> --watchBuild and rebuild on flake.lock changes
mvmctl build --jsonOutput structured JSON events instead of human-readable output
mvmctl build -o <path>Output path for the built .elf image
mvmctl cleanupRemove old dev-build artifacts and run Nix garbage collection
mvmctl cleanup --allRemove all cached build revisions
mvmctl cleanup --keep <N>Keep the N newest build revisions
mvmctl cleanup --verbosePrint each cached build path that gets removed
CommandDescription
mvmctl template init <name> --localScaffold a new template directory with flake.nix
mvmctl template init <name> --vmScaffold inside the Lima VM (overrides —local)
mvmctl template init <name> --preset <preset>Scaffold preset: minimal, http, postgres, worker, python (default: minimal)
mvmctl template init <name> --dir <path>Base directory for local init (default: current dir)
mvmctl template create <name>Create a single template definition
mvmctl template create <name> --data-disk SIZECreate template with a data disk (10G, 512M, or plain MB; 0 = none)
mvmctl template create-multi <base>Create templates for multiple roles (--roles worker,gateway)
mvmctl template build <name>Build a template (runs nix build in Lima)
mvmctl template build <name> --forceRebuild even if cached
mvmctl template build <name> --snapshotBuild, boot, wait for healthy, and capture a Firecracker snapshot
mvmctl template build <name> --update-hashRecompute the Nix fixed-output derivation hash
mvmctl template build <name> --config <toml>Build multiple variants from a template config TOML
mvmctl template push <name>Push to S3-compatible registry
mvmctl template push <name> --revision <hash>Push a specific revision
mvmctl template pull <name>Pull from registry
mvmctl template pull <name> --revision <hash>Pull a specific revision
mvmctl template verify <name>Verify template checksums
mvmctl template verify <name> --revision <hash>Verify a specific revision
mvmctl template listList all templates (--json for JSON)
mvmctl template info <name>Show template details, current revision, artifact sizes, and snapshot status (--json for JSON)
mvmctl template edit <name>Edit template configuration (—cpus, —mem, —flake, —profile, —role, —data-disk)
mvmctl template delete <name>Delete a template (--force to skip confirmation)
CommandDescription
mvmctl config showPrint current config as TOML
mvmctl config editOpen the config file in $EDITOR (falls back to nano)
mvmctl config set <key> <value>Set a single config key (e.g. mvmctl config set lima_cpus 4)
CommandDescription
mvmctl audit tailShow the last 20 audit events from /var/log/mvm/audit.jsonl
mvmctl audit tail -n <N>Show the last N audit events
mvmctl audit tail -fFollow audit log output (poll until Ctrl-C)
CommandDescription
mvmctl flake checkValidate a Nix flake before building (current directory)
mvmctl flake check --flake <ref>Validate a specific flake path or reference
mvmctl flake check --jsonOutput structured JSON instead of human-readable output
CommandDescription
mvmctl network create <name>Create a named dev network with its own bridge and subnet
mvmctl network listList all dev networks (alias: ls)
mvmctl network inspect <name>Show details of a named network (JSON)
mvmctl network remove <name>Remove a named network (alias: rm)
CommandDescription
mvmctl image listList available images in the bundled catalog (alias: ls)
mvmctl image search <query>Search images by name, description, or tag
mvmctl image fetch <name>Build an image from the catalog (creates template + runs Nix build)
mvmctl image info <name>Show catalog entry details (JSON)
CommandDescription
mvmctl console <name>Interactive PTY shell into a running VM (vsock, no SSH)
mvmctl console <name> --command <cmd>Run a one-shot command in the VM
CommandDescription
mvmctl cache infoShow cache directory path and disk usage
mvmctl cache pruneRemove stale temp files from the cache
mvmctl cache prune --dry-runShow what would be removed without deleting
CommandDescription
mvmctl security statusShow security posture evaluation (vsock auth, seccomp, no-SSH, etc.)
mvmctl security status --jsonOutput posture report as JSON
CommandDescription
mvmctl initFirst-time setup wizard (deps, Lima VM, default network, XDG dirs)
mvmctl init --non-interactiveRun setup with defaults, no prompts
mvmctl init --lima-cpus N --lima-mem NConfigure Lima VM resources
CommandDescription
mvmctl completions <shell>Generate shell completions (bash, zsh, fish, powershell)
mvmctl shell-initPrint shell configuration (completions + dev aliases) to stdout
mvmctl metricsShow runtime metrics (Prometheus text format)
mvmctl metrics --jsonShow runtime metrics as JSON
mvmctl uninstallRemove Lima VM, Firecracker, and all mvm state (confirmation required)
mvmctl uninstall -yUninstall without confirmation
mvmctl uninstall --allAlso remove ~/.mvm/ config dir and /usr/local/bin/mvmctl binary
mvmctl uninstall --dry-runPrint what would be removed without removing

All commands accept these global options:

OptionDescription
--log-format <human|json>Log format: human (default) or json (structured)
--fc-version <VERSION>Override Firecracker version (e.g., v1.14.0)
VariableDescriptionDefault
MVM_DATA_DIRRoot data directory for templates and builds~/.mvm
MVM_FC_VERSIONFirecracker version (auto-normalized to vMAJOR.MINOR)Latest stable
MVM_FC_ASSET_BASES3 base URL for Firecracker assetsAWS default
MVM_FC_ASSET_ROOTFSOverride rootfs filenameAuto-detected
MVM_FC_ASSET_KERNELOverride kernel filenameAuto-detected
MVM_BUILDER_MODEBuilder transport: auto, vsock, or sshauto
MVM_TEMPLATE_REGISTRY_ENDPOINTS3-compatible endpoint URL for template push/pullNone
MVM_TEMPLATE_REGISTRY_BUCKETS3 bucket name for templatesNone
MVM_TEMPLATE_REGISTRY_ACCESS_KEY_IDS3 access key IDNone
MVM_TEMPLATE_REGISTRY_SECRET_ACCESS_KEYS3 secret access keyNone
MVM_TEMPLATE_REGISTRY_PREFIXKey prefix inside the bucketmvm
MVM_TEMPLATE_REGISTRY_REGIONS3 regionus-east-1
MVM_SSH_PORTLima SSH local port60022
MVM_PRODUCTIONEnable production mode checksfalse
RUST_LOGLogging level (e.g., debug, mvm=trace)info