Skip to main content

A command-line interface for Proxmox Virtual Environment

Project description

Proxmox CLI

PyPI version Python versions License: MIT

A powerful command-line interface tool for managing Proxmox Virtual Environment with support for VMs, containers, users, groups, roles, and permissions.

Support

If you find this project helpful, consider supporting its development:

Buy Me A Coffee

Features

Infrastructure Management

  • 🖥️ Virtual Machines - Create, start, stop, and manage VMs
  • 📦 LXC Containers - Full container lifecycle management
  • 🔧 Nodes - Monitor and manage cluster nodes
  • 💾 Storage - Storage configuration and monitoring
  • 🗂️ Resource Pools - Organize and manage resource pools

Identity & Access Management (IAM)

  • 👤 Users - Create, update, and manage users
  • 👥 Groups - Organize users into groups
  • 🔐 Roles - Define custom roles with specific privileges
  • 🔑 API Tokens - Generate and manage API tokens
  • 🛡️ ACLs - Granular permission management

Output & Configuration

  • 📊 Multiple Output Formats - JSON (default), Table, YAML, Plain text
  • ⚙️ Configuration File - Store credentials and preferences
  • 🔒 SSL Control - Flexible SSL verification options
  • 🚀 Fast & Efficient - Optimized for automation and scripting

Installation

From PyPI (Recommended)

pip install proxmox-cli

From Source

git clone https://github.com/rwgb/proxmox.cli.git
cd proxmox.cli
pip install -e .

Development Installation

pip install -e ".[dev]"

Quick Start

Basic Usage

# List all VMs (JSON output by default)
proxmox-cli vm list

# List containers in table format
proxmox-cli --output table container list

# List users
proxmox-cli user list

# Show help
proxmox-cli --help

Configuration

Create a configuration file at ~/.config/proxmox-cli/config.yaml:

proxmox:
  host: proxmox.example.com
  user: root@pam
  password: your-password
  # Or use API token
  # token_name: mytoken
  # token_value: your-token-value
  verify_ssl: false

output:
  format: json  # or table, yaml, plain

Usage Examples

Virtual Machines

# List all VMs
proxmox-cli vm list

# List VMs on specific node
proxmox-cli vm list --node pve1

# Start a VM
proxmox-cli vm start 100 --node pve1

# Stop a VM
proxmox-cli vm stop 100 --node pve1

# Get VM status
proxmox-cli vm status 100 --node pve1

Containers

# List all containers
proxmox-cli container list

# Start a container
proxmox-cli container start 108 --node pve1

# Stop a container
proxmox-cli container stop 108 --node pve1

User Management

# List all users
proxmox-cli user list

# Create a new user
proxmox-cli user create developer@pve \
  --password "SecurePass123" \
  --email "dev@example.com" \
  --groups "developers"

# Update user
proxmox-cli user update developer@pve --email "newemail@example.com"

# Delete user
proxmox-cli user delete developer@pve

Role & Permission Management

# List all roles
proxmox-cli role list

# Create custom role
proxmox-cli role create CustomRole \
  --privs "VM.Allocate,VM.Audit,VM.PowerMgmt"

# Grant permissions
proxmox-cli acl add \
  --path "/" \
  --roles "PVEAdmin" \
  --users "admin@pve"

API Tokens

# List tokens for a user
proxmox-cli token list user@pve

# Create API token
proxmox-cli token create user@pve mytoken \
  --comment "Automation token" \
  --no-privsep

# Delete token
proxmox-cli token delete user@pve mytoken

Resource Pool Management

# List all resource pools
proxmox-cli pool list

# Create a new resource pool
proxmox-cli pool create production \
  --comment "Production environment resources"

# Show pool details and members
proxmox-cli pool show production

# Add VMs to a pool
proxmox-cli pool add-member production \
  --vm 100 --vm 101 --vm 102

# Add storage to a pool
proxmox-cli pool add-member production \
  --storage local-lvm

# Remove members from a pool
proxmox-cli pool remove-member production \
  --vm 100

# Update pool information
proxmox-cli pool update production \
  --comment "Updated production pool"

# Delete a pool
proxmox-cli pool delete production

Output Formats

The CLI supports multiple output formats:

# JSON (default) - Perfect for scripting
proxmox-cli vm list

# Table - Human-readable
proxmox-cli --output table vm list

# YAML - Configuration-friendly
proxmox-cli --output yaml user list

# Plain text - Minimal
proxmox-cli --output plain node list

Development

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run linting
flake8 src/
black src/

Configuration

Create a configuration file at ~/.config/proxmox-cli/config.yaml:

proxmox:
  host: your-proxmox-host
  user: root@pam
  verify_ssl: false

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

proxmox_cli-0.4.0.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

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

proxmox_cli-0.4.0-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

Details for the file proxmox_cli-0.4.0.tar.gz.

File metadata

  • Download URL: proxmox_cli-0.4.0.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for proxmox_cli-0.4.0.tar.gz
Algorithm Hash digest
SHA256 14ed61e1346f79e8dffda4d686feab1d752ef9cde70b16de9358d9ac406f23a0
MD5 0381c086b796d508dd081042f2fa63d5
BLAKE2b-256 91883602636540f2812903963925db21bab3161440699ba57ac1b0d266a6b9fe

See more details on using hashes here.

File details

Details for the file proxmox_cli-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: proxmox_cli-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 26.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for proxmox_cli-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a59fd655562689b741aef126ad9cc72f471656cadd463b72be1e3116e17826bf
MD5 ada13a4db11c1a46b8a510abf82fe228
BLAKE2b-256 4ada298d7bb91c1543aea0636e99aff0d02bc9dd522cdf1a9d8f5f2b62dd7866

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