A modern CLI tool for Proxmox VM management with clean architecture and simplified command structure.
- Simplified Command Structure:
proxima <host> <command>andproxima <yaml> <command> - Positional Arguments: No more complex flags for VMID - use
proxima <host> start <vmid> - Graceful Shutdown: Both
stop(immediate) andshutdown(graceful) commands - Multiple Operation Modes: Config file, SSH direct, and interactive login
- Idempotent Infrastructure: VM creation with existence verification
- Clean Architecture: Hexagonal architecture with proper separation of concerns
- Zero-Touch Installation: Silent installation without prompts
- No Help Flags: Clean interface without
-h/--helpflags
proxima <host> <command> [arguments]
proxima <yaml> <command> [arguments]
proxima help <command>proxima 10.13.250.11 list
proxima 10.13.250.11 start 100
proxima 10.13.250.11 shutdown 100
proxima 10.13.250.11 stop 100
proxima 10.13.250.11 delete 100proxima config.yaml create --name web-server
proxima config.yamlproxima --login 10.13.250.11 list| Command | Description | Example | Arguments |
|---|---|---|---|
list |
List all VMs | proxima 10.13.250.11 list |
None |
start <vmid> |
Start a VM | proxima 10.13.250.11 start 100 |
VM ID (positional) |
stop <vmid> |
Stop a VM immediately | proxima 10.13.250.11 stop 100 |
VM ID (positional) |
shutdown <vmid> |
Shutdown a VM gracefully | proxima 10.13.250.11 shutdown 100 |
VM ID (positional) |
delete <vmid> |
Delete a VM | proxima 10.13.250.11 delete 100 |
VM ID (positional) |
create --name <vm_name> |
Create VM from config | proxima config.yaml create --name web |
VM name (flag) |
proxima # Show usage overview
proxima help <command> # Show specific command helpproxmox:
host: "192.168.1.100" # Proxmox server IP
port: 8006 # API port
user: "root@pam" # Username
password: "password" # Password
node: "pve" # Node name
vm_ip_base: "192.168.1" # Base IP for VMs
ssh:
user: "root" # Default SSH user
password: "" # SSH password (optional)
key_path: "" # SSH key path (optional)
port: 22 # SSH port
copy_local_key: false # Copy local key to VMs
vms:
- name: "web-server" # VM name
vmid: 100 # VM ID
cores: 2 # CPU cores
memory: 2048 # Memory in MB
disk_size: "20G" # Disk size
network:
bridge: "vmbr0" # Network bridge
vlan: 100 # VLAN ID
model: "virtio" # Network model
os_template: "local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst"
ssh:
authorized_keys: # Pre-authorized SSH keys
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC..."make buildmake install- Installs to
$HOME/.local/bin - Silent installation (no prompts)
- Automatic PATH detection
make uninstallmake cleansrc/
├── cmd/ # Main CLI application
├── internal/
│ ├── core/
│ │ ├── domain/ # Core entities (VM, Command, etc.)
│ │ ├── ports/ # Interface definitions
│ │ └── service/ # Business logic orchestration
│ └── adapters/
│ ├── config/ # YAML configuration management
│ ├── proxmox/ # Proxmox API integration
│ ├── proxmox_ssh/ # Direct SSH integration
│ └── ssh/ # SSH client and key management
└── config.yaml # Configuration file
- Hexagonal Architecture: Clean separation between domain and infrastructure
- Repository Pattern: Abstraction over different Proxmox access methods
- Service Layer: Business logic orchestration
- Adapter Pattern: Multiple integration methods (API, SSH)
- Uses
~/.ssh/id_rsaby default - Supports multiple key formats (RSA, Ed25519, ECDSA)
- No password prompts
- Fastest and most secure method
- Prompts for SSH username and password
- Uses
sshpassfor password authentication - Useful when keys are not configured
- Uses Proxmox API with credentials from config.yaml
- Supports both password and token authentication
- Handles self-signed certificates
proxima config.yamlOutput:
Processing 3 VM(s) from config.yaml...
[OK] VM 'web-server' (ID: 101) already exists
[CREATE] Creating VM 'database' (ID: 102)...
[OK] VM 'database' (ID: 102) created successfully
[CREATE] Creating VM 'cache' (ID: 103)...
[OK] VM 'cache' (ID: 103) created successfully
[INFO] Current VM status:
VMID Name Status CPU Memory
----------------------------------------------------
101 web-server running 2 2048 MB
102 database stopped 4 4096 MB
103 cache stopped 2 1024 MB
# Graceful shutdown (waits for VM to properly shutdown)
proxima 10.13.250.11 shutdown 100
# Immediate shutdown (force stop)
proxima 10.13.250.11 stop 100The shutdown command:
- Waits for VM to be fully running if starting
- Sends graceful shutdown signal
- Waits up to 60 seconds for VM to stop
- Provides clear feedback during the process
The stop command:
- Immediately stops the VM
- No waiting period
- Force termination
- Primary: QEMU Agent for real IP discovery
- Fallback: Configurable base IP pattern (
vm_ip_base.{vmid+100}) - No hardcoded IP addresses
- Automatic key copying to VMs
- Support for multiple authentication methods
- Fallback key discovery (
id_ed25519,id_rsa, etc.)
cobra: CLI frameworkyaml: YAML parsergolang.org/x/crypto/ssh: SSH clientcrypto/tls: TLS configuration for HTTPS
- Configuration Validation: Comprehensive config validation with detailed error messages
- Error Handling: Structured error messages with context and suggestions
- Logging: Detailed logging for debugging and monitoring
- Testing: Unit tests for core components and adapters
proxima # Show usage overview
proxima help list # Show specific command help
proxima help start # Show start command help
proxima help shutdown # Show shutdown command helpThe help system provides:
- Usage overview with all available commands
- Specific command help with syntax and examples
- Clear distinction between stop (immediate) and shutdown (graceful)
- No confusing
-h/--helpflags
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
[Add your license here]