CLI Commands
Use snapvm --help or snapvm help <command> in your terminal for the most current help output.
Global options
Section titled “Global options”These options can be used before a command:
| Option | Environment variable | Purpose |
| --- | --- | --- |
| --api-url <url> | SNAPVM_API_URL | Use a custom SnapVM API URL when your administrator provides one. |
| --org <slug>, -o <slug> | SNAPVM_ORG | Choose the organization for the command. |
| --machine <name-or-id>, -m <name-or-id> | SNAPVM_MACHINE | Choose the machine for the command. |
Example:
snapvm --org my-team --machine frontend-lab consoleAuthentication
Section titled “Authentication”snapvm login
Section titled “snapvm login”Sign in through the browser:
snapvm loginUse --web-url only when your workspace administrator gives you a custom SnapVM web URL.
snapvm logout
Section titled “snapvm logout”Remove stored CLI credentials:
snapvm logoutUpdates
Section titled “Updates”snapvm update
Section titled “snapvm update”Update the installed CLI:
snapvm updateMachines
Section titled “Machines”snapvm list
Section titled “snapvm list”List machines:
snapvm listOptions:
--output table|jsonchanges the output format.--alllists machines owned by all users when your role allows it.--user-id me|all|user_xxxfilters by owner.
snapvm create
Section titled “snapvm create”Create a machine:
snapvm create --name frontend-labOptions:
--name <name>sets the machine name.--launch-type sprites|externalchooses the launch type exposed by your deployment.--package <npm-package>installs an npm package during initial setup. Repeat the flag to install more than one package.--package-manager bun|npmchooses the package manager for--package.--output summary|jsonchanges the output format.
Example:
snapvm create --name automation-lab --package typescript --package-manager npmsnapvm destroy
Section titled “snapvm destroy”Permanently delete a machine:
snapvm destroy frontend-labDeletion is permanent. Move important files, repositories, generated data, and local databases elsewhere before destroying a machine.
Local context
Section titled “Local context”snapvm use
Section titled “snapvm use”Activate a machine for the current directory:
snapvm use frontend-labAfter this, commands such as snapvm exec and snapvm console use that machine when run from the same directory.
Remove the local context:
snapvm use --unsetCommand execution
Section titled “Command execution”snapvm exec
Section titled “snapvm exec”Run a command inside the selected machine:
snapvm exec pwdsnapvm exec --dir ~/projects/app npm testAlias:
snapvm x pwdOptions:
--dir <path>sets the working directory.--env KEY=valuepasses environment variables. Repeat the flag for multiple values.--stdinforwards standard input.--ttyallocates an interactive terminal.
snapvm console
Section titled “snapvm console”Open an interactive shell in the selected machine:
snapvm consoleAlias:
snapvm cCheckpoints
Section titled “Checkpoints”snapvm checkpoint create
Section titled “snapvm checkpoint create”Create a checkpoint:
snapvm checkpoint create --comment "before dependency upgrade"snapvm checkpoint list
Section titled “snapvm checkpoint list”List checkpoints:
snapvm checkpoint listsnapvm checkpoint list --output jsonsnapvm checkpoint info
Section titled “snapvm checkpoint info”Show checkpoint details:
snapvm checkpoint info <version-id>snapvm checkpoint delete
Section titled “snapvm checkpoint delete”Delete a checkpoint:
snapvm checkpoint delete <version-id>snapvm restore
Section titled “snapvm restore”Restore from a checkpoint:
snapvm restore <version-id>Restoring changes the machine back to the selected checkpoint. Save or move any work you need to keep before restoring.
Deprecated commands
Section titled “Deprecated commands”snapvm machines remains available for older workflows, but new usage should prefer the top-level commands:
snapvm listsnapvm create --name frontend-labsnapvm destroy frontend-lab