@false00/pi-proxmox

extensionmaintained

Production-focused Proxmox VE automation tools for the Pi coding agent — VMs, LXC, storage, cluster, firewall, backup, HA, replication, and access control via the REST API

by · v1.0.2 · published 3w ago

$ pi install npm:@false00/pi-proxmox
downloads/mo
0
stars
3
last push
3d ago
open issues
7

Signals

license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0

Download trend

2.4K downloads · last 12 weeks (weekly)

README

@false00/pi-proxmox

npm version license CI

Production-focused Proxmox VE automation for the Pi coding agent.

@false00/pi-proxmox exposes 142 Pi tools for managing Proxmox clusters: VMs, LXC containers, storage, cluster state, firewall rules, backups, HA, replication, access control, task tracking, and universal raw API access through the Proxmox REST API.

ResourceLink
npm@false00/pi-proxmox
GitHubgithub.com/false00/pi-proxmox
LicenseMIT
ChangelogCHANGELOG.md
Security policySECURITY.md
Compatibility notesdocs/COMPATIBILITY.md
Examplesdocs/EXAMPLES.md
Permissions guidedocs/PERMISSIONS.md
Troubleshootingdocs/TROUBLESHOOTING.md
Contributing guideCONTRIBUTING.md

Why this package

This package is designed for people who want Pi to operate real Proxmox infrastructure without hand-writing API calls.

What makes it useful:

  • Broad coverage — 142 tools spanning VM, LXC, storage, cluster, firewall, backup, HA, replication, task workflows, and universal raw API access
  • Consistent wrapper strategy — dedicated tools for common workflows, universal raw tools for edge cases, with parameters that intentionally stay close to the Proxmox API where practical
  • Agent-friendly responses — structured JSON output for read/list/status tools, plus progress streaming for long-running operations
  • Operational safety — destructive actions are explicit, task-based operations return UPIDs, and tool failures surface as real Pi tool errors
  • Live-tested behavior — the repo includes integration tests against a real Proxmox host, including VM/LXC lifecycle tests, package checks, raw API coverage tests, and runtime-behavior tests
  • Pi-native packaging — installable as a Pi package through npm and loadable directly via pi install or pi -e

What you get

Tool coverage by area:

AreaTool count
Virtual machines23
VM guest agent13
LXC containers21
Nodes18
Storage + pools11
Cluster9
Backup3
Firewall11
Access control16
High availability7
Replication5
Tasks3
Universal raw API coverage2
Total142

Official API coverage audit

Against the official Proxmox VE API viewer at https://pve.proxmox.com/pve-docs/api-viewer/, the API surface audited on 2026-06-17 exposed:

  • 444 routes
  • 675 route/method combinations
  • top-level namespaces: access, cluster, nodes, pools, storage, and version
  • standard REST methods: GET, POST, PUT, and DELETE

This package covers the common day-to-day workflows with dedicated proxmox_* tools and covers the rest of the official API surface with two universal escape hatches:

  • proxmox_api_call — generic GET/POST/PUT/DELETE access to any Proxmox API path under /api2/json
  • proxmox_api_upload_file — generic multipart upload access for upload-style endpoints

Design philosophy

This package is intentionally a thin-but-usable Proxmox wrapper for Pi.

That means:

  • dedicated tools are added for common operational workflows
  • raw universal tools exist so official API reach does not depend on hundreds of niche one-off wrappers
  • parameter names and many flag conventions stay close to upstream Proxmox behavior when practical
  • the package prefers predictable behavior and maintainability over hiding every Proxmox detail behind a custom abstraction layer

Stability guarantees

This repository aims to provide a stable automation surface for Pi users.

Current guarantees:

  • published tool names are treated as stable once released
  • destructive operations are explicit in tool naming and documentation
  • dedicated tools stay close to upstream Proxmox semantics where practical
  • universal raw tools are the compatibility layer for long-tail official endpoints
  • proxmox_node_execute prefers official args command objects and still accepts legacy body as a compatibility alias

Install

Install into Pi as a package:

pi install npm:@false00/pi-proxmox

