Skip to main content

CLI for Proxmox VE

Project description

proxctl

crates.io CI License: MIT codecov

A command-line interface for Proxmox VE -- manage VMs, containers, nodes, storage, and more from your terminal. Includes declarative infrastructure management with apply and export.

Install

# From crates.io
cargo install proxctl

# From PyPI (pre-built binaries, no Rust toolchain needed)
pip install proxctl

# From GitHub Releases (Linux, macOS, Windows)
curl -fsSL https://github.com/rvben/proxctl/releases/latest/download/proxctl-$(uname -m)-unknown-linux-gnu.tar.gz | tar xz

Quick Start

# Interactive setup (creates API token automatically)
proxctl config init

# Check connectivity
proxctl health

# List VMs
proxctl vm list

# Start a VM
proxctl vm start 100

# Show VM configuration
proxctl vm config 100

# List snapshots
proxctl vm snapshot list 100

# Raw API access
proxctl api get /nodes

Declarative Infrastructure (IaC)

Manage Proxmox resources declaratively with YAML manifests, similar to kubectl apply.

Export existing resources

# Export a single VM
proxctl export vm 101 > haos.yaml

# Export all containers
proxctl export container --all > containers.yaml

# Export cluster firewall rules
proxctl export firewall cluster > firewall.yaml

Apply desired state

# infra/web.yaml
kind: vm
name: web-01
vmid: 100
config:
  memory: 4096
  cores: 2
  onboot: true
---
kind: firewall-rule
scope: cluster
config:
  action: ACCEPT
  type: in
  proto: tcp
  dport: "443"
  comment: "Allow HTTPS"
# Preview changes
proxctl apply -f infra/ --dry-run

# Apply changes
proxctl apply -f infra/

# Round-trip: export, then verify nothing drifted
proxctl export vm --all > current.yaml
proxctl apply -f current.yaml --dry-run  # should show "noop" for all

Key behaviors

  • Idempotent -- running apply twice produces "up to date" on the second run
  • Patch semantics -- only specified config keys are changed, others left untouched
  • Name or VMID -- resources can be identified by name (auto-resolves VMID) or pinned by ID
  • Multi-document -- multiple resources in one file with --- separators, or a directory of files
  • Optional power state -- add state: running or state: stopped to manage power, or omit to leave it alone
  • Safe -- shows a diff before applying, destructive changes prompt for confirmation

Features

  • 145+ commands covering VMs, containers, nodes, storage, backups, cluster, firewall, access control, pools, and Ceph
  • Declarative IaC -- apply and export for infrastructure-as-code workflows
  • Auto-detection -- resolves which node a VM lives on automatically
  • Agent-friendly -- --json output, schema command for introspection, structured exit codes
  • Async task handling -- waits for operations to complete with progress spinner
  • Safe -- destructive operations require --yes confirmation
  • Raw API escape hatch -- proxctl api get/post/put/delete for any endpoint
  • Hidden aliases -- qm for vm, ct for container
  • Idempotent -- starting an already-running VM succeeds without error

Configuration

Config file

~/.config/proxctl/config.toml

[default]
host = "https://192.168.1.1:8006"
token = "root@pam!proxctl=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
insecure = true

[production]
host = "https://pve.example.com:8006"
token = "admin@pam!proxctl=yyyyyyyy-..."

Environment variables

Variable Description
PROXMOX_HOST Proxmox host (e.g. pve.example.com:8006)
PROXMOX_TOKEN API token (user@realm!tokenid=secret)
PROXMOX_PROFILE Config profile name (default: default)
PROXMOX_NODE Default node name

Precedence

CLI flags > environment variables > config file

Usage Examples

Human output (TTY)

$ proxctl vm list
  VMID  NAME                  STATUS      NODE        CPUS      MEMORY
   100  k8s-control-1         running     pve1           4    8.00 GiB
   101  k8s-worker-1          running     pve1           8   16.00 GiB
   200  dev-sandbox            stopped     pve2           2    4.00 GiB

JSON output (piped or --json)

