box new: inline resource overrides (--cpu / --memory / --disk) #57

Closed
opened 2026-07-15 00:02:29 +00:00 by dan-claude-bot · 0 comments
dan-claude-bot commented 2026-07-15 00:02:29 +00:00 (Migrated from github.com)

Today

Per-box resources can only be overridden through environment variables at mint time:

BOX_CPU=2 BOX_MEMORY=3GiB BOX_DISK=20GiB box new --name work --template claude

Resolution is env > template box.env > defaults (4 / 8GiB / 60GiB, bin/box load_template). It works — the drill leans on it on small hosts — but it's invisible: box new --help doesn't advertise it, and nothing about the command surface suggests resources are overridable at all.

Ask

First-class flags on new:

box new --name work --template claude --cpu 2 --memory 3GiB --disk 20GiB
  • Precedence: flag > BOX_CPU-style env (kept, scripts use it) > template > default.
  • Values pass through to limits.cpu / limits.memory / root size= exactly as the template path does — same strings Incus accepts, no unit parsing of our own.
  • --disk applies at launch only (VM root device size); container mode inherits the pool as today. Post-mint resize stays out of scope — that's box incus's job.
  • Templates still cannot name a network/profile/security.* — flags override resources only, so the trust boundary is untouched.
  • box info already shows what an instance actually got via Incus config; no new surface needed there.

Non-goal: flags on --from clones (a clone carries its source's resources; changing them post-hoc is the escape hatch's job).

🤖 Generated with Claude Code

## Today Per-box resources can only be overridden through environment variables at mint time: ```sh BOX_CPU=2 BOX_MEMORY=3GiB BOX_DISK=20GiB box new --name work --template claude ``` Resolution is env > template `box.env` > defaults (`4` / `8GiB` / `60GiB`, `bin/box` `load_template`). It works — the drill leans on it on small hosts — but it's invisible: `box new --help` doesn't advertise it, and nothing about the command surface suggests resources are overridable at all. ## Ask First-class flags on `new`: ```sh box new --name work --template claude --cpu 2 --memory 3GiB --disk 20GiB ``` - Precedence: flag > `BOX_CPU`-style env (kept, scripts use it) > template > default. - Values pass through to `limits.cpu` / `limits.memory` / root `size=` exactly as the template path does — same strings Incus accepts, no unit parsing of our own. - `--disk` applies at launch only (VM root device size); container mode inherits the pool as today. Post-mint resize stays out of scope — that's `box incus`'s job. - Templates still cannot name a network/profile/`security.*` — flags override *resources only*, so the trust boundary is untouched. - `box info` already shows what an instance actually got via Incus config; no new surface needed there. Non-goal: flags on `--from` clones (a clone carries its source's resources; changing them post-hoc is the escape hatch's job). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: heavy-duty/box#57
No description provided.