9 Commits
Author SHA1 Message Date
w3cjandClaude Opus 5.5 3e81767482 refactor(cli): each command carries its own docs link, group and samples
A command's metadata moves from hand-kept tables into the command itself:
an about (docs page, help group, why no --json) set as its Cobra
Annotations. msg.commandDocs, commandGroups and withoutJSON are gone;
TestDocLinks reads the links from the generated CLI reference, and help
output and the reference are byte-identical. AGENTS.md's cli and vm rows
point at new doc.go package comments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:05:13 -07:00
w3cjandClaude Opus 5.5 9f51e79421 refactor(agents): one definition per coding agent (#29)
Each coding agent gets one definition, an agents.Def in a new stdlib-only
leaf package, internal/agents, and everything else iterates over
agents.Defs: agentlogin's format per login kind, secrets' login kinds,
settings' [pass-keys], image.SharedTools, the vm package's store tables
and scripts, and cli's help lists. The VM copies of every login file,
their bindings, the store's layout, the scripts and the CLI reference
stay the same byte for byte, as golden tests made before the refactor
show.

The agents' guest variables leave base.sh for /etc/devvm/agents.sh,
written at every launch, so every image rebuilds once. Messages are
merged per agent (login_kept, login_passed, login_withheld,
login_oauth_withheld, agent_login_key_only). The structure test's new
names rule fails on an agent's name or login kind as a literal outside
internal/agents, and literals on one holding an agent's folder. Docs
link the supported coding agents rather than listing them, and
Contributing gains Adding a coding agent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:16:40 -07:00
w3cjandClaude Opus 5.5 8d44175601 refactor: the Go module is github.com/devvmhq/devvm
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 06:16:29 -07:00
w3cjandClaude Opus 5.5 5f7289e6f7 feat(cli): devvm upgrade, the newest release the way devvm was installed
devvm upgrade [--check] [--to VERSION] [-f/--force] [--json] installs
devvm's newest release the way this devvm was installed, asking first
(upgrade_confirm, answered by --force). upgrade is a top-level exception
in the cli skill: it acts on devvm itself, not this folder's VM, and it's
the name other tools give the verb. It skips the layout check, as a
layout a newer devvm wrote is a reason to run it.

- install.sh's (<prefix>/lib/devvm/<version>/devvm, which
  <prefix>/bin/devvm links to): SHA256SUMS and its .minisig over HTTPS,
  the signature checked against the key built in from
  packaging/minisign.pub (packaging/key.go embeds the folder; no file,
  no key, and upgrade_no_key), the archive's SHA-256, unpacked into
  lib/.<v>.new.<pid>, run (--version), renamed to lib/<v>, the link
  switched atomically (symlink beside, rename over), run again through
  the link, rolled back on any failure; then older versions pruned as
  install.sh does (kept: the one that ran, any a running process names,
  another upgrade's staging folder).
- Homebrew's (a Cellar/devvm/ keg): brew upgrade devvm, asked first,
  through the run log; --to refused.
- Anything else: says how it was installed (a checkout build, go
  install, a copy elsewhere) and fails.
- Already latest says so; a newest release older than this devvm is
  refused even with --force (rollback); --to installs a named one, older
  asked about (upgrade_confirm_older). --check and --json install
  nothing.

minisign verification is Go's: ed25519 over blake2b.Sum512 for the
default prehashed ED signature (legacy Ed refused), the key ID, the
global signature over signature||trusted comment, and the trusted
comment "devvm <version>" as scripts/release.sh writes it. Verified
against a signature minisign 0.12 made. golang.org/x/crypto v0.58.0
added for blake2b only (approved; depguard allows only
golang.org/x/crypto/blake2b); MVS raised x/text to v0.43.0 and x/tools
to v0.51.0. mise run vuln: no vulnerability reached; the module-level
GO-2026-5932 is x/crypto/openpgp, which devvm doesn't import.

New: internal/upgrade (Detect, Source: Latest, Check for the release
notice to call, Fetch; ParsePublicKey/Verify; Valid/Compare; Upgrader),
internal/upgrade/upgradetest (TLS release server, minisign signer;
tests only, a structure layer), fetch.Resolve (where a HEAD's redirects
end), fetch.Download's size cap (mise's 256 MiB too). Test-build
overrides: DEVVM_REPO_URL, DEVVM_RELEASE_KEY, DEVVM_RELEASE_CA,
DEVVM_TEST_VERSION; script command release_server [-badsig].

