Skip to main content

vers execute

Execute a command within the Vers environment on the specified VM.
Commands must be wrapped in quotes! Use vers execute "command" not vers execute command

Usage

Options

Examples

Execute on HEAD VM

Execute on specific VM

Commands with pipes and redirections

Development and testing

How it works

The execute command provides a way to run single commands on VMs without opening an interactive SSH session:
  1. VM detection: If no VM is specified, uses the current HEAD VM
  2. SSH connection: Establishes a secure connection using managed SSH keys
  3. Command execution: Runs the command as root inside the VM
  4. Output streaming: Returns stdout/stderr directly to your terminal
  5. Exit code preservation: Maintains the original command’s exit status

Argument handling

The command intelligently handles VM identification:
  • One argument: Treats as command, runs on HEAD VM
  • Two+ arguments: First argument attempted as VM identifier
    • If valid VM: runs command on that VM
    • If invalid VM: treats all arguments as command, runs on HEAD VM

Prerequisites

  • VM must be in “Running” state
  • VM must have SSH port configured
  • Valid authentication (handled automatically)

Common Patterns

Run a script on boot

Pipe stdin into a remote command

Fan-out across a fleet

Healthcheck

See Also