CLI Reference
Complete command reference with all flags and examples.
View CLI Reference
pvcli is the primary CLI tool for interacting with PiVirt clusters. It provides a unified interface for managing VMs, storage, networks, and clusters across multiple pivirtd instances.
| Property | Value |
|---|---|
| Language | Go 1.22+ |
| Protocol | gRPC/ConnectRPC (via agent) |
| Auth | mTLS (PiTrust PKI), OIDC |
| Config | ~/.config/pvcli/config.yaml |
| Shell Completion | bash, zsh, fish, powershell |
flowchart TB
subgraph Pvcli["pvcli Architecture"]
subgraph Cmd["Command Layer"]
CMD_LIST["vm | disk | network | image | storage | cluster"]
end
subgraph Client["API Client Layer"]
CRPC["ConnectRPC"]
GRPC["gRPC"]
REST["REST (fallback)"]
end
subgraph Auth["Auth & Config Layer"]
PITRUST["PiTrust mTLS"]
OIDC["OIDC"]
CTX["Config Contexts"]
end
Cmd --> Client
Client --> Auth
end
pvcli uses a hierarchical configuration system with multiple sources:
current_context: "production"
contexts: - name: "development" endpoint: "localhost:9001" tls: insecure: true
- name: "production" endpoint: "pivirtd-prod.pilab.hu:9001" tls: ca_file: "~/.config/pvcli/ca.crt" cert_file: "~/.config/pvcli/client.crt" key_file: "~/.config/pvcli/client.key"
output: "table"namespace: "default"
aliases: vm: "virtual-machine" svc: "service" ns: "namespace"--config flag$PVCLI_CONFIG environment variable~/.config/pvcli/config.yaml/etc/pvcli/config.yaml# Generate client certpvcli cert generate --cn "admin@pilab.hu" --org "PiLab"
# Configure context with certificatespvcli config set-context production \ --ca-file /path/to/ca.crt \ --cert-file /path/to/client.crt \ --key-file /path/to/client.key# Login via OIDC (opens browser)pvcli auth login --oidc
# Or with device code (headless)pvcli auth login --oidc --device-code
# Check token statuspvcli auth status
# Refresh tokenpvcli auth refreshFor the complete command reference including all flags, subcommands, and examples, see the pvcli CLI Reference.
| Command Group | Description |
|---|---|
pvcli auth |
Authentication and session management |
pvcli vm |
Virtual machine lifecycle operations |
pvcli disk |
Storage disk management |
pvcli network |
Virtual network management |
pvcli image |
Cloud image management |
pvcli config |
Configuration context management |
pvcli storage |
Storage pools and volumes |
pvcli cluster |
Cluster and node management |
# Table (default)pvcli vm list
# Wide table (more columns)pvcli vm list -o wide
# JSONpvcli vm list -o json
# YAMLpvcli vm list -o yaml
# Custom columnspvcli vm list -o custom=NAME,STATUS,IP,CPU,MEMORY
# Watch mode (real-time updates)pvcli vm list -w# Bashpvcli completion bash > /etc/bash_completion.d/pvcli
# Zshpvcli completion zsh > "${fpath[1]}/_pvcli"
# Fishpvcli completion fish > ~/.config/fish/completions/pvcli.fish
# PowerShellpvcli completion powershell > pvcli.ps1pvcli [command] --help # Help for commandpvcli --config string # Config file pathpvcli --context string # Override current contextpvcli --namespace string # Override namespacepvcli --output string # Output format (table|json|yaml|wide|custom)pvcli --kubeconfig string # Kubernetes config (for cluster commands)pvcli --insecure-skip-tls-verify # Skip TLS verificationpvcli --v int # Log verbosity (0-10)CLI Reference
Complete command reference with all flags and examples.
View CLI Reference
VM Lifecycle Guide
Operational workflows for VM lifecycle, snapshots, and metrics.
View VM Guide
Storage Guide
Storage pools, volumes, and snapshots.
View Storage Guide
Networking Guide
VXLAN, bridge, VLAN, and SR-IOV configuration.
View Networking Guide
Authentication
PiTrust PKI, OIDC, and RBAC authentication setup.
View Authentication