Documentation Index
Fetch the complete documentation index at: https://docs.vers.sh/llms.txt
Use this file to discover all available pages before exploring further.
vers execute
Execute a command within the Vers environment on the specified VM.Usage
Options
| Option | Description |
|---|---|
--host | Specify the host IP to connect to (overrides default) |
Examples
Execute on HEAD VM
Execute on specific VM
Commands with pipes and redirections
Development and testing
How it works
Theexecute command provides a way to run single commands on VMs without opening an interactive SSH session:
- VM detection: If no VM is specified, uses the current HEAD VM
- SSH connection: Establishes a secure connection using managed SSH keys
- Command execution: Runs the command as root inside the VM
- Output streaming: Returns stdout/stderr directly to your terminal
- 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)
See Also
- vers connect - Open interactive SSH session
- vers copy - Transfer files to/from VMs
- vers status - Check VM state