Security review (security-audit skill, guidance mode, a fresh reviewer):
- Prerelease order compared suffixes as text (rc.10 < rc.9), which let
  an older signed prerelease past the rollback refusal: fixed, semver
  precedence, with table cases.
- No cap on the archive download (a host could fill TMPDIR before the
  checksum failed): fixed, fetch.Download takes a limit.
- Two upgrades at once: prune removed another's staging folder: fixed,
  .<v>.new/old.<pid> folders are kept while that pid runs.
- A failed rollback of the link was silent: fixed,
  upgrade_rollback_failed names the link and the old devvm, and the new
  folder stays so the link isn't left dangling.
- QEMU's guestfwd names devvm with commas doubled, which the in-use check
  missed: fixed.
- Freeze (a host serving the current version as newest forever): no
  boundary crossed, inherent without signed expiring metadata;
  documented in internals/install.md.
Checked sound: nothing untrusted runs or unpacks before the signature
and SHA-256; versions from the redirect and --to pass Valid before any
URL or path; tar takes only regular files in its one folder (no links,
subfolders, ..), 512 MiB cap, fixed modes; test overrides are read only
by test builds.

Tests: minisign (real minisign fixture, tampering, legacy, other key),
each install kind against the fake TLS server, bad signature, wrong
trusted comment, replaced archive (wrong SHA), bad archives, a new
devvm that fails before and after the switch, a failed switch (old
kept), a failed rollback, downgrade refused and --to, pruning, Homebrew
via a brew script, Check, Latest's failures, Compare; CLI test
upgrade.txtar.