$ proxctl vm list --json | jq '.[].name'
"k8s-control-1"
"k8s-worker-1"
"dev-sandbox"

JSON output is automatic when stdout is not a TTY, so piping to jq, grep, or scripts works without flags.

Agent Integration

The schema command outputs a JSON description of all 145+ commands with their arguments, types, defaults, and behavioral metadata:

proxctl schema | jq '.commands | length'
145

This enables AI agents and automation tools to discover available operations, required parameters, and which commands are mutating or destructive -- without parsing help text.

Comparison

Feature proxctl pvesh (built-in) proxmoxer (Python)
Declarative IaC (apply/export) Yes No No
Typed CLI with completions Yes No N/A
Cross-platform binaries Yes No (PVE only) pip install
VMID auto-resolution Yes No Manual
JSON + human output Auto-detect JSON only N/A
Agent schema introspection Yes No No
Idempotent lifecycle ops Yes No Manual

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

proxctl-0.2.3.tar.gz (98.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

proxctl-0.2.3-py3-none-win_amd64.whl (3.9 MB view details)

Uploaded Python 3Windows x86-64

proxctl-0.2.3-py3-none-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

proxctl-0.2.3-py3-none-manylinux_2_28_aarch64.whl (3.7 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

proxctl-0.2.3-py3-none-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

proxctl-0.2.3-py3-none-macosx_10_12_x86_64.whl (3.8 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file proxctl-0.2.3.tar.gz.

File metadata

  • Download URL: proxctl-0.2.3.tar.gz
  • Upload date:
  • Size: 98.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for proxctl-0.2.3.tar.gz
Algorithm Hash digest
SHA256 522d845b6a9f7137e27ad4228a8afbe057659bdec7acfdfd2875986257dfab73
MD5 c6ebce5e89c8f60d1940253d8df41830
BLAKE2b-256 992bcc3a039a2dba949489adaf55ef3ad8e21f0369ec8e70f98e27c9a0b3a739

See more details on using hashes here.

File details

Details for the file proxctl-0.2.3-py3-none-win_amd64.whl.

File metadata

  • Download URL: proxctl-0.2.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for proxctl-0.2.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 408e7ead55e0701c10c9801d033ce5930440478843d9a74f99a4bfd51a89c2d0
MD5 219e0b2771df667a6a93ea24c2774c9c
BLAKE2b-256 3a220c283b35af9daa13ebced5334d837edad25c86f28dd73e7dc948b4707788

See more details on using hashes here.

File details

Details for the file proxctl-0.2.3-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for proxctl-0.2.3-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5ffd4ab999219b9e9e63a49665e15b38e6d1ed416b66035709865edb6f8b0eba
MD5 e02d918ad6402fd189dec121ed99d2d3
BLAKE2b-256 c506f8d4a617144df184f85062ac859fdc77c7596379572789c4f8997f15fe1b

See more details on using hashes here.

File details

Details for the file proxctl-0.2.3-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for proxctl-0.2.3-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 154c9cb93baa97ac7ecb1d608696705b8f806311832d6e2f0d3d76018b19c914
MD5 29d8aae4dce07c5790695243d5b50c45
BLAKE2b-256 706ec7048d15e121532f0834dc8d5817fb05f2f2afbf4393bf0a0066a3bd9c83

See more details on using hashes here.

File details

Details for the file proxctl-0.2.3-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for proxctl-0.2.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b070ffba016cabee196e92067da6acda7c4201c86650e6dc9f7e0904616b65cf
MD5 e4239cc2bc27f0a3d616a5b40330ec43
BLAKE2b-256 f9242c86248c644a659a2f6064ba14c571010f6dbe530daf40ee27a0a0e47e74

See more details on using hashes here.

File details

Details for the file proxctl-0.2.3-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for proxctl-0.2.3-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2e53c9bdf1a820ada42433b1f2c0431fb2610013ae1d7c67a0de83c11021991d
MD5 8ba7e2b9b3659cd3e3c20b2f3635253e
BLAKE2b-256 604e56a5d2a5ffa95d09d1fa8f160c6a353795084c31bb75a6cb76a0b4732b5c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page