Use it for a single run without changing your settings:

pi -e npm:@false00/pi-proxmox

For local development from this repository:

pi -e .

Quick start

After installing, ask Pi to operate your Proxmox cluster in plain English:

List all VMs on pve1
Create a Debian container with 2GB RAM on pve1
Show cluster status
Resize disk scsi0 on VM 101 by +20G
Check recent tasks on pve1

Pi will call tools like proxmox_vm_list, proxmox_lxc_create, proxmox_cluster_status, and proxmox_task_list behind the scenes.

Top tasks and example prompts

Common things users ask Pi to do with this package:

List all VMs on pve1
Show running containers on pve1
Create a Debian LXC with 2 GB RAM on pve1
Clone VM 900 to a new VM 101 named web-01
Take a snapshot of VM 101 named pre-update
Roll back VM 101 to snapshot pre-update
Upload an ISO to local storage on pve1
Show failed tasks on pve1
Check cluster quorum and node health
Run hostname inside VM 118 through the guest agent

Choosing dedicated tools vs raw tools

Use the package in this order:

  1. Dedicated proxmox_* tools first for common workflows like VM lifecycle, LXC lifecycle, storage, firewall, HA, replication, and backups
  2. Use proxmox_api_call when the official API supports something that does not yet have a dedicated tool
  3. Use proxmox_api_upload_file for multipart upload endpoints such as storage uploads

This keeps everyday usage ergonomic while still preserving full official API reach.

Operational docs

For day-to-day use and troubleshooting, see:

Trust, safety, and operating model

This is a full-access infrastructure package. Like any Pi extension, it can perform real changes in your environment if Pi is allowed to call its tools.

Important expectations:

  • The package does not shell into LXC containers; Proxmox does not expose a comparable API for that
  • VM in-guest command execution is only available through the QEMU Guest Agent tools
  • Destructive operations such as delete, stop, reboot, rollback, firewall changes, and ACL updates are exposed as explicit tools
  • Long-running operations return Proxmox task identifiers or agent PIDs so Pi can continue tracking them
  • Runtime failures are thrown back to Pi as proper tool errors, not fake success payloads
  • In the verified test environment, /nodes/{node}/execute required password/ticket fallback even though normal token-based API calls succeeded
  • /nodes/{node}/execute is a real Proxmox endpoint for batching node-relative API requests; it does not provide arbitrary shell execution on the host

If you are evaluating the package for production use, review:

Configuration

Requirements

  • Node.js 22+
  • A Pi runtime with extension support
  • A reachable Proxmox VE cluster over HTTPS

Connection settings

Create ~/.config/pi-proxmox/.env:

# --- Connection ---
PROXMOX_HOST=192.168.1.100
PROXMOX_PORT=8006
PROXMOX_VERIFY_SSL=false

# --- API Token (recommended) ---
PROXMOX_TOKEN_ID=root@pam!automation
PROXMOX_TOKEN_SECRET=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

# --- Password fallback (optional; mainly used when /execute rejects API-token auth) ---
PROXMOX_USERNAME=root@pam
PROXMOX_PASSWORD=yourpassword

# --- Timeouts ---
PROXMOX_TIMEOUT_MS=30000
PROXMOX_TOOL_TIMEOUT_MS=30000

Values in ~/.config/pi-proxmox/.env take precedence over environment variables.

Recommended token setup

Create an admin token with privilege separation disabled if you want the full toolset to work.

Web UI: Go to Datacenter → Permissions → API Tokens, click Add, select your user (for example root@pam), enter a token name (for example automation), and uncheck Privilege Separation.

CLI:

pveum user token add root@pam automation --privsep=0

Without --privsep=0 or with privilege separation left enabled in the UI, the token can appear to work while silently returning empty results for resources like VMs, containers, or storage.

Token format

PROXMOX_TOKEN_ID uses the format:

USER@REALM!TOKENNAME

Examples:

  • root@pam!automation
  • john@pve!ops-bot

Store the .env file with restricted permissions when possible:

chmod 600 ~/.config/pi-proxmox/.env

Environment variables

