Skip to content

feat(cli): list read-only inventories across all hosts - #253

Merged
benvinegar merged 2 commits into
masterfrom
all-hosts-group-a
Nov 9, 2026
Merged

benvinegar merged 2 commits into
masterfrom
all-hosts-group-a

Conversation

@benvinegar

@benvinegar benvinegar commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

What

Plain boxery ls already lists every registered host, one section per host. This extends the same behavior to the other read-only, host-wide listings, so they stop silently reporting only the default host.

Without --host, these now print a section per host (same headings as ls):

  • lease ls (leases)
  • pool ls
  • version: controller line, then each host, with the existing "host is behind" note per host
  • shapes
  • host capabilities / host backends (capabilities, backends)
  • host upgrade --check (upgrade-host --check): each host's report under its own heading
  • runners status: read-only (config, leases, service state)
  • snapshot images (images): one table with a HOST column instead of sections

Before / after

Captured on a machine with three registered hosts: local (lima, default), exe, and hornet (libvirt, remote). Only hornet has pool VMs and images.

boxery pool ls — pool VMs on the non-default host were invisible

Before (only the default host):

NAME             LEASE      EXPIRES    HOLDER

After:

local (default): lima on this machine
NAME             LEASE      EXPIRES    HOLDER

exe: exe on this machine
NAME             LEASE      EXPIRES    HOLDER

hornet: libvirt on user@hornet
NAME             LEASE      EXPIRES    HOLDER
pool1            free       -          -
pool2            free       -          -

boxery snapshot images — one table, with a HOST column

Before (only the default host):

IMAGE                                    CREATED              SIZE       AGE   GUEST

After:

HOST    IMAGE                                    CREATED              SIZE       AGE   GUEST
hornet  modem-tests@tests-green-a509d38          2026-11-01T14:15:08  13686MiB   7d    unknown
hornet  pool1@boxery-clean                       2026-11-08T15:13:55  1687MiB    0d    outdated
hornet  pool2@boxery-clean                       2026-11-09T10:19:49  1741MiB    0d    current

boxery version — each host's version, with the "behind" note per host

Here hornet runs an older release than this checkout, so it gets its own warning.

Before (only the default host):

controller  0.12.0 (v0.12.0)
host        0.12.0 (v0.12.0-2-g83b075f)  git install  [local]

After:

controller  0.12.0 (v0.12.0-2-g83b075f)
local (default): lima on this machine
host        0.12.0 (v0.12.0-2-g83b075f)  git install  [local]

exe: exe on this machine
host        0.12.0 (v0.12.0-2-g83b075f)  git install  [exe]

hornet: libvirt on user@hornet
host        0.12.0 (v0.12.0)  git install  [hornet]
hornet: boxery: host v0.12.0 is older than this controller (v0.12.0-2-g83b075f); upgrade it: boxery --host hornet upgrade-host

boxery upgrade-host --check — each host's report under its own heading

Before (only the default host):

==> fetching origin
==> git install at ~/boxery
==> up to date at v0.12.0-2-g83b075f
==> profiles: ~/.config/boxery, ~/.config/boxery-exe

After:

local (default): lima on this machine
==> fetching origin
==> git install at ~/boxery
==> up to date at v0.12.0-2-g83b075f
==> profiles: ~/.config/boxery, ~/.config/boxery-exe

exe: exe on this machine
==> fetching origin
==> git install at ~/boxery
==> up to date at v0.12.0-2-g83b075f
==> profiles: ~/.config/boxery, ~/.config/boxery-exe

hornet: libvirt on user@hornet
==> fetching origin
==> git install at ~/Projects/boxery
==> up to date at v0.12.0
==> profiles: ~/.config/boxery, ~/.config/boxery-lima

Unchanged

  • --host NAME keeps today's single-host behavior for all of them.
  • --json keeps meaning one host, as for ls.
  • A real upgrade-host / host upgrade (without --check) never fans out; it stays on the selected host.
  • Mutating commands and commands that take a VM NAME are not touched.
  • An unreachable host does not hide the others: the rest print, then the command fails once (same as ls).

Why

lease ls printed (no leases) while a lease was held on another host, pool ls and snapshot images were empty on the default host while another host had entries, and version could not show that a non-default host was behind.

Implementation

  • controller/all-hosts.mjs holds the shared fan-out and rendering, reusing hostHeading / listedHosts from controller/ls.mjs rather than a second grouping helper.
  • Routing is a small isListing() filter in controller/cli.mjs. Contract table, help text, goldens and docs/cli.md are updated.
  • upgrade-host --check reports on stderr; the second commit shows it under each host's heading rather than as prefixed lines after the table.

Not in this PR

Commands that take a VM NAME (agent ls NAME, jobs NAME, …) still only look on the selected host. Resolving a NAME across hosts (and failing on an ambiguous one, e.g. a VM called demo on two hosts) is a separate change.

Testing

npm test (532 passed, 1 skipped), npm run lint, npm run typecheck, npm run docs:cli (no diff) and npm run test:shell all pass. New test/cli-all-hosts.test.mjs covers the fan-out, the HOST column, partial failure, --host / --json staying single-host, and upgrade-host without --check not fanning out. Also run by hand against three real hosts (lima, exe, libvirt).

This was developed with an AI agent (pi) running in a Boxery VM and reviewed by me.

@benvinegar
benvinegar merged commit 09d0deb into master Nov 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant