Skip to content

Add Machines: container machine list, create, shell, settings, stats - #16

Open
kylemclaren wants to merge 2 commits into
mainfrom
feat/machines
Open

kylemclaren wants to merge 2 commits into
mainfrom
feat/machines

Conversation

@kylemclaren

Copy link
Copy Markdown
Owner

Summary

Adds a Machines screen for container machine, Apple's persistent Linux environments (init system boots, host user and home directory mapped in). The CLI has had them since 1.0.0 and hides their backing containers from container list, so nothing overlapped with the Containers screen and the app simply never showed them.

  • Model + service: ContainerMachine / MachineDetail decode the exact machine list --format json and machine inspect payloads (captured live on 1.4.1). MachineService wraps list, inspect, create, stop, delete, set, set-default, logs, and the shell argv. There is no machine start; machine run --detach -- true boots a stopped machine headlessly (verified: sub-second resume).
  • Screen: rows with IP / cpus / memory chips and a default-machine star; inspector with live CPU/memory charts (via container stats on the backing container id), configuration, the provisioned Linux user, and a settings card that writes machine set for cpus, memory, and home-mount (applied on next boot, the card says so).
  • Create sheet: streams machine create --progress plain, offers local images, validates names with the CLI's rule (2–63 chars, alphanumeric start).
  • Shell: the one-click console now opens container machine run -n <id> in the preferred terminal, which boots the machine if needed. TerminalLauncher / ConsoleOpener take a generic argv and script body; the container path is unchanged (existing tests untouched).
  • Logs: ContainerLogsView gains a Source so the same sheet serves machines.
  • Palette + menu bar: inspect / shell / start / stop / create items, and a Machines section in the popover.

Known limits (by design of the CLI): inspect doesn't report the nested-virtualization or kernel settings, so those aren't editable yet; a machine created from the CLI with --no-boot needs its first boot in a terminal, and the Start action explains that.

Test plan

  • xcodebuild build (app target) succeeds
  • xcodebuild test passes, including the new Machines suite and the existing terminal-launcher tests
  • Live on container 1.4.1 (earlier in this work): list/inspect JSON shapes, headless boot via run --detach, stop, set, delete, and container stats on the backing container all behave as the code assumes

🤖 Generated with Claude Code

https://claude.ai/code/session_01TLMTFj27fkhmYuisPRZaVr

kylemclaren and others added 2 commits September 14, 2026 00:50
`container machine` (since container 1.0.0) runs a persistent Linux
environment that boots the image's init system and maps the host user
and home directory in. The app never covered it; this adds a Machines
screen alongside Containers.

- Models decode `machine list --format json` (PrintableMachine) and
  `machine inspect` (InspectOutput), captured live from CLI 1.4.1.
- MachineService wraps list/inspect/create/stop/delete/set/set-default/
  logs. There is no `machine start`; `run --detach -- true` boots a
  stopped machine headlessly. Name validation mirrors the CLI rule.
- Machines screen: hoverable rows (IP, cpus, memory, default star),
  inspector with live CPU/memory via the backing container's stats,
  configuration, mapped Linux user, and an editable settings card
  (cpus, memory, home mount → `machine set`, applied on next boot).
- Create sheet streams `machine create --progress plain`; the image
  field offers local images.
- One-click shell reuses the console opener with
  `container machine run -n <id>` (boots first if stopped). The
  launcher and opener now take a generic argv/script body.
- Logs sheet gains a Source so machines reuse ContainerLogsView.
- ⌘K palette (inspect/shell/start/stop/create) and a menu bar section.
- Tests: decoding, argv builders, settings, validation, memory flag
  rendering, start error hint, service streaming, launcher argv/script.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TLMTFj27fkhmYuisPRZaVr
Details and stats are per-machine CLI round-trips; keeping the spinner
up until they finished made a loaded list look stuck.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TLMTFj27fkhmYuisPRZaVr
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