Docs: getting-started/install.md (Upgrading: how, what it checks, an
older release, --json), getting-started/commands.md (This machine row,
Upgrading devvm, questions, output for scripts), internals/install.md
(devvm upgrade), contributing (release_server), the CLI reference.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 22:47:23 -07:00
w3cjandClaude Opus 5.5 317bd8f978 feat(agents): devvm's agent store, filled by devvm agent import
Every VM gets its agents' settings and logins from devvm's own store,
never from the agents' files in the home folder: settings in
~/.config/devvm/agents/<agent>/, logins in
~/.local/share/devvm/logins/<agent>/ (folders 700, files 600, each
agent's logins folder kept out of Time Machine), each laid out as in a
home folder. The store's settings folders are mounted read-only and
linked into the VM's home; its files and logins are copied in, with
network policy as placeholders the proxy fills from the store.

devvm agent import [AGENT...] [--force] copies the home folder's agent
settings and logins into the store once: only agentDirs, agentFiles and
secrets.LoginRel's paths, never history; .claude.json reduced to its
settings, account state and MCP servers; read through each agent's
folder as an os.Root, so no link out of it is followed (a link to a file
inside becomes a copy, any other is left out with a warning, and so is
a login file that's a link); Claude Code's plugin records renamed to the
store's folders. It asks before replacing what the store has (refused
without a terminal, naming --force), replaces in place, keeping the
mounted folders, and prunes what the home folder no longer has.

- paths: Dirs.AgentSettings, Dirs.AgentLogins
- secrets: LoginRel, LoginFile(Dirs, kind), SaveLogin, HasLogin,
  Store.ExcludeFromBackup; Logins, VMLogin, ClaudeCopy, MCPSecrets and
  the proxy's Get read the store
- vm: agentStore, agentMounts/homeSkips/Inventory.Mounts take Dirs,
  syncer.stageAgents, AgentImport; the guest's links file holds each
  folder's home path and its mount's (host_home is gone)
- structure: callers takes methods (pkg.Type.Name);
  Dirs.AgentSettings only in vm/agents.go, Dirs.AgentLogins only in
  secrets/secrets.go
- messages: agent_import_none, agent_import_nothing,
  agent_import_replace, nothing_imported, agent_settings_imported,
  agent_login_imported, agent_import_link_left_out,
  agent_login_read_failed, agent_import_failed; the login refresh
  messages point at devvm agent import
- tests: agentimport_test.go, testdata/script/agent.txtar, sync and
  network scripts through the store, e2e project and network sections
- docs: coding agents (devvm's agent store, importing from this
  machine), README, getting started, safety, internals, contributing

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 14:08:41 -07:00
w3cjandClaude Opus 5.5 2933b535a9 feat(clone): devvm clone on|off switches a VM to or from its own clone
devvm clone [on|off] is a setting: bare (and --json) it shows whether the
folder's VM has its own clone of the repo. on and off make the VM again
through the shared remake, keeping its home folder and settings, after
asking (--force, --no-export, --clean-home as devvm layer add).

- on: a mounted VM is made again with nothing of the folder mounted; its
  branches are seeded as a new --clone VM's, and once the old machine is
  deleted, .git is checked as a launch does and unlocked.
- off: the clone is checked as devvm rm does (unfetched branches offered
  for fetching into saved/<remote>/*, uncommitted changes asked about,
  terminal only; --no-clone-check skips it after a warning); the remote
  goes before the new machine's .git is locked, and is added back if the
  switch is undone.
- The remake records its clone mode (remake.clone), so a remake that
  didn't finish finishes in it, and undo restores the old mode.
- devvm --clone on a mounted VM and layer add/rm/update on a clone VM
  now name devvm clone on/off. rm's clone check messages name the
  command; --no-clone-check has one help text (addNoCloneCheckFlag).
- teardown removes a clone's remote and .git's locks independently.

Tests: TestSetCloneOn, TestSetCloneOff, TestSetCloneUndo,
TestSetCloneRefuses, clone_switch.txtar, e2e clone section checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 15:21:09 -07:00
w3cjandClaude Opus 5.5 a75f4daa28 feat(update): devvm update moves the VM to newer shared tools, then remakes it only when its image is outdated
devvm update first takes devvm tools update's step (Tools.update, split out
of Tools.Update), which needs no remake because shared tools are mounted.
Then, only when the VM's image chain changed, it names what changed
(vm_changed) and asks to make the VM again through the shared remake
(canRemake, agreed and remakeNow, split out of remakeTo). Only newer tools:
recorded and a shell, with no question. Nothing newer: vm_current. A no keeps
the VM with its newer tools and opens a shell when there were some. Without a
terminal or --force, an outdated VM is refused before the tools change.
devvm tools update stays the tools-only command, and newer_tools names
devvm update.

devvm layer add and devvm layer rm move to the root help's Change your VM
group, listed by both names, while layer and layer new stay under Images:
commandGroups takes a subcommand's path, addGroups adds the group to its
parent too, and the usage template lists it in the root's group.

Tests: TestUpdateTools (tools only, both without a terminal, declined,
agreed, neither), update.txtar's tools-only, no-terminal and declined cases,
TestHelpGroupsAndDocs's groups for layer add, layer rm and layer --help, and
an e2e check that devvm update on a current image never makes the VM again.
TestRemakeDone still proves a failed delete of the old machine keeps the
remake recorded. Docs: commands, images' Outdated VMs, toolchains,
troubleshooting, coding agents, internals and contributing; the cli skill's
tree; the CLI reference regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 00:10:46 -07:00
w3cjandClaude Opus 5.5 f4ad9c2c3d feat(vm): devvm update makes an outdated VM again from its image's new build, keeping its home and settings
devvm update [--force|--no-export|--clean-home] (internal/cli/update.go)
is the shared remake with the VM's own image name: Lifecycle.Update calls
toRemake, decides with build.Builds.Outdated (WarnIfOutdated's check, now
its owner) whether the chain's keys changed, says vm_current and does
nothing when they didn't, else names what changed (vm_changed) and calls
remakeTo. --from VMs are judged on the recorded digest and built with
build's lookup. The remake's flags are one adder (addRemakeFlags) for
devvm layer add and devvm update. vm_outdated names devvm update.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 19:47:49 -07:00
w3cjandClaude Opus 5.5 0b03f334fb feat(cli): help in groups, with short texts, examples and each command's docs page
devvm --help lists the commands in groups: Your VM, Change your VM,
Images, Disk space and This machine, with help under Cobra's Additional
Commands. A group whose commands don't exist yet, such as Links between
VMs, stays out of the help.

Each command's Long is one to three sentences, and the rules it held are
on the command's docs page. Every visible command has an Example, with
the most common invocations first, each with a comment. Flag
descriptions are shorter. Each help ends with the address of the
command's docs page, and the root's also ends with the issue tracker.

- internal/cli/help.go: commandGroups, addGroups, addDocs (Cobra's usage
  template with Docs and Issues sections), examples
- internal/msg/docs.go: commandDocs, CommandDoc, CommandDocURL,
  IssuesURL; TestDocLinks checks commandDocs (user pages only)
- docgen: each reference page has a Docs section before See also
- docs: commands.md in the help's groups, with new sections on
  restarting and stopping and on deleting a VM; install.md has doctor's
  engine, feature values, Docker and CA notes; Contributing describes a
  command's help
- tests: TestExamples, TestHelpGroupsAndDocs, TestAddGroups,
  TestWithDocs, TestCheckCommandDocs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 04:39:39 -08:00