Skip to main content

vers run-commit

Start a Vers development environment from an existing commit using its commit key.

Usage

vers run-commit <commit-key>
vers run-commit <commit-key> --vm-alias web-server

Options

OptionDescription
--vm-alias, -NSet an alias for the root VM

Examples

Start from commit key

vers run-commit c123456789abcdef
Sending request to start environment from commit c123456789abcdef...
Environment started successfully from commit c123456789abcdef with root vm 'vm-abc123'.
HEAD now points to: vm-abc123 (from commit c123456789abcdef)

With custom alias

vers run-commit c123456789abcdef --vm-alias web-server
Sending request to start environment from commit c123456789abcdef...
Environment started successfully from commit c123456789abcdef with root vm 'vm-abc123'.
HEAD now points to: web-server (from commit c123456789abcdef)

How it works

The run-commit command:
  1. Validates commit key: Ensures the commit key is provided
  2. Creates environment: Makes API call to create environment from the specified commit
  3. Updates HEAD: Sets your local HEAD to point to the new root VM
  4. Confirms success: Shows environment and root VM information

What gets created

  • New environment: Created from the commit’s state
  • Root VM: The primary VM, restored from commit
  • Local HEAD: Updated to point to the new root VM

Getting commit keys

From creating commits

vers commit
Commit created successfully
Commit ID: c234567890abcdef

# Later, recreate this exact state
vers run-commit c234567890abcdef

From team members

# Team member shares their commit key
vers run-commit c345678901abcdef  # Exact same environment state

Error handling

Invalid commit key

vers run-commit invalid-commit-key
Error: failed to start environment: commit not found

Missing commit key

vers run-commit
Error: accepts 1 arg(s), received 0

No .vers directory

vers run-commit c123456789abcdef
Environment started successfully...
Warning: .vers directory not found. Run 'vers init' first.
Solution: Run vers init in your project directory first.

Use cases

Reproduce specific state

# Start environment from a known good commit
vers run-commit c123456789abcdef
vers connect
# Environment is exactly as it was at commit time

Team collaboration

# Team member shares commit key
vers run-commit c234567890abcdef
# Now you have the exact same environment state

Testing and debugging

# Start from specific commit
vers run-commit c345678901abcdef
vers connect
# Debug in the exact environment where issue occurred

CI/CD integration

# Use commit key from automated commits
vers run-commit $COMMIT_KEY --vm-alias ci-test-$BUILD_ID
# Run tests in reproduced environment

Prerequisites

  • Valid commit key from an accessible commit
  • Authenticated with Vers platform
  • Network connectivity
  • Project directory (.vers directory recommended)

Notes

  • Aliases set with --vm-alias are stored locally at ~/.vers/aliases.json
  • Use vers alias to view all your aliases

See Also