VariablePurpose
PROXMOX_HOSTProxmox server hostname or IP
PROXMOX_PORTHTTPS port, default 8006
PROXMOX_TOKEN_IDToken ID such as root@pam!automation
PROXMOX_TOKEN_SECRETToken secret UUID
PROXMOX_USERNAMEUsername for password-based auth fallback
PROXMOX_PASSWORDPassword for password-based auth fallback, mainly for /nodes/{node}/execute
PROXMOX_VERIFY_SSLVerify TLS certificates, true or false
PROXMOX_TIMEOUT_MSPer-request API timeout in milliseconds
PROXMOX_TOOL_TIMEOUT_MSTotal Pi tool execution timeout in milliseconds

Configuration priority

  1. ~/.config/pi-proxmox/.env
  2. Constructor options when embedding the client directly
  3. Environment variables
  4. Built-in defaults

Runtime behavior

Output model

  • List, status, config, and inspection tools return JSON text for Pi to consume
  • Long-running tools can stream progress updates into Pi via onUpdate(...)
  • Many asynchronous Proxmox operations return a task UPID
  • Guest-agent execution returns a PID that can be checked with proxmox_vm_agent_exec_status

Error model

Tool failures are thrown back to Pi as proper tool errors. The error message body is JSON with fields such as:

  • error
  • category
  • guidance
  • retryable
  • endpoint
  • method
  • httpStatus

Standard error categories:

CategoryMeaning
validationInvalid tool parameters
authenticationBad credentials, missing privileges, or expired auth
not_foundRequested VM, container, storage, or path does not exist
timeoutRequest or tool runtime timed out
networkConnection failure to the Proxmox host
server_errorProxmox returned a server-side failure
unknownUnexpected error outside the known categories

Errors in timeout, network, and server_error categories are marked retryable.

Tool catalog

Virtual Machines (QEMU/KVM)

ToolDescription
proxmox_vm_listList all VMs on a node
proxmox_vm_statusGet detailed VM status and config
proxmox_vm_configGet VM configuration
proxmox_vm_startStart a VM
proxmox_vm_stopForce-stop a VM
proxmox_vm_shutdownGraceful ACPI shutdown
proxmox_vm_resetHard-reset a VM
proxmox_vm_resumeResume a suspended VM
proxmox_vm_suspendSuspend a VM
proxmox_vm_rebootReboot a VM
proxmox_vm_createCreate a new VM
proxmox_vm_deleteDelete a VM
proxmox_vm_update_configUpdate VM configuration
proxmox_vm_templateConvert a stopped VM to a template
proxmox_vm_move_diskMove a VM disk to another storage
proxmox_vm_pending_changesList pending config changes
proxmox_vm_snapshotSnapshot a VM
proxmox_vm_snapshot_listList VM snapshots
proxmox_vm_snapshot_rollbackRoll back to a VM snapshot
proxmox_vm_snapshot_deleteDelete a VM snapshot
proxmox_vm_cloneClone a VM or template
proxmox_vm_migrateMigrate a VM to another node
proxmox_vm_resize_diskResize a VM disk

VM QEMU Guest Agent

ToolDescription
proxmox_vm_agent_execExecute a command inside a VM
proxmox_vm_agent_exec_statusGet execution status and output by PID
proxmox_vm_agent_pingPing the guest agent
proxmox_vm_agent_infoGet guest-agent version and supported commands
proxmox_vm_agent_get_host_nameGet VM hostname
proxmox_vm_agent_get_network_interfacesGet VM network interfaces
proxmox_vm_agent_get_osinfoGet VM OS information
proxmox_vm_agent_get_timeGet VM system time
proxmox_vm_agent_get_usersList logged-in users
proxmox_vm_agent_get_vcpusGet VCPU info
proxmox_vm_agent_file_readRead a file from a VM
proxmox_vm_agent_file_writeWrite a file to a VM
proxmox_vm_agent_set_user_passwordSet a user's password inside a VM

LXC Containers

