pvcli Reference
Client CLIConnectRPC / gRPCOAuth2 & Contexts
pvcli is the primary command-line tool for managing virtual machines, storage volumes, images, networks, and organizations across PiVirt clusters. It communicates with the PiVirt Agent via ConnectRPC / gRPC.
Global Syntax & Flags
Section titled “Global Syntax & Flags”pvcli [command] [subcommand] [flags]Global Flags
Section titled “Global Flags”| Flag | Shorthand | Description | Default |
|---|---|---|---|
--context |
-c |
Name of the context to use from ~/.config/pvcli/config.yaml |
Current context |
--output |
-o |
Output format: table, json, yaml, wide |
table |
--insecure |
Disable TLS verification (development mode only) | false |
|
--help |
-h |
Display help and flag details |
Command Reference
Section titled “Command Reference”pvcli auth
Section titled “pvcli auth”Manage user sessions and authentication tokens.
# Login via OAuth2 Device Code flowpvcli auth login
# Login targeting a specific organizationpvcli auth login --organization dev-team
# Display current authenticated user profilepvcli auth whoami
# Invalidate session token and clean up local credentialspvcli auth logoutpvcli context
Section titled “pvcli context”Manage connection targets, credentials, and default organizations.
# List all configured contextspvcli context list
# Display active contextpvcli context current
# Add a new contextpvcli context add prod agent.prod.pilab.hu 5001pvcli context add dev localhost 5001 --insecure
# Switch active contextpvcli context switch prod
# Modify context parameterspvcli context set dev --insecure=true
# Remove contextpvcli context remove stagingpvcli vm (Virtual Machines)
Section titled “pvcli vm (Virtual Machines)”Create and manage VM lifecycles.
# List all virtual machinespvcli vm listpvcli vm ls
# Get VM details in table, JSON, or YAMLpvcli vm get <vm-id-or-name>pvcli vm get web-server -o jsonpvcli vm get web-server -o yaml# Create a VM with flagspvcli vm create \ --name web-01 \ --image ubuntu-24.04 \ --cpus 4 \ --memory 8G \ --disk 50G \ --network tenant-net
# Update VM resource allocationspvcli vm set web-01 --cpus 8 --memory 16G
# Autostart configurationpvcli vm autostart listpvcli vm autostart enable web-01pvcli vm autostart disable web-01# Power operationspvcli vm start web-01pvcli vm stop web-01pvcli vm restart web-01pvcli vm pause web-01pvcli vm unpause web-01
# Clone an existing VMpvcli vm clone web-01 --name web-02
# Rebuild VM with a clean OS imagepvcli vm rebuild web-01 --image debian-12
# Export / Import VM packagespvcli vm export web-01 --output /backup/web-01.ovapvcli vm import --file /backup/web-01.ova --name web-restored
# Delete VMpvcli vm delete web-01 --forcepvcli disk (Disks & Volumes)
Section titled “pvcli disk (Disks & Volumes)”Manage storage volumes and VM attachments.
# List all diskspvcli disk list
# Create a storage volumepvcli disk create --name db-data --size 200G --pool default
# Attach / Detach diskpvcli disk attach <disk-id> --vm <vm-id>pvcli disk detach <disk-id> --vm <vm-id>
# Online capacity extensionpvcli disk extend <disk-id> --size 400G
# Update disk metadatapvcli disk update <disk-id> --description "Production database volume"
# Delete diskpvcli disk delete <disk-id>pvcli image (Image Catalog)
Section titled “pvcli image (Image Catalog)”Manage OS images and custom templates.
# List OS images available in osinfodb catalogpvcli image list
# Inspect image detailspvcli image get ubuntu-24.04
# Pull image from official registrypvcli image pull ubuntu-24.04
# Upload custom QCOW2 or RAW imagepvcli image upload --file ./app-server.qcow2 --name app-server-v1
# Delete custom imagepvcli image delete <image-id>pvcli network (Virtual Networks)
Section titled “pvcli network (Virtual Networks)”Manage SDN bridges, subnets, and VM network interfaces.
# List virtual networkspvcli network list
# Inspect network details and IP allocationspvcli network get tenant-net
# Create virtual networkpvcli network create \ --name tenant-net \ --subnet 10.100.0.0/24 \ --gateway 10.100.0.1 \ --dhcp
# List interfaces on a VMpvcli network interfaces <vm-id>
# Add interface to VMpvcli network add-interface <vm-id> --network tenant-net
# Remove interface by MACpvcli network remove-interface <vm-id> --mac 52:54:00:12:34:56
# Delete virtual networkpvcli network delete tenant-netpvcli snapshot (Snapshots & Rollbacks)
Section titled “pvcli snapshot (Snapshots & Rollbacks)”Point-in-time state capture for VMs and attached storage.
# List snapshots for a VMpvcli snapshot list <vm-id>
# Create snapshot (including memory state if running)pvcli snapshot create <vm-id> --name pre-migration-snapshot
# Revert VM to a snapshotpvcli snapshot restore <vm-id> --snapshot pre-migration-snapshot
# Delete snapshotpvcli snapshot delete <vm-id> --snapshot pre-migration-snapshotpvcli org (Organizations & Tenancy)
Section titled “pvcli org (Organizations & Tenancy)”Manage multi-tenant organizations and quotas.
# List organizationspvcli org list
# Get organization details & resource usagepvcli org get <org-id>
# Create organizationpvcli org create --name engineering-team --quota-cpus 64 --quota-ram 256G
# Update organization quotaspvcli org update engineering-team --quota-cpus 128
# Delete organizationpvcli org delete engineering-teampvcli ui (Interactive Terminal UI)
Section titled “pvcli ui (Interactive Terminal UI)”Launch the interactive BubbleTea-powered Terminal UI (TUI) for real-time monitoring and dashboard navigation:
pvcli ui