A "Snapshots" section on the info screen lists the snapshots, newest first, without Proxmox's "current" pseudo entry. Keys: - p takes a snapshot. The name defaults to tui_YYYYMMDD_HHMM, the description is optional, and VMs can include RAM. - R rolls back to the snapshot under the cursor. The confirm names the snapshot and its date. A running guest is started again; its status is read right before the rollback, and if it cannot be read the rollback does not run. - D deletes the snapshot under the cursor, after a confirm. `delete ct|vm <node> <vmid> -y` without the snapshot subcommand destroys the whole guest. delete_snapshot therefore validates the name first (letter first, then [A-Za-z0-9_-], not "current"), writes "snapshot" into the argv as a literal, and checks the argv shape before running it. A property test covers rejected names. The info screen now scrolls, because four sections do not fit short terminals. A description starting with "-" is refused, since it is a positional argument and could be read as an option. Live test on CT 104: take, roll back (started again) and delete. The snapshot list, status, config and IPv4/IPv6 match the baseline. Closes #8 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2.4 KiB
cv4pve-cli-tui
Textual TUI for cv4pve-cli: list Proxmox VE guests (VMs and LXC), start/shutdown/stop/reboot them, and change cores, memory and disk size.
It shells out to cv4pve-cli and uses its current context (cv4pve-cli config use <name>);
it stores no credentials itself. Tested with cv4pve-cli 2.4.0.
Run
uv run cv4pve-tui
| Key | Action |
|---|---|
s |
start |
S |
shutdown (confirm) |
x |
stop - hard power-off (confirm) |
r |
reboot (confirm) |
Enter |
info: resources (CPU, memory, swap, disks), backups, backup job, network (config and runtime IPs) |
Enter then e |
in info: edit cores / memory / grow a disk (disk growth asks again; it cannot be undone) |
Enter then b |
in info: backup now (snapshot, zstd, storage choice); a there = also show backups of earlier guests that had the same VMID |
Enter then n |
in info: edit network (bridge, VLAN, firewall, IPv4/IPv6; VM IP via cloud-init at next boot); u there = undo the last network change of this guest (this session only) |
Enter then p / R / D |
in info: take a snapshot (name, description, VM: include RAM) / roll back to the snapshot under the cursor (confirms; starts the guest again if it is running) / delete the snapshot under the cursor (confirms) |
t |
shell in a running LXC container (ssh -t root@<node> pct enter <vmid>) |
g |
refresh |
c |
switch cv4pve-cli context (cluster) |
q |
quit |
Warning: link changes (bridge, VLAN, firewall) apply immediately on a running guest and can cut its network (and DNS for others if the guest is your DNS server). IP changes on a running container may need a reboot of the container (seen: static -> DHCP gave no IPv4 until a reboot).
The shell key needs key-based root SSH to the PVE node (LXC only).
Switching context runs cv4pve-cli config use, which changes cv4pve-cli's global current
context: other shells and scripts follow, and it stays after the app exits.
A ! in the first column marks a guest that no backup job covers (Proxmox's
not-backed-up list); the frame's bottom border shows how many.
Empty fields in the edit dialog are left unchanged. If a CPU/memory change cannot be hot-plugged, the app tells you it applies at the next reboot.
Development
uv sync
uv run pytest
Tests mock cv4pve-cli; they never touch a cluster. Design: docs/plans/guest-tui-mvp.md.