ToolDescription
proxmox_lxc_listList containers on a node
proxmox_lxc_statusGet container status and config
proxmox_lxc_startStart a container
proxmox_lxc_stopStop a container
proxmox_lxc_shutdownShut down a container
proxmox_lxc_resetHard-reset a container
proxmox_lxc_resumeResume a suspended container
proxmox_lxc_suspendSuspend a container
proxmox_lxc_rebootReboot a container
proxmox_lxc_createCreate a container from template
proxmox_lxc_deleteDelete a container
proxmox_lxc_update_configUpdate container configuration
proxmox_lxc_templateConvert a stopped container to a template
proxmox_lxc_template_listList cached LXC templates
proxmox_lxc_resizeResize a mount point
proxmox_lxc_pending_changesList pending config changes
proxmox_lxc_snapshotSnapshot a container
proxmox_lxc_snapshot_listList container snapshots
proxmox_lxc_snapshot_rollbackRoll back to a container snapshot
proxmox_lxc_snapshot_deleteDelete a container snapshot
proxmox_lxc_migrateMigrate a container

Nodes

ToolDescription
proxmox_node_listList cluster nodes
proxmox_node_statusGet detailed node status
proxmox_node_configGet node configuration
proxmox_node_servicesList services on a node
proxmox_node_service_statusGet detailed service status
proxmox_node_service_startStart a service
proxmox_node_service_stopStop a service
proxmox_node_service_restartRestart a service
proxmox_node_journalRead systemd journal
proxmox_node_dnsGet DNS configuration
proxmox_node_timeGet system time and timezone
proxmox_node_hardwareList hardware devices
proxmox_node_network_listList network interfaces
proxmox_node_executeBatch relative node API calls via /execute
proxmox_node_rebootReboot the node
proxmox_node_stopPower off the node
proxmox_node_apt_updateRefresh the APT package index
proxmox_node_subscriptionGet subscription status

Storage and pools

ToolDescription
proxmox_storage_listList storage backends on a node
proxmox_storage_contentList content on a storage backend
proxmox_storage_createCreate a storage backend
proxmox_storage_detailGet storage details
proxmox_storage_deleteDelete a storage backend
proxmox_storage_scanScan for available storage resources
proxmox_storage_uploadDownload from URL and upload to Proxmox storage
proxmox_storage_remove_volumeRemove a storage volume
proxmox_pool_listList resource pools
proxmox_pool_createCreate a resource pool
proxmox_pool_deleteDelete a resource pool

Cluster

ToolDescription
proxmox_cluster_statusGet cluster quorum and status
proxmox_cluster_resourcesList cluster resources
proxmox_cluster_next_idGet the next available VM or CT ID
proxmox_cluster_versionGet Proxmox version information
proxmox_cluster_logGet the cluster log
proxmox_cluster_optionsGet cluster options
proxmox_cluster_update_optionsUpdate cluster options
proxmox_cluster_configGet cluster join configuration
proxmox_check_permissionsProbe current token permissions

Backup

ToolDescription
proxmox_backup_listList backup jobs
proxmox_backup_createCreate a backup job
proxmox_backup_deleteDelete a backup job

Firewall

ToolDescription
proxmox_firewall_rulesList firewall rules
proxmox_firewall_rule_addAdd a firewall rule
proxmox_firewall_rules_deleteDelete a firewall rule
proxmox_firewall_optionsGet firewall options
proxmox_firewall_options_updateUpdate firewall options
proxmox_firewall_aliasesList firewall aliases
proxmox_firewall_alias_createCreate a firewall alias
proxmox_firewall_alias_deleteDelete a firewall alias
proxmox_firewall_ipset_listList IPSets
proxmox_firewall_ipset_createCreate an IPSet
proxmox_firewall_ipset_deleteDelete an IPSet

Access control

ToolDescription
proxmox_user_listList users
proxmox_user_createCreate a user
proxmox_user_detailGet user details
proxmox_user_deleteDelete a user
proxmox_group_listList groups
proxmox_group_createCreate a group
proxmox_group_deleteDelete a group
proxmox_role_listList roles
proxmox_role_createCreate a role
proxmox_role_deleteDelete a role
proxmox_acl_listList ACL entries
proxmox_acl_updateAdd or remove ACL entries
proxmox_token_listList API tokens for a user
proxmox_token_createCreate an API token
proxmox_token_deleteDelete an API token
proxmox_domain_listList authentication domains

