Skip to main content

vers copy

Copy files between your local machine and a Vers VM using SCP.

Usage

vers copy [vm-id|alias]  
vers copy    # Uses HEAD VM

Options

OptionDescription
-r, --recursiveRecursively copy directories and their contents

Examples

Upload a file to a VM

vers copy vm-123 ./local-file.txt /remote/path/

Download a file from a VM

vers copy vm-123 /remote/path/file.txt ./local-file.txt

Use HEAD VM for file transfer

# Upload using current HEAD VM
vers copy ./local-file.txt /remote/path/

# Download using current HEAD VM  
vers copy /remote/path/file.txt ./local-file.txt

Copy directories recursively

# Upload entire directory
vers copy -r ./local-directory/ /remote/path/

# Download entire directory
vers copy -r /remote/path/directory/ ./local-directory/

How it works

The copy command automatically handles the complexities of file transfer:
  1. VM validation: Ensures the target VM is running and has SSH access
  2. SSH key management: Creates or retrieves the appropriate SSH key for the VM
  3. Network routing: Determines the correct connection method (direct IP or through cluster node)
  4. Transfer direction: Auto-detects whether you’re uploading or downloading based on path patterns

Path detection

  • Local paths: Don’t start with / or exist on your local filesystem
  • Remote paths: Start with / (absolute paths on the VM)
  • Auto-detection: If a local file exists, the command assumes upload; otherwise, it assumes download

Prerequisites

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

See Also