High availability

ToolDescription
proxmox_ha_statusGet HA status
proxmox_ha_resources_listList HA resources
proxmox_ha_resource_createAdd a resource to HA
proxmox_ha_resource_deleteRemove a resource from HA
proxmox_ha_groups_listList HA groups
proxmox_ha_group_createCreate an HA group
proxmox_ha_group_deleteDelete an HA group

Replication

ToolDescription
proxmox_replication_listList replication jobs
proxmox_replication_createCreate a replication job
proxmox_replication_deleteDelete a replication job
proxmox_replication_runTrigger replication sync
proxmox_replication_logGet replication job log

Tasks

ToolDescription
proxmox_task_listList recent tasks
proxmox_task_statusGet task status by UPID
proxmox_task_logGet task log output

Universal API coverage

ToolDescription
proxmox_api_callCall any official GET/POST/PUT/DELETE endpoint under /api2/json
proxmox_api_upload_fileUpload a local file to any multipart Proxmox upload endpoint

Pagination notes

Several tools accept optional start and limit parameters. These map directly to Proxmox pagination or time-window query parameters.

ToolEndpointstart semantics
proxmox_task_list/nodes/{node}/tasksinteger offset
proxmox_task_log/nodes/{node}/tasks/{upid}/loginteger offset
proxmox_node_journal/nodes/{node}/journalUnix timestamp

For journal queries, start and end are epoch timestamps, not row offsets.

Repository layout

dist/                     Runtime extension code committed directly to the repo
  index.js                Pi extension entrypoint
  proxmox-client.js       REST client and auth logic
  tool-runtime.js         Shared tool execution helpers
  tools/                  Domain tool definitions

docs/                     Bundled Proxmox API reference material and operator docs

tests/                    Live integration, smoke, and runtime-behavior tests

scripts/                  Audit and maintenance helpers
.github/                  CI workflow, issue templates, and repo automation

README.md                 User-facing package documentation
AGENTS.md                 Agent/maintainer guidance
CONTRIBUTING.md           Contributor workflow
SECURITY.md               Security and disclosure policy
CHANGELOG.md              Release history

Compatibility

Verified directly from this repository:

ComponentVerified value
Pi runtime0.79.6
Proxmox VE release9.2
Proxmox VE version9.2.3
Node.js>=22

See docs/COMPATIBILITY.md for the maintained compatibility notes.

Development

npm ci
npm test
npm run test:auth
npm run test:pagination
npm run test:vm-agent
npm run test:execute
npm run test:lxc
npm run test:vm
npm run test:upload
npm run test:runtime
npm run test:raw-api
npm run test:package
npm run test:security
npm run test:ci
npm run audit:official-api

Test philosophy

This project prefers real integration coverage over mock-heavy tests.

  • API/auth behavior is tested against a real Proxmox host
  • VM and LXC lifecycle tests create resources and clean them up
  • Runtime tests verify Pi-specific behavior such as progress streaming, thrown tool errors, and tool timeout handling
  • Raw API tests verify the universal coverage tools against official GET/POST/PUT/DELETE and upload-style endpoints
  • Package tests verify repository metadata and published-package structure
  • The official API audit script fetches the Proxmox API viewer and reports the current upstream route and method counts

CI security gates

GitHub Actions uses immutable action SHAs, npm ci for reproducible installs, runs npm audit --audit-level=high as part of npm run test:ci, performs GitHub dependency review on pull requests, and runs scheduled CodeQL analysis for the JavaScript codebase.

Publishing

npm pack --dry-run
npm publish --ignore-scripts

Publishing guidance, versioning rules, and release discipline live in AGENTS.md.

Support and feedback

The repository includes issue templates for:

  • bug reports
  • feature requests
  • compatibility reports

When reporting problems, include the package version, Pi version, Proxmox version, tool name, and auth mode if possible.

See also

License

MIT — see LICENSE.