80 Commits
Author SHA1 Message Date
w3cjandClaude Opus 5.5 a47397c26e docs(changelog): 0.1.1-rc.2 as what's new, changed and removed
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HTFcPrY8FzzQMopN5wgpLQ
2026-11-09 11:44:04 -07:00
w3cjandClaude Opus 5.5 7c286973b9 build(release): 0.1.1-rc.2
VERSION is 0.1.1-rc.2. CHANGELOG.md's 0.1.1-rc.2 entry becomes the release candidate's notes on GitHub.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HTFcPrY8FzzQMopN5wgpLQ
2026-11-09 11:33:25 -07:00
w3cjandClaude Opus 5.5 d187f3cca1 docs(changelog): the remount restart, warnings once, Nix 2.35.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HTFcPrY8FzzQMopN5wgpLQ
2026-11-09 11:16:29 -07:00
w3cjandClaude Opus 5.5 7b876d7285 build: bump nix to 2.35.5 and the e2e pins (#39)
scripts/bump.sh nix e2e-tools e2e-from; mise stays deferred.

- assets/layers/nix.sh: nix 2.35.4 -> 2.35.5 (sha256 arm64
  34b8d0c0658321e63143f892086bd2d9623a81bf96e4ffefc1551092d80caedb,
  amd64 c349f0559b7849a2cb3b20b8584e532b3fcf5025092cb6180eb0b99240d7b96c),
  which changes the nix layer's image key.
- tests/e2e-mise.lock: codex 0.166.0 -> 0.167.0 (its entries now carry
  mise's checksum_source = "mise-versions", as others already did) and
  opencode 2.2.5 -> 2.2.6; node, pnpm, bun, python, uv, go, rust,
  dotnet, claude and pi were already the newest.
- tests/e2e/from_test.go: fromAlpineDigest -> sha256:f59abe656b69…,
  alpine:3's digest now (3.24); node:24 and ubuntu:26.04 didn't move.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HTFcPrY8FzzQMopN5wgpLQ
2026-11-09 10:46:11 -07:00
w3cjandClaude Opus 5.5 ab125b1af6 fix(lima): tidy the remount restart's failure paths
A review of the remount restart found its failure paths loose:

- A restart whose limactl stop failed returned the plain message, and
  the caller then stopped the VM's proxy with the VM still running.
  Now a folder still mounted with the old mode is warned of and the VM
  goes on with its proxy, and anything else fails as a logged
  stop_failed, saying the VM didn't stop.
- The interrupt's cleanup was dropped before the restart's stop, so a
  Ctrl+C during that stop could leave an open-tier VM running. It now
  stays until any stop in remountProject returns.
- The start again repeated the first start's warnings (policy lines,
  pins, a degraded start). The UI now says each warning once a run, by
  its name and values, which covers every package's warnings without a
  flag through each of them.
- mount_cache_unmounted and mount_cache_unchecked come only after the
  restart failed, so they no longer say to run devvm restart: they say
  the VM is stopped and its console log may say why.
  mount_cache_remount_failed says the old mode can lose writes and what
  may hold the folder. Their doc links stay on "When the cache mode
  changes", which now points to the console log.
- The mountinfo check's comments and docs say why it's used (portable:
  any awk, no util-linux tool but mountpoint), not that Alpine lacks
  findmnt, which devvm's base layer installs there.
- design.md: the stop that fails, the warnings said once, the cleanup
  through the stop, and the older race of another devvm starting the VM
  in the gap, which fails closed.

Tests: TestRemountRestartStop (the cleanup held through the stop; a
stop that fails, mounted or not), TestRemountRestartConfined (each
start's undoStart, an interrupt between the starts: one start, the proxy
stopped, the one undo kept; a start again whose proxy fails), TestWarnOnce,
and mount_cache.txtar's allowlist restart warning of a bad policy line
once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HTFcPrY8FzzQMopN5wgpLQ
2026-11-09 10:33:03 -07:00
w3cjandClaude Opus 5.5 cd37a12b1b test(state): 0.1.0's Linux VMs are warned of, never refused for pins
devvm 0.1.0 and 0.1.1-rc.1 recorded .git protection off on a Linux
host, the one mode they could set there (NewMode gave off without a
user-immutable flag, and git-protect on or strict was refused), so a
Linux VM they made is never on, and a host that can't pin warns it
git_unprotected rather than refusing it backend_lacks. The fixture's
launch of app now says so: off recorded on Linux (on on macOS), the
warning, and no backend_lacks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HTFcPrY8FzzQMopN5wgpLQ
2026-11-09 09:57:17 -07:00
w3cjandClaude Opus 5.5 db26def35b fix(lima): restart once when the folder can't be mounted again
After a cache-mode change, a Linux VM's start mounts its 9p project
folder again in the guest. On an Alpine --from VM (OpenRC) the umount
succeeds but both mounts fail ("already mounted or mount point busy"),
and devvm stopped the VM with mount_cache_unmounted, though a plain
restart boots with the new mode, which lima.yaml already has.

Now a folder left unmounted, still on the old mode, or a check that
fails gets one restart: the Lima backend writes why in the run log,
stops the VM under one status step (remount_restarting) and returns a
backend.RemountError. The caller, starter.start, starts the VM again
once through startOnce, the same path every start takes, so the restart
gets a new proxy following the new hostagent (the old one exits with
it), the .git pins applied in QEMU's new namespace, its host keys read
again for the new start, and its start recorded. That start's
Want.CheckCache asks Lima for the mountinfo check without the remount;
its outcome is final: unmounted or unchecked stops the VM and fails
with today's messages, another mode warns (its text now says to run
devvm restart to try again). An interrupt gets no restart, and the
cleanup stops the VM once.

- backend: RemountError, Want.CheckCache; backendtest.Fake.StartErr.
- Tests: TestStartSetsProjectCacheOnce (each failure a RemountError,
  the run log's line), TestStartRechecksProjectCache (the restart's
  check, no second restart), TestRemountInterrupted (no restart),
  TestRemountRestart in vm (two starts, a proxy each, no third).
- Stubs: remount-fails (the remount fails and leaves the folder
  unmounted until the next start); TestGuestMountOptions covers it.
- mount_cache.txtar: the restart that mounts the folder, and the one
  that doesn't, with no third start.
- e2e: the from section's Alpine check expects the launch to succeed
  through the restart.
- Docs: backends/lima.md's "When the cache mode changes", design.md's
  remount, restart and running-VM paragraphs, tests.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HTFcPrY8FzzQMopN5wgpLQ
2026-11-09 09:57:17 -07:00
w3cjandClaude Opus 5.5 7c261ed15c docs(vm): mountcache.go in the package map's Settings files
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 09:03:55 -07:00
w3cjandClaude Opus 5.5 b67ae25b31 test(lima): strict conversion and the cache switch on one start
mount_cache.txtar, on a Linux host: a VM an earlier devvm left strict,
with no cache mode chosen, after devvm mount-cache none, converts strict
to on (git_strict_converted) and switches the cache in the same start,
with exactly one limactl edit that sets 9p's cache none, then mounts the
folder again; its state has git.mode=on and mount.cache=none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 09:03:55 -07:00
w3cjandClaude Opus 5.5 2406b498d8 fix(lima): check the remounted folder without findmnt
After a start that switches a Linux VM's project folder to cache none,
devvm checked the remount with findmnt -no OPTIONS, but the Alpine
--from base has no util-linux and busybox has no findmnt, so an Alpine
VM got an empty answer and was stopped with mount_cache_unchecked. The
guest now prints the folder's line of /proc/self/mountinfo, picked by a
POSIX awk (lastMount) that busybox runs: the last line whose mount
point is the folder exactly, as mountinfo escapes it (mountinfoPath:
\040, \011, \012, \134), which awk reads from the environment, as -v
would undo the escapes. devvm reads the mount's and its file system's
options from it (optionsOfMountinfo), refuses an answer that isn't a
mountinfo line, and keeps the 4 KiB cap, the last line and "unknown"
for a mode it doesn't know.

- TestOptionsOfMountinfo, TestMountinfoPath, TestLastMount: real lines,
  9p with and without cache=0x5, Alpine's without optional fields,
  stacked mounts, a path with a space; awk run on them.
- The stubs' guest answers with a mountinfo line; the start tests and
  the mount_cache script check the new command.
- e2e: the from section's Alpine VM, given Lima's mmap with no mode
  chosen, gets none from devvm mount-cache none at its next start on a
  Linux host; the e2e helper reads mountinfo too.
- design.md and tests.md say how the check works and what e2e checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 08:57:45 -07:00
w3cjandClaude Opus 5.5 e3f2635806 test(state): devvm update on 0.1.0's state
rc.2's notes tell users to run devvm update for transparent mode,
since their images predate dnsmasq, socat and nftables, and no fixture
test ran it. fixture_v010_update.txtar runs it on the frozen 0.1.0
fixture:

- web, a --clone VM, is refused before anything runs (remake_clone),
  so its clone and its work stay as they are.
- app without a terminal: vm_changed changed=base, then no_input, and
  nothing changes.
- app with --force: the remake exports the history, saves the home
  folder, sets the old machine aside, clones today's base, puts the
  home back and deletes the old machine. It keeps the VM's ID, tier,
  ports, shared tools (moved to the newest first), the github secret,
  its link group and .git protection (on on macOS, off on Linux, as
  0.1.0 left them), and the launch it ends with gives transparent mode
  the stand-in address.
- The remake keeps the project folder's cache mode as the state has
  it: 0.1.0 chose none, so on Linux app keeps Lima's mmap, its mount
  still without a 9p cache option and the launch still warning;
  devvm update is no opt-in to none.
- On macOS, app left strict is converted to on by the update's start
  (git_strict_converted), and diff.ignoreSubmodules is out of its
  .git/config.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 08:50:28 -07:00
w3cjandClaude Opus 5.5 17d082e4d9 docs(agents): restore two rules
A review of the slim-down found two lines lost and facts the pointers'
pages stated only in part.

- AGENTS.md: task IDs from any tracker never go in commit messages,
  code comments or docs (dropped with dex, not moved), and Lima's
  failed start of a running but degraded VM, which starting tolerates,
  are inline again.
- extending.md: Lima's Start owns env:, propagateProxyEnv, dns and
  hostResolver, and a project VM's size, agent mounts and forwardAgent;
  ports are never the backend's, vmssh.Forwards forwards them over its
  SSH.
- cli.md's Messages: a message made from an error carries it with
  .Because(err).
- structure.md's The packages: which packages use the standard library
  alone (fetch, redact, agents, jsonc, shell, vmname, safefile, daemon),
  proxy with daemon and safefile; devcontainer imports no outside
  module but uses image, jsonc, msg and shell. Its rows read as
  sentences, without semicolons.
- tests.md: the Go tests' introduction reads as full sentences.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 08:43:13 -07:00
w3cjandClaude Opus 5.5 6343f7e578 docs(changelog): 0.1.1-rc.2
## Unreleased becomes ## 0.1.1-rc.2, with what changed since rc.1:
transparent mode, the 9p cache on Linux, no strict .git protection,
folders of repos with --clone, a --clone VM in a mounted folder, nested
repos protected, .git protection on Linux, learning a VM's hosts, rules
by method and path, your own secrets, logins' known fields, opencode's
withheld keys, pi and more providers, prereleases on Homebrew, and the
fixes. Nothing repeats rc.1's entries, and every link's anchor exists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 08:43:13 -07:00
w3cjandClaude Opus 5.5 65b2805f41 docs(network): what a lookup does with transparent mode off
The wording from the IPv6 fix said every lookup in a confined VM with
transparent mode off waits 35 to 40 seconds on a Linux host. e2e on
Fedora measured otherwise: getent fails within 3 seconds and curl with
"Could not resolve host" at once. Only the wrangler dev test saw
workerd wait about 40 seconds for each lookup there. So most tools fail
at once on macOS and Linux alike, and a few, such as workerd under
wrangler dev, can wait about 40 seconds on a Linux host
(safety/network.md, troubleshooting, internals/lima.md).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 08:43:13 -07:00
w3cjandClaude Opus 5.5 4d4c728f38 docs(agents): point to the docs
AGENTS.md goes from 4,463 words to 2,454. The lines whose facts a page
holds become one-line pointers to that page's section; the safety
rules, the gate, ask first, the editor tools, dependencies, cleanups,
test seams, external tools, CGO and most gotchas stay inline.

- Layout: each row is the path and a short what; The packages
  (contributing/structure.md) has each package's concerns and
  identifiers.
- Tasks: one line pointing to Tools and tasks.
- Rules: image keys, docs and docs by reader point to Building tools
  and Writing docs.
- Go conventions: printing, ctx and nolint point to Go lint rules;
  failing, signals, LoggedCmd to CLI conventions; the layers to
  Messages; arguments to Command arguments; the structure test to its
  section.
- Backends: How a backend plugs in, Missing and unreviewed features,
  the feature table and What devvm sets on a VM.
- Messages: four lines pointing to Messages, Questions, Names mode and
  the docs-voice skill.
- Testing: the unit, CLI and e2e lines point to Tests and End-to-end
  tests; Linux hosts and unreviewed emulations to testing.md.
- Gotchas: Lima's degraded start (backends/lima.md) and
  lima.REJECTED.yaml (internals/lima.md) go to their pages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:48:49 -07:00
w3cjandClaude Opus 5.5 ffcaa20c1c docs(contributing): hold what AGENTS.md says, so it can point here
Every fact that AGENTS.md's slimmer version leaves to a pointer now has
a page, and the pages no longer send readers back to AGENTS.md.

- structure.md: The packages, a table of what each package owns, with
  the identifiers AGENTS.md's layout table named (vmname's grammar,
  agentlogin's File, Placeholder, Redact and Restore, daemon's starts,
  TERM then KILL, status file and lifeline, lima/pins.go and
  pinrun_linux.go, vmssh's ForwardLoopback and PinHostKeys, settings'
  Defaults, ParseCPUs and ParseGiB, packaging/key.go, assets/'s
  prelude.sh and network/...), in place of "AGENTS.md's layout table
  names the owners".
- _index.md: deadcode's expected list; depguard's allowed modules, and
  internal/safefile stdlib-only with proxy and daemon; a Go conventions
  section (CGO_ENABLED=0, proxy and daemon unix-only, external tools as
  commands and never linked, shell.Quote, build tags' file names, test
  seams as fields, a new dependency asked first), which the lint rules
  link to in place of AGENTS.md#go-conventions.
- cli.md: the 1 s wait for devvm's own interrupt (interruptGrace);
  AddCleanup, Interrupted() and cleanups' fresh context; LoggedCmd(ctx,
  step, cmd), backend.Logged and WithSteps; Stdout() and Stderr(); cli
  asking first and passing the answer in.
- extending.md: backends return a msg.M or backend.Logged(m), in place
  of the link to AGENTS.md#backends; backend.Validate and Want at Start,
  restart warnings the callers'; callers decide what a VM needs, one
  line on a missing feature, no fallback, an emulation's review.
- tests.md: the e2e sections clone and desktop; --only and --from before
  merging, from's every feature, no hosted macOS; new logic needs a
  test, no Keychain, VMs or your folders, XDG at t.TempDir(), VMs only
  on the fake backend in Go tests.
- docs.md: compared/ among the sections and the user pages; the README
  stays high level; a behavior's page changes in the same change.
- internals: design.md#one-binary lists prelude.sh and network/, and its
  intro points to Contributing; lima.md sets propagateProxyEnv,
  hostResolver and dns, and its start compares them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:45:36 -07:00
w3cjandClaude Opus 5.5 665f27dcb5 fix(network): log only IPv4 connections as transparent mode's refusals
In table inet devvm_transparent, the sentinel chain began with
`ip daddr != 198.18.0.1 return`, and in an inet table an ip match
holds for IPv4 alone, so every IPv6 TCP connection skipped the return
and hit the refusal's log: devvm-why listed [::1]:8787 as refused while
curl localhost:8787 worked over it. The sentinel now returns anything
but IPv4 first. The stand-in address is IPv4, and a connection to it
from an IPv6 socket (::ffff:198.18.0.1) leaves as IPv4, so this opens
no IPv6 way to it. The other chains' ip daddr rules match positively,
so IPv6 only skips them: early_in, early_out and input drop or accept
IPv4 traffic to the stand-in address, and the DNS redirects in output
and from_containers never took IPv6.

- TestTransparentRuleset: the sentinel's first rule returns IPv6, then
  the address's return, and the refusal's log is the sentinel's alone.
- e2e (transparentRuns): an IPv6 connection on loopback that works
  isn't listed under devvm-why's refused connections.
- docs: with transparent mode off, a lookup in a confined VM fails at
  once on macOS but only after systemd-resolved's timeout on a Linux
  host, 35 to 40 seconds for each lookup (safety/network.md,
  troubleshooting, internals/lima.md).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:41:57 -07:00
w3cjandClaude Opus 5.5 4f97f23fe2 test(proxy): a broken hello's tunnel is closed by a reset too
TestTunnelHelloStall failed on Fedora: its second case writes the
record's header and "hello" at once, the proxy refuses the header and
closes with "hello" unread, and Linux then resets the connection rather
than sending a FIN, so the client reads ECONNRESET where the test
wanted EOF. Either is the tunnel closed, which is what the test checks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:32:30 -07:00
w3cjandClaude Opus 5.5 ab5d607d0e docs(contributing): a release candidate gets no state fixture
Released state and the release checklist say that only a final release
that changed the state gets a frozen fixture; a release candidate gets
none, even when it changed the state, and its final release's fixture
holds that state.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:28:44 -07:00
w3cjandClaude Opus 5.5 eb45ad4e18 test(state): run devvm mount-cache and devvm network transparent on 0.1.0's state
The 9p cache and transparent-mode branches each added a vm.json
setting without running its command on the frozen 0.1.0 fixture, which
the fixture policy asks of a change to state.

- fixture_v010_mount_cache.txtar (Linux): 0.1.0's app VM shows mmap
  with the warning; devvm mount-cache none is pending while stopped, the
  next start makes it in one limactl edit with 9p's cache none and
  mounts the folder again, and the start after that edits nothing.
- fixture_v010_network.txtar: app, with no transparent mode of its own,
  follows the default, on, and its launch gives the setup the stand-in
  address; devvm network transparent off and on go in its state and
  apply from its next launch.
- checkV010Others: no 0.1.0 VM has a cache mode or a transparent mode
  of its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:28:44 -07:00
w3cjandClaude Opus 5.5 79fc8dab63 docs(agents): fix stale lines
Factual corrections only, each checked against the code:
- Testing: Go tests make VMs only on the fake backend (unit tests call
  Launch.Up on backendtest); the CLI tests run the built devvm against
  the stubs, and e2e makes real VMs.
- assets/: base.yaml is base's Lima template; layers/ holds base's
  scripts, policy and Ubuntu's signing keys; network/ (the tiers' own
  policies) is listed.
- scripts/: test.sh is the test and coverage tasks' script, and
  coverage.sh, which it runs, checks the baselines.
- Tasks: lint:code and lint:docs list everything they run; test and
  coverage name their scripts; cli-docs also follows Example and the
  command's docs page.
- paths: a project VM's folder is Dirs.VMDir; forbidigo's
  os.WriteFile/os.Create/O_TRUNC exemptions are internal/state,
  internal/proxy, internal/msg/gen, internal/stubtest and tests.
- The testscript runner also stops port forwarders, link sessions and
  the stub ssh masters.
- e2e: the slots run in slots_test.go; sandbox_test.go has the
  sandbox, its slot's paths and lock, and e2eUbuntuRelease.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:21:01 -07:00
w3cjandClaude Opus 5.5 1bc77c9fbd docs(agents): drop dex
AGENTS.md no longer names dex: the tasks line, dex complete, dex edit
and the rule on task IDs go. One commit per finished task (its docs and
review included) and no commit before the gate passes stay, and a task
that turns out wrong or incomplete is said so, with the change
proposed. .gitignore keeps .dex/, so an existing checkout's task file
can't be committed by mistake.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:21:00 -07:00
w3cjandClaude Opus 5.5 f1d8f86a43 docs(contributing): keep every release's state working
Released state (contributing/structure.md) is the guide to the state
fixtures: what one holds; that each is generated once from its
release's own binary and never edited or regenerated, and a release
that changes nothing on disk adds none; the tests on every fixture
(stateFixtures, fixtureBinaries, storeFixtures, the per-release
fixture_v* scripts and the checks that each fixture has them); that a
change to state runs its new commands on every fixture in the same
commit; a Breaking changelog entry and a one-time notice at launch for
a change in what devvm does with existing state; freezing a release's
state at release time; and the support window: every release since
0.1.0 until 1.0, a release's fixture and compat code leaving together
in one commit that says so.

maintaining.md's release checklist gets the step that freezes
testdata/v<version>/, and AGENTS.md the rule, in one line linking to
the guide.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:20:52 -07:00
w3cjandClaude Opus 5.5 e7a62d3677 test(state): run the state fixture tests over every release's fixture
The tests of a release's frozen state (testdata/v<release>/<os>/) run
over every release folder, so adding the next release's state is its
folder and its expectations.

- internal/vm: stateFixtures() lists each release's expectations (its
  VMs, vm.json's version, the layout version, its one-repo clones, and
  check functions for its VMs, defaults and agent store); 0.1.0's are
  v010Fixture() in fixture_v010_test.go. TestFixtureVMStates,
  TestFixtureVMsRead, TestFixtureSettings, TestFixtureAgentStore and
  TestFixtureClonesReadAsOneRepo run once per release and system, and
  TestStateFixturesListed fails when a testdata/v*/ folder has no entry
  or an entry has no folder.
- internal/proxy: TestFixtureBindings and TestFixtureProxyConfig read
  every release's files; fixtureBinaries() records each release's and
  system's binary SHA-256. TestV010Rules stays 0.1.0's own grammar table.
- internal/secrets: storeFixtures() lists each release's Linux secret;
  TestFixtureStoreGet runs each, TestStoreFixturesListed checks every
  release with a linux/ folder has one.
- internal/cli: TestFixtureScripts fails when a release folder has no
  script that runs `fixture v<release>`, or a script names a folder
  that isn't there. The scripts stay per release (fixture_v010*.txtar),
  because their checks are of that release's VMs.

testdata/v0.1.0 is unchanged; its generate.sh and generate.txtar run
against the v0.1.0 tag as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:20:28 -07:00
w3cjandClaude Opus 5.5 cb36951de2 refactor(git-protect): drop strict, convert strict VMs to on
devvm git-protect strict (0.1.0, 0.1.1-rc.1) set diff.ignoreSubmodules =
all in the locked .git/config, which can't keep git on this machine out
of a submodule the VM adds: a .gitmodules ignore line the VM writes
overrides it, and git add -A/-u, describe --dirty, diff-index,
diff-files, fetch and pull recursion and --ignore-submodules on the
command line enter submodules anyway (#37). --clone is the only way to
keep VM code away from host git.

- devvm git-protect takes on|off; strict is a usage error
  (git_protect_strict_refused) naming devvm clone on. Use, help,
  completion (Modes) and --json reflect it.
- A VM left strict reads as on (Mode, Next) and is pinned and kept as on.
  The first check that finds it stopped (Check, then converter.unstrict:
  launches, devvm stop, devvm clone on and its undo) removes the value all
  from the .git/config of each repo its state recorded before that check,
  under the host's git lock, and only where .git's identity is the
  recorded git_id (a replaced .git, or a VM with no record after devvm
  adopt, is left alone, its all named with the manual remedy:
  git_strict_unknown). Each config is read through safefile first,
  unlocked for the edit and locked again even after an interrupt
  (context.WithoutCancel), and checked to still be a regular file in that
  .git afterwards (git_lock_raced). On a watching host, a config whose sum
  isn't the check's is left, and the new sums go into the watch's. An
  interrupt records nothing. Then on is recorded (mode and next) with one
  warning (git_strict_converted), none when next is off. Set on/off and
  Unlock (devvm rm) remove it the same way, silently (strictLeft).
- strict recorded nothing about a value it overwrote, so nothing can be
  restored: only all is removed (--unset-all '^all$'); any other value is
  the user's and stays. This fixes off, which unset any local value.
- A config another VM keeps locked keeps it, named with the manual
  remedy (git_strict_kept, via msg.M.Value), and its repo goes in the
  state's strict_left, retried at each later stopped check until empty.
  A config git can't change is named (git_strict_left).
- Messages: git_locked and git_embedded_new say what on can't stop;
  git_locked_strict and git_config_failed go.
- Docs: .git protection's Strict section becomes VMs that were strict,
  with the remedies; on and Not covered say a submodule or repo the VM
  adds runs through host git until the next check names it, and only
  --clone keeps VM code away; attack vectors, How it works, the design
  notes, the commands table, ls, the cli skill and the CLI reference
  follow.
- Tests: strict_test.go (conversion, values kept, off/on/unlock, nested,
  kept and retried, replaced and unrecorded .git, interrupted, next off,
  changed since the check, Linux pins and sums, Watch, next, a failed
  edit), TestUnstrictFIFO, msg TestValue, git_protect.txtar,
  git_pins.txtar, fixture_v010_strict.txtar (0.1.0's app VM made strict
  on macOS), e2e project checks on macOS and Linux.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:20:00 -07:00
w3cjandClaude Opus 5.5 647ad4bf2a feat(network): transparent mode for tools that ignore the proxy settings
On every confined tier, a tool that ignores the proxy settings (workerd
under wrangler dev, a static Go binary, a container made through Docker's
API) reaches the VM's proxy by the names it looks up. In the VM, dnsmasq
answers every name with the stand-in address 198.18.0.1 and has no
upstream; nftables sends that address's ports 80, 443 and those the allow
rules name to socat listeners on it, which make each an authenticated
CONNECT transparent.devvm.proxy:PORT to the VM's proxy. The proxy reads the
host from the connection's first bytes (TLS SNI, or each HTTP request's
Host) and judges it as CONNECT host:PORT, with the same order of checks,
log, secrets and floor. A blocked HTTPS host gets the 403 over a
certificate from the VM's CA. Nothing new runs on the host, and the
backends don't change.

Proxy (internal/proxy):
- transparent.go: TransparentHost, ProxyDomain, SentinelAddr,
  IsSentinelAddr, ViaDNS, transparent (serve, take, tls, handler,
  refusePage, ports), sniHost, replay, reservedRefusal, withVia, viaOf.
- routeFor and route: the one order of checks for CONNECT and the
  transparent path; carry, the one tunnel with its SNI check; block split
  into the record and blockPage; links.refuse split (isLinkDomain);
  caEndedRefusal's test moved to routeFor; handshake and serveOne shared
  by intercept and the 403 page.
- devvm.proxy reserved whole, CONNECT devvm.proxy:P included; the stand-in
  address refused with its own reason.
- Hosts and SNI in ASCII alone, never folded (the Kelvin sign), in
  splitHostPort, sniMatches and sniHost.
- A ClientHello record past 16 KiB + 256 is never read; once it starts,
  a ClientHello must arrive whole within 10 s, on every tunnel; a stream
  whose first byte is 0x16 is TLS from then on, so a record header that
  doesn't come whole, or isn't TLS's version, is refused, never passed on
  unchecked; and only a ClientHello that parsed (sniOf) counts, so one
  split across records is refused, an address's tunnel's included, which
  may have no name (a gap older than this change).
- routeFor carries the method and path rules: a host they narrow is
  refused where it can't be decrypted and intercepted where it can, on
  the transparent path too.
- On the transparent HTTP path, devvm.proxy answers /blocked alone.
- policy.transparentPorts and /transparent/ports: 80, 443, then the ports
  allow rules name for hosts by name, at most 32, never 22 or 53.
- Event.Via ("dns"), shown in devvm network log, /blocked and the prompt's
  note as "without proxy settings".

Guest (assets/): base.sh installs dnsmasq(-base), socat and nftables;
guest/transparent.sh is devvm-transparent: setup and teardown from
sync.sh (the proxy URL on stdin), the supervisor service (systemd or
OpenRC), the ruleset (render: two filter chains at -150 keep every
interface but lo and Docker's bridges, and every protocol but TCP, UDP
and ICMP, off the stand-in address; both NAT chains at -110 map every port of
the stand-in address, so Docker's published ports never take one; DNS to
public servers and 127.0.0.1:53 go to dnsmasq, which listens on the
stand-in address alone; private, link-local, CGNAT and loopback servers
are left alone, but the VM's own name servers, which Lima's DHCP adds
beside 127.0.0.1 and Docker gives containers, go to dnsmasq too), slots,
the port list's check, and status for devvm-why. Names without a dot and
names under the search domains (this machine's network's, through Lima)
don't resolve.

Setting: config.toml's transparent-proxy, and devvm network transparent
[on|off], the VM's own value in net.transparent (Settings.Transparent,
SetTransparent; netpolicy.TransparentOf, TransparentAddr); the setup gets
DEVVM_TRANSPARENT_ADDR while the VM runs confined and its mode is on.
devvm network --json has transparent; devvm network lock lists apart the
hosts only tools without proxy settings reached (Learned.NoProxy, via in
--json). vmssh.dialAddr refuses the stand-in address.

Tests: the transparent path's unit tests and FuzzTransparent; the
setting, TransparentOf, FormatEvent's via and learned hosts; the ruleset,
slots and port list under bash 3.2; network_transparent.txtar and
sync.txtar; e2e: transparentRuns, the network section's checks, a docker
step, the from section's Debian 12 and Alpine on the allowlist tier, and
the guarantee checks run with transparent mode stopped and running.

Docs: safety/network.md (tools that ignore the proxy, what isn't
covered, the setting, logs, lock), internals/network.md (tools that skip
the proxy), internals/design.md (the design note and threat check),
using/settings.md, using/troubleshooting.md, using/limits.md,
using/images.md, safety/attack-vectors.md, internals/lima.md,
contributing/tests.md and testing.md, the proxy's README, the CLI
reference and the Commands page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:18:53 -07:00
w3cjandClaude Opus 5.5 6fd1d846d6 fix(lima): cache a Linux VM's project folder with 9p's none
Linux's 9p client loses data with Lima's default cache=mmap for a
writable share: a stat() during an extending write() takes the host's
stale size and writeback drops the data, so files reach the host empty
or cut to 4096 bytes even after fsync (Claude Code's Edit sets it off);
and on devvm's Ubuntu 26.04 guest kernel, a lock after a write makes the
next read return zeros, which breaks SQLite in any journal mode and
Gradle's daemon. macOS's vz VMs use virtiofs and aren't affected.

- New VMs on a Linux host record cache mode none in a new mount section
  of vm.json, and their project folder is made and started with it, as
  is the folder devvm clone off mounts. VMs whose state has no mode
  (0.1.0's, and every VM made before this) keep Lima's mmap untouched,
  with no limactl edit, and each launch warns (mount_cache_unchosen)
  until devvm mount-cache none.
- devvm mount-cache [none], with --json: none is the only mode devvm
  sets, so any other value is a usage error (mount_cache_invalid); a
  stopped VM gets it in its next start's one edit, a running one after
  the restart devvm offers. macOS refuses (backend_lacks), and so does a
  Linux VM whose folder isn't a 9p mount (mount_cache_no_choice). No -g
  or config.toml key: every new VM gets none.
- The start that changes the mode mounts the folder again in the guest,
  as cloud-init rewrites fstab only after systemd has mounted it, through
  the logged runner with a minute's limit (output pipes closed a second
  after), then checks it with mountpoint and findmnt, reading 4 KiB at
  most and only the last line: a folder left unmounted stops the VM and
  fails the start before its shell (mount_cache_unmounted), and so does a
  check that gets no answer (mount_cache_unchecked); one still mounted
  with the old mode is warned of (mount_cache_remount_failed), any mode
  but none or mmap named unknown. An interrupt meanwhile, on any tier,
  leaves a cleanup that stops the VM, the one stop then. A launch into a
  running VM asks the guest, in words, whether its folder is a mount
  point, and refuses one that isn't (project_unmounted) or whose check
  fails or gives no answer (project_unchecked). A stored mmap, from a
  build before none alone, reads as none chosen, and devvm clone off
  records none for its new mount; any other mode is refused naming
  vm.json.
- backend: FeatureMountCache (native on Linux, none on macOS, built on
  project-mount), Want.ProjectCache, Instance.ProjectCache, CacheModes.
- lima: mount rewrites keep only the sshfs and 9p settings devvm knows
  where they differ from Lima's defaults, and drop the rest for Lima to
  fill in, so lima.yaml never freezes a default; same() compares the
  cache where devvm sets one. Build VMs' writable output folders (tools,
  --from) get none.
- tools: an EROFS tool image that ends before its superblock does, or is
  shorter than its superblock says, as a build under mmap could leave
  one, counts as not built, so the next build makes it again; a build's
  short output is refused. The fakes' tool images are a page
  (backendtest.ToolImage).
- The limactl stub lists QEMU's vmType, fills in 9p cache defaults on
  Linux, and answers the remount's check.
- Docs: backends/lima (the project folder's cache, when it changes,
  programs that map files for writing, SQLite), using/limits,
  using/clone, commands, internals/lima, internals/backends, the design
  note (both mmap bugs, why none alone, the remount, tool images, the
  e2e findings), the CLI reference and the cli skill.
- Tests: TestProjectCache, TestMountRoundTrip,
  TestStartSetsProjectCacheOnce (the remount's outcomes), TestCutShort,
  TestBuiltCutShort, TestGuestMountOptions, TestFilledMounts,
  TestUpCacheMode, TestWarnMountCache, TestCacheAtNextStart,
  TestSwitchCache, TestSetMountCache, TestCheckStateCache, the
  mount_cache CLI test, clone_switch and the 0.1.0 fixture on Linux, and
  e2e's projectMountCache (findmnt, a stat-while-write loop, SQLite's
  journals, a shared writable mmap refused, the opt-in switch of an
  unchosen VM, what mmap does reported, macOS unchanged).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 07:17:12 -07:00
w3cjandClaude Opus 5.5 cf1f195490 test(state): exercise devvm 0.1.0's state with today's commands
The fixture tests read 0.1.0's state and launched each VM once; they now
use it with what changed since: custom secrets and nested-repo protection.

- fixture_v010.txtar: app's launch keeps 0.1.0's bindings file byte for
  byte and finds its github secret; scratch's and web's launches edit no
  Lima config and say nothing of nested repos or the github secret.
- A repo nested in app: on macOS, git_nested_protectable once, then
  devvm git-protect on locks lib/.git; on Linux (watched, unlocked), the
  stop says git_nested_appeared and the watch covers it from then on.
- On Linux with DEVVM_PINS=on: git_protect_available, devvm git-protect
  on, and the next start's run/git-pins.json pins .git and lib/.git.
- A secret of your own used in app beside github: secrets.names, yours,
  version 1, github's binding kept; devvm rm unlocks both .gits (macOS),
  keeps none, and deletes the VM.
- internal/secrets TestV010StoreGet: the Linux fixture's store gives
  app's 0.1.0 github binding ghp_testfakev010.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 21:38:23 -07:00
w3cjandClaude Opus 5.5 01e5d2488a feat(network): rules by HTTP method and path, and secrets by method
A policy rule for a host name can narrow it to some of its requests:
`api.github.com GET,HEAD /repos/` in a policy file, written by devvm
network allow, deny and rm from --method and --path. Allows add up and a
deny beats any allow, as for every rule, so narrowing a host that a rule
allows whole, such as devvm's built-in GitHub, takes a deny:
`devvm network deny api.github.com --method POST,PUT,PATCH,DELETE`, or
`devvm network deny github.com --path '/*/*/git-receive-pack'`. An allow
by method and path for a host already allowed whole warns that it
narrows nothing and names the deny.

The proxy decrypts such a host's HTTPS on :443 with the VM's CA, refuses
its tunnels on other ports and without a CA, and judges every request on
the connection, kept-alive HTTP/1.1 and HTTP/2 alike, every absolute-form
one, and the shared Nix cache's own fetches. A connection's verdict and
whether its requests are judged come from one read of the policy files.
A blocked request gets 403 and a blocked event with its method and path;
devvm network log shows it, and an allowed one's forward event names the
rule that let it through.

One matcher, internal/proxy/request.go, judges rules and secrets'
bindings: methods from a closed list (RFC 9110's, PATCH, QUERY; never
CONNECT); the methods a request names besides its own (every
override-like header in any spelling, `_` for `-`, and the query's
_method), each word judged, and while a rule narrows by method, a value
that isn't exactly one method refused; path patterns with *, ** and a
last / for everything below; and only a path in plain form. Allows and
bindings match strictly, denies broadly: any case, every path that isn't
plain, the prefix above a trailing /, and a last segment cut at its first
dot (/admin.json, /admin.). A method devvm doesn't know isn't a rule, so
a typo in a deny is a broken deny. Upgrades other than WebSocket and
CONNECT inside a decrypted tunnel are refused for narrowed hosts.

devvm secret set takes an optional --method (none for every method), and
a secret's --path takes the same patterns, marked path_pattern in
custom-secrets.json; a saved path with a * from before is refused rather
than read as a wildcard. The bindings file stays version 1 while every
binding reads alike to an older proxy, so devvm secret set and rm after
an upgrade don't take a running older proxy's bindings away; a binding
with methods or a pattern makes it version 2, which such a proxy refuses
instead of putting a value in for every method, and writing one warns
for each such VM. devvm network allow, deny and rm warn, naming the VM,
when a rule by method and path changes while the VM's proxy runs from
another devvm binary, or one devvm can't tell. A query with a ; or one
Go can't read whole is refused while a rule narrows the host by method,
and denies also match each segment with its trailing dots dropped. An
allow that narrows nothing names the VMs, with -g by each VM's own
allowlist, and says when it narrows only port 80's plain HTTP.

- proxy: match, Methods, ParseMethods, PathOK, plainPath, matchPath,
  overrides, overrideLike, server.judgeRequest; parseRule/parseHostRule,
  CanonicalRule, NarrowRule, Narrowable, hostRules (rulesFor, verdict,
  byRequest, judge, unjudgeable), egress.checkHost,
  Allowlist.CoversWhole, trimDots; Binding.Methods, BindingListVersion
  2 when needed (v1Binding);
  pathWithin and PathPrefixOK folded into match; the Nix cache judged
- netpolicy: Rule(rule, deny, methods, path), NarrowedHost, sameRule,
  Proxy.Allowlist, Proxy.NarrowNotes, Proxy.OtherBinaries, BasePolicy,
  Proxy.SecretsWritten (after RefreshSecrets and devvm agent login
  --api-key's write);
  FormatEvent shows a blocked request's method and path and a forward's
  rule
- secrets: Def/Secret/customJSON Methods, path_pattern, CheckMethods,
  CheckPath on proxy.PathOK
- vm: RuleChange, PolicyChange(ctx, rules, RuleChange)
- cli: --method and --path on network allow, deny and rm, --method on
  secret set, METHODS in devvm secret and "methods" in its --json
- messages: bad_request_path (was bad_secret_path), bad_methods,
  rule_not_narrowable, rule_narrows, rule_narrows_nothing,
  rule_narrows_http_only, rule_narrows_unknown, proxy_other_binary,
  secrets_other_binary
- tests: TestParseRuleNarrowed, TestMatchPath, TestDenyBypasses,
  TestAllowNarrowed, TestCoversWhole, TestForRequestMethods,
  TestInterceptRules and TestInterceptSecretMethods (HTTP/1.1 kept alive
  and HTTP/2), TestNarrowedNotDecrypted, TestNixCacheRulesByPath,
  FuzzDenyBypass (paths, methods, headers, _method), TestRule,
  TestNarrowedRules, TestOtherBinaries, TestRefreshSecretsOtherBinary,
  TestNarrowNotesUnreadable, TestDefine's path of /, TestReadBindings'
  versions,
  TestCustomsUnreadable's prefix path, network_narrow.txtar (narrows
  nothing), secret_custom.txtar's --method; on 0.1.0's frozen state:
  TestV010Bindings, TestV010ProxyConfig, TestV010Rules (0.1.0's
  TestParsePolicy and TestDecide, frozen), fixture_v010_network.txtar;
  e2e network: netRequestRules
  and the basic secret's --method GET,HEAD
- docs: safety/network.md's Rules by method and path, the secrets'
  flags and an example, internals/network.md's Requests by method and
  path, the design note replacing the open-work entry, attack vectors,
  the commands page, internal/proxy/README.md, the CLI reference

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 21:38:23 -07:00
w3cjandClaude Opus 5.5 20d2fe1db7 feat(clone): workspace clones of a folder of repos
devvm --clone in a folder of git repos gives one VM a clone of each repo
the user chooses, each at the same path as on the host, so paths between
them (file:../pkg, ../Lib/Lib.csproj) work in the VM, and a copy of the
folder's own files outside the repos, made once.

- Discovery by .git protection's walk (4 folders down, the same skipped
  folders, 100 repos); each repo checked as --clone checks one; a linked
  worktree of a repo in the folder isn't a repo of its own; a repo whose
  folder, or common dir, another VM mounts is refused, naming it, as is
  one whose name a terminal can't show. A picker in a terminal (every
  copyable repo ticked, the others shown with why); --repos
  all|none|LIST answers without one, and the question is refused naming
  it. A folder that's a repo keeps today's single clone unless --repos
  is given; one inside another repo's working tree is refused
  (workspace_inside_repo). The choice is recorded in the VM's state.
- A single --clone, or devvm clone on, in a folder another VM mounts is
  refused too (clone_folder_mounted), at plan time and before the seed's
  push.
- Each repo seeded with its current and default branch (origin/HEAD,
  else main, else master); a detached HEAD checks out the default. One
  VM command makes every repo, leaving one an earlier push reached as it
  is; each repo is checked again just before its push, and its remote
  chosen once the one before is added. The folder's own repo's clone
  excludes the other clones (escaped, anchored lines) and the host's
  info/exclude, at the seed and at devvm clone add.
- The folder's own files: walked folder by folder beneath the folder
  (safefile.Root.OpenDir), no links followed, no hard-linked files, no
  bare repos, no set-id bits, bounded; refused folders (checkUnsafe)
  apply.
- devvm clone fetch [--json]: every repo's branches into its remote's
  remote-tracking branches (--refmap=, one refspec), listed by branch
  name with their repos; nothing new is said only when a repo was
  fetched from. devvm clone add PATH: one more repo; one whose copy
  didn't finish is copied again.
- rm, devvm clone off and the switch loop over the repos; rm's check
  reads every repo in one VM command (cloneState), parsed strictly and
  capped (8 MiB, 10,000 branches in all), counting only worktrees inside
  the folder, a VM-side folder never made read as every repo gone; a
  clone missing in the VM is asked about, an unfinished repo checked
  when it's there; a host repo that changed refuses the check, and one
  another VM mounts, a single clone's too, gets no host git and is asked
  about; each repo is checked again before rm's fetch.
- The finder opens a workspace clone VM inside one of its repos; --here
  still makes the repo's own. --repos's dependencies go through needs(),
  which now takes a first argument too (devvm clone on).
- State is additive: clone.workspace, clone.repos, clone.made.files; a
  0.1.0 clone reads as one repo at ".". CHANGELOG: an Unreleased section.

Messages: flag_needs_flag, repos_value, repos_not_workspace,
workspace_repo_unknown, workspace_pick_help, workspace_pick_cannot,
workspace_reason_*, workspace_inside_repo, workspace_repos_past,
workspace_skipped, workspace_repo_dropped, workspace_detached,
copying_repo, uncommitted_not_copied_repos, workspace_ready,
workspace_files_failed, workspace_files_skipped, unfetched_commits_in,
clone_repo_dirty, clone_repo_gone, clone_repo_changed,
clone_repo_mounted, clone_repo_unchecked, clone_folder_mounted,
clone_check_repo_changed, fetch_before_delete_repos,
no_terminal_fetch_repos, clone_fetch_*, fetching_repo, clone_fetched_*,
clone_add_*, clone_added.

Tests: TestDefaultBranch, TestBranchPlan, TestIsWorkspace,
TestChooseRepos, TestPickRepos, TestFindRepos, TestRepoExcludes,
TestWorkspaceFiles, TestCloneChangesAcrossRepos, TestFetchedByBranch,
TestCloneRepos, TestV010CloneReadsAsOneRepo, TestCoversRepo,
TestParseCloneState, TestCloneStateScript, TestWorktreePathPins,
TestOpenDir; the clone_workspace, clone_workspace_repo, subfolder and
nested_replaced scripts; fixture_v010_clone (0.1.0's web clone fetched,
checked by rm, made a workspace clone by devvm clone add, switched off;
its scratch switched on); the e2e clone section's cloneWorkspace.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 21:38:23 -07:00
w3cjandClaude Opus 5.5 62d54923ec docs: compared to other tools
A Compared section: devvm beside Docker Sandboxes, OpenShell,
microsandbox, smolvm, Claude Code's sandbox, Codex CLI, nono and
Codespaces, in two tables, with what devvm doesn't do, sources and a
last-checked date; a page on Docker Sandboxes side by side. Every
competitor claim links to that tool's own docs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 17:45:43 -07:00
w3cjandClaude Opus 5.5 776a1edb49 docs: fix stale and overstated claims found in a competitive audit
- Linux .git protection (namespace read-only binds, watch-only where the
  kernel refuses) described wherever pages said macOS only
- attack vectors: the duplicated "Minting credentials" fragment removed,
  the shell prompt moved from Blocked to Narrowed, what a build reaches,
  localhost cookies on forwarded ports, malware left in the project folder,
  same-user programs and the proxy password, devvm's host programs that
  read what a VM sends
- builds' reach per host, the hostagent profile limits only the network
- known limits: macOS and Linux only
- design: tokens for other services are built (devvm secret set)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 17:45:43 -07:00
w3cjandClaude Opus 5.5 b2b12ee55d feat(gitprotect): protect every repo nested in a VM's folder
A VM over a folder of repos now protects each nested git repo, not only
the folder's own: one walk (hostsafety.Walk, at most 4 folders down and
100 repos, no symlinks, one device) finds them, and each is locked on
macOS, pinned on Linux or watched where Linux can't pin, scanned within
its own top folder and the mount. A repo counts as covered only when a
scan locks its git dir; git dirs follow git's own rule, .git is matched
without case on macOS, and a recorded repo stays protected while
anything is at its .git. Repos the walk can't protect, that appear,
that leave or that look like bare repos are named, with the config keys
and hooks a VM-made repo would run. Existing VMs get a one-time notice
and opt in with devvm git-protect on. Ownership fails closed under one
host lock, so a VM never unlocks what another protects; one scan budget
covers every repo, and launches into a running VM check only the top
repo. devvm doctor gives a tip to set safe.bareRepository=explicit,
reading the user's GIT_CONFIG_GLOBAL when set.

Refs #3.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 16:34:40 -07:00
w3cjandClaude Opus 5.5 8f6b30a887 feat(secret): your own secrets, bound to the hosts you choose
devvm secret set NAME --host HOST[,HOST…] --env VARIABLE [--header H]
[--prefix P] [--stdin] saves a secret of your own: the value from a hidden
prompt or stdin (never argv) into the Keychain or devvm's secrets folder,
and its definition into custom-secrets.json. A VM that uses it (devvm
secret use NAME) gets only a per-VM placeholder in VARIABLE, and its proxy
puts the real value in that header only for those exact hosts, over TLS on
443; the hosts join that VM's allowlist. Names, hosts, headers, variables
and prefixes are checked; wildcards, addresses, internal names and other
ports are refused. One placeholder builder serves every secret and login,
and the proxy caches values by kind, agent and name.


After an independent review, a secret goes in only in four exact shapes
(alone; Bearer, Token or a saved --scheme in Authorization; the Basic
password; the Basic username only with --basic-user), values are
printable ASCII under 3,800 bytes, the proxy checks each binding against
its definition, definitions carry IDs and VMs record their hosts, and
custom values are stored apart from the known secrets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 14:22:42 -07:00
w3cjandClaude Opus 5.5 f8f29e7acb docs(site): fonts served from devvm.dev, no third-party requests
devvm.dev and next.devvm.dev loaded Instrument Sans and Martian Mono from
Google Fonts, with preconnects to fonts.googleapis.com and fonts.gstatic.com.
They were the site's only automatic third-party loads; both fonts are now
served from docs/static/fonts/ with their OFL, and a lint:docs check keeps
it that way.

- Instrument Sans: Instrument/instrument-sans at commit
  7fa22308a3d0c94ee2b3cd537a1196b65db34a3e, fonts/webfonts/
  InstrumentSans[wdth,wght].woff2 (88,784 B, sha256 aa72922a...826d) and
  InstrumentSans-Italic[wdth,wght].woff2 (94,888 B, sha256 e958f71f...9ba5),
  OFL.txt (sha256 9e27a72e...f966).
- Martian Mono: evilmartians/mono release v1.1.0 (commit 8ffa86c2),
  martian-mono-1.1.0-variable.zip (sha256 b8773097...0867), its
  MartianMonoVF.woff2 (83,044 B, sha256 7cdf8e98...238a, wdth 75-112.5 for
  the code's font-stretch), the commit's OFL.txt (sha256 ddafd2c3...c256).
- head-end.html: @font-face for each with font-display: swap and the
  same family names, a preload for the upright Instrument Sans, and a
  comment recording every font's source, pin and full SHA-256s,
  Departure Mono's included.
- TestNoThirdPartyLoads (internal/cli/docgen/site_test.go): lint:docs
  runs it on the site it builds (DOCS_SITE); it fails on any link,
  script, img/srcset, iframe, source, video, object, SVG image/use,
  style attribute, <style> block or stylesheet url()/@import pointing at
  a host other than hugo.yaml's and next.yaml's baseURL. TestPageLoads
  covers the scanner.
- Branding links each font to its upstream repo and its served license;
  Contributing's Writing docs covers the fonts and the check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 12:32:19 -07:00
w3cjandClaude Opus 5.5 017cc90a4a test(state): devvm 0.1.0's state, frozen, read and upgraded by today's devvm
testdata/v0.1.0/{darwin,linux} hold what devvm 0.1.0 itself left: four
VMs, its defaults, its agent store and logins, its image and tool records
and each --json it printed. The TestV010 tests in internal/vm read and
write back every field, and fixture_v010.txtar runs today's devvm on it:
each --json keeps all of 0.1.0's, read-only commands change no file, and
launches start each VM without a Lima edit, naming Codex's unknown login
field as withheld. Contributing's Released state says the fixture is
frozen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 11:28:27 -07:00
w3cjandClaude Opus 5.5 423d3da279 refactor: owner rules from one source, and Contributing in topic pages
Contributing's table of the checks on owners is generated from ownerDocs
(TestOwnersDoc, -update), and TestOwnersAgree checks every owner the
structure test names has its row; the agent home-folder literals come
from agents.Defs. Contributing's index splits into topic pages (structure,
extending, cli, tests, docs), with the batch's own Contributing changes
in the pages that now hold their sections.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:06:28 -07:00
w3cjandClaude Opus 5.5 2b68a2347c feat(gitprotect): .git protection on Linux without root, through a user namespace around QEMU
On Linux, a start of a VM whose protection is on pins .git, its git dirs
and every lock path read-only in a user and mount namespace that devvm
_qemu pinned makes around QEMU. It keeps the pins while QEMU runs, records
each re-pin, refuses hard links and fails closed on watches and records;
doctor says why a host can't lock, and such hosts watch .git instead. The
pins' events file is read through safefile, and the command-line check
takes "devvm lock" in prose as English.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:06:17 -07:00
w3cjandClaude Opus 5.5 d89f3501a2 refactor(gitprotect): one scan, a locker per platform, reports as a table
tree.scan finds .git's parts once per check, which locking, unlocking,
the watch and the reports all go by. A Locker interface does the locking
(Flags on macOS, Watch elsewhere), and protect's reports are a table. No
behaviour change but the order of lock's warnings; the scan's reads of
git's own files go through safefile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:06:07 -07:00
w3cjandClaude Opus 5.5 2865158e02 feat(network): learn the hosts a new VM needs, then lock it to them (#22)
--network learn runs a VM on the internet tier while it records the hosts
it reaches beyond its allowlist, shown as internet (learning). devvm
network lock picks which of them go into the VM's own rules, ticking only
reviewed registries on 443 and listing risky hosts apart, then gives the
VM the allowlist tier at once. learn is per VM only. The lock command
names its docs page in its about.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:05:59 -07:00
w3cjandClaude Opus 5.5 9b40a133ed fix(proxy): agents' logins swap only an exact placeholder, OpenRouter's below /api/ and in x-api-key too
A login binding's placeholder goes in only when its header's one value is
the placeholder alone, or Bearer and the placeholder in Authorization;
secrets keep substring replacement. Bindings gain an optional Path, below
which the value goes in (OpenRouter's /api/), and agents.Provider's
Header becomes Headers, so OpenRouter's key is bound in x-api-key too, for
its Anthropic models.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:05:51 -07:00
w3cjandClaude Opus 5.5 785fb4c1d4 fix(agents): Codex and Claude Code VMs get only the login fields devvm knows
The VM's copy of Codex's auth.json holds only codexKeep's fields, and its
~/.claude.json only claudeAccountKeep's oauthAccount fields; everything
else is withheld and named by path in login_fields_withheld, which
replaces login_kept. A declarative keep-list in format.go owns what each
format keeps or binds, and TestFormatsWithholdUnknown puts a canary in
every object of every format's golden login.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:05:41 -07:00
w3cjandClaude Opus 5.5 33ec9eb0dc refactor(tools): one definition per toolchain
Each toolchain is one image.ToolDef in image.SharedTools, which also
holds its guest environment, its PATH folders and its version files. They
leave base's devvm-tools.sh for /etc/devvm/toolchains.sh, which every
launch writes, so base.sh changes and every image rebuilds once. The
structure test's names rule fails on a toolchain's name as a literal
outside internal/image, TestToolchainsComplete checks the toolchains
page, and Contributing gains Adding a toolchain.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:05:29 -07:00
w3cjandClaude Opus 5.5 f5e6eebc55 refactor: one safe reader for files a VM can write
internal/safefile (standard library only) owns every read of a file a VM
can write or swap: Read and Open never block on a FIFO, follow a final
link only when asked, and check the opened file is regular, within its
cap and, with OneLink, singly linked; OpenRoot opens beneath a folder.
The proxy, secrets, agentlogin, devcontainer, detect, agent save and
gitprotect read through it, fixing three hangs on a FIFO the VM leaves,
and forbidigo holds those callers to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:05:22 -07:00
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 fb19879aaa fix(msg): one rule for which characters reach the terminal
msg.Safe is the one owner: a graphic character in any script is safe;
controls, bidi controls, format characters, variation selectors, private
use and the invisible fillers are not. Printable and OneLine drop what
Safe refuses, agent save's diff escapes it, and forbidigo bans
unicode.IsGraphic, IsPrint, IsControl and Bidi_Control outside
internal/msg.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:04:59 -07:00
w3cjandClaude Opus 5.5 ae5c9b7221 docs(cli): reference pages keep their place when a command is added
Command pages carry no weight, so Hugo sorts the CLI section by title and
a new command changes only its own page, _index.md and devvm.md; the built
sidebar and index order are unchanged. TestPagesHaveNoWeight guards it,
and .gitattributes marks messages_gen.go and the CLI pages as generated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 10:04:38 -07:00
w3cjandClaude Opus 5.5 425a655ef6 test(vm): the test proxy's stop waits for its sleep to be reaped
testProxy's proxies are sleeps reaped by a goroutine, and its Args
names a pid for as long as the test runs, so a stopped one counts as
running until that goroutine reaps it. With Tick at 1 ms, Proxy.Stop
gives up after about 8 ms, which a busy runner can exceed:
TestUpLinksInvalid failed on macOS CI with "its proxy runs". Its Signal
now returns once the sleep it signalled has ended and been reaped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 01:30:18 -07:00
w3cjandClaude Opus 5.5 ffd0d3bcf8 fix(agents): placeholders carry the prefix the agent checks for (#32)
pi 1.5.0 takes an OpenAI key that doesn't start with sk- for a Sign in with
ChatGPT token and leaves max_output_tokens, temperature and the prompt cache
settings out of its requests. agents.Provider gets a Prefix, sk- for
OpenAI, and keyPlaceholder makes opencode's and pi's provider-key
placeholders with it first. TestInterceptWebSocket checks that a WebSocket
upgrade in an intercepted tunnel gets the key, and the network e2e checks
pi's OpenAI request in an API key's shape with the key the proxy put in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 00:54:16 -07:00
w3cjandClaude Opus 5.5 0f31804cad feat(agents): Gemini, Groq, Mistral, xAI and DeepSeek keys as protected placeholders (#31)
The model providers whose API keys the VM's proxy puts in for opencode and
pi are one table, agents.Providers (ID, name, hosts, header), from which the
bindings, devvm agent login --provider and its help, and the docs' table
derive (TestProvidersComplete). Google Gemini, Groq, Mistral, xAI and
DeepSeek join Anthropic, OpenAI and OpenRouter: the VM gets a placeholder,
and the proxy puts the key in, in the provider's header, for its hosts
alone. Binding wins over [pass-keys], and each launch notes a bound API key
that [pass-keys] still lists (login_pass_bound), never a bound OAuth login.

The docs and the note say that a key a VM was given before stays usable
wherever it was copied, that a bound key can mint credentials that work
without the proxy (Gemini's Live API ephemeral tokens, xAI's and OpenAI's
realtime client secrets), and that some providers' own tools fetch URLs the
VM names. The network e2e checks pi's Gemini key in x-goog-api-key, never
in the URL, and opencode's Groq key in its Authorization.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 00:54:10 -07:00
w3cjandClaude Opus 5.5 eaa1706966 docs: a unix socket's path has fewer than 104 characters
macOS's sun_path holds 104 bytes, its terminating NUL included, and Lima
refuses a socket path whose length is UNIX_PATH_MAX or more, so a path
has 103 characters at most. The internals pages (design, overview,
ports), AGENTS.md and the comments on paths.SocketMax, the forwarder's
control socket and the links' sockets said "at most 104"; they now say
fewer than 104, as the Lima backend page and NameMax already did. The
figures computed from the limit (a home folder of up to 37 characters,
ControlMax) already allowed for the NUL and stay as they are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:26:55 -07:00
w3cjandClaude Opus 5.5 26a7aca55c fix(lima): a build VM's ssh port is never the one its clone kept
testdata/script/tools.txtar expects five numbered steps for each tool's
build, configure among them, and once counted three configure steps for
four tools. The cause wasn't load or a race in the stubs' state. A tool's
build VM is a clone of base, and the clone keeps the .ssh.localPort that
base's own build set. The only edit a tool build VM needs is its new ssh
port, chosen at random from 20000 to the host's ephemeral range, so when
the random port happened to be the clone's own (about 1 in 29,000 on
macOS and 1 in 12,800 on Linux, for each build), nothing differed,
Lima's start rightly made no edit, and the build's steps were numbered
[2/5] starting to [4/5] deleting.

ports.Allocator.Build now takes the port the VM's config already has and
never chooses it, so a build VM's start always edits its new port in and
its steps are the same every run. The test is unchanged: it checks what
it always meant to. TestBuild and TestStartBuildSSHPort check that a
build never gets the clone's port; the latter fails without the fix.
The tools script passed 20 runs in a row while mise run test ran
alongside, though at these odds a run that short can't show the flake
either way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:26:14 -07:00
w3cjandClaude Opus 5.5 77d2b202ab fix(agents): opencode's unknown providers' keys withheld by default, as pi's (#30)
opencode gets the rule pi got: an entry of its auth.json that devvm
neither binds nor passes reaches the VM's copy with only the fields
that name its account, with the login_withheld warning, which says to
list the provider under opencode in config.toml's [pass-keys]. A listed
provider's api entry goes whole, metadata included (login_passed), and
opencode 2's import brings every API key the copy holds into its
database. A bound API key's entry is {type, key: placeholder} alone, its
metadata kept on the host. pi's allowlist becomes withheldEntry and
withheldKeep, which both agents share; login_oauth_withheld goes.

A user with a local server's key in opencode sees it withheld after
upgrading, and the launch warning names the provider.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:16:47 -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 84f1190b04 feat(agents): pi, as a fourth coding agent (#23)
Adds pi (earendil-works/pi) as a shared coding agent beside Claude
Code, Codex and opencode: --agents pi, devvm tools add pi, the new-VM
picker and devvm setup offer it. Its network policy allows pi.dev; base
sets PI_SKIP_VERSION_CHECK=1 and PI_TELEMETRY=0 and installs fd-find,
so base and every image on it build again once. The agent store mounts
and copies pi's settings, with keys redacted as JSON.

pi's auth.json is a new login kind: its API keys for Anthropic, OpenAI
and OpenRouter become per-VM placeholders the proxy fills in (devvm
agent login pi --api-key --provider PROVIDER), and everything else is
withheld by default, unless config.toml's [pass-keys] lists the
provider. pi's own account logins aren't supported, and pi has no musl
build, so a musl VM refuses it (image.ToolDef.GlibcOnly). Its sessions
go into devvm history export and import.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:16:35 -07:00
w3cjandClaude Opus 5.5 cda2d09f42 feat(gitprotect): on Linux, warn at each launch and report .git hooks and config that changed (#20)
Linux hosts have no unprivileged immutable flag, so devvm can't lock
.git there. It now warns at every launch of a VM that mounts a folder
with a .git (git_unprotected), unless it's a --clone VM or the user
chose devvm git-protect off (git.chosen), and it names, after the fact,
the hooks and config that changed (git_changed). It sums what a lock
would cover, .git/commondir, include.path targets and the folder
core.hooksPath names, never through a symlink out of the project folder
and within bounds (git_watch_blind names what it can't fully watch), at
each launch that finds the VM stopped and at devvm stop.

A check on such a host runs protect's reports without locking:
git_replaced, git_commondir, stray worktrees, git dirs that appeared,
core.hooksPath and delegations into the project folder, and a
submodule's folder that isn't a git dir (git_gitdir_not_git), in which
nothing is created and which the watch doesn't sum as a git dir.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:16:30 -07:00
w3cjandClaude Opus 5.5 365e562cbc fix(gitprotect): lock only real git dirs, never a folder a VM names as one (#28)
The VM writes a submodule's .git file or folder, so it could name any
folder in the project as a git dir, and devvm then locked that folder's
hooks and config (a React src/hooks, say) or made an empty hooks folder
there. A git dir in the working tree now counts only when isGitDir
passes (a HEAD next to objects and refs folders), the check gitDirs
already ran for .git/modules. devvm locks and creates nothing in a
folder that fails it, and reports it once, and again whenever it
changes, as the new git_gitdir_not_git (delegation kind notgit).

Docs: safety/git-protection's When devvm reports .git, and
internals/git-protection's What's locked and On each launch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:16:24 -07:00
w3cjandClaude Opus 5.5 bd00db91d4 fix(netpolicy): a VM saves a login only for an agent it has (#27)
The capturer fell back to every agent of OpenAI's token endpoint when
the VM's image had none of them, so any VM, even one with no agents,
could replace the store's Codex or opencode login with one of its
choosing. The capturer now keeps only those of the endpoint's agents
that the VM's image has, and picks among them by User-Agent. When none
is left, it refuses the capture for every agent, Claude Code included,
before the request leaves the host and again on the reply, and the
proxy's log names the new login_capture_refused.

Docs: coding-agents' Logins made in a VM, safety/network's agents'
logins, and internals/network's capture section state the rule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:16:19 -07:00
w3cjandClaude Opus 5.5 cbe2947438 fix(history): opencode's database copy runs with sqlite 3.54 (#26)
With -bail, sqlite3 3.54's CLI stops after an SQL statement given with
-cmd and runs nothing else, exiting 0, so devvm_opencode_clean's VACUUM
INTO and every later step did nothing and the export would ship an empty
opencode.db. Each sqlite3 run now gets PRAGMA trusted_schema = OFF; first
in its own input, and passes no -cmd, which works with older and newer
sqlite3 alike.

The check now fails closed: the run that makes the copy prints the
database's count of tables, which must be above 0 and match the copy's,
and each of the final checks' statements must print exactly one 0, so
empty or short output fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-07 19:16:12 -07:00
CJandClaude Opus 5.5 81f3feeecf docs: each page's social card shows its title and what it covers (#21)
## What this changes

Every page on devvm.dev and next.devvm.dev gets its own Open Graph card,
which Hugo draws when it builds the site. Each card is the brand card
(the pixel logo with the lock, black, the lime bar, devvm.dev) with the
page's section in lime capitals, its title, and a short explainer of
what the page covers.

> [!NOTE]
> The six preview cards in `docs/og-preview/` were for review only.
`chore(docs): drop the preview social cards` removes them again, so the
squashed commit doesn't have them, and the images below still show from
the commit that added them.

- **The template**, `docs/assets/images/og-template.png`, is
`docs/static/images/social-card.png` with the headline and tagline rows
filled with the background's exact black. The repo has no SVG or
generator for the card: it was a headless Chrome screenshot of the logo
SVG and text. The old card has only four colors (`#000000`, `#7fff00`,
`#eeeeee`, `#8f93a2`) and no antialiasing, so filling those rows leaves
no marks. The logo, `devvm.dev` and the bar match the card pixel for
pixel, and the template has those four colors and nothing else.
- **The drawing**, `docs/layouts/_partials/og-image.html`, uses
`images.Text` with Departure Mono at multiples of 11px (22px for the
section label, 66, 55 or 44px for the title, whichever fits it in two
lines, and 33px for the explainer). Every line starts on a whole pixel,
so the generated cards also have exactly the template's four colors and
no antialiasing: they are as crisp as the logo. `og-wrap.html` wraps
lines by length, because the font is monospaced. The block is centered
between the logo and devvm.dev. The section is the page's section title,
*Docs* on a section's own page, and none on the home, branding and
taxonomy pages.
- **The font:** Departure Mono **v1.500**, the release the site's woff2
comes from (checked: the woff2 in the release zip is byte-identical to
`docs/static/fonts/departure-mono/DepartureMono-Regular.woff2`, sha256
`5b4fed1d…`, and so is the LICENSE). That release ships an OTF, not a
TTF. Hugo's `images.Text` reads it fine, so
`docs/assets/fonts/departure-mono/` has `DepartureMono-Regular.otf`
(sha256
`4d53f663155cf8bf7ffc8e688776e719625f7bbb80a8d90073438b249261a2e0`) and
its OFL. Source: `gh release download v1.500 -R
rektdeckard/departure-mono`, `DepartureMono-1.500.zip`, sha256
`bf3e48059aeef4617ec585bdea81dcc3491c576b3e7a472f52faf40e09ee5c3a`.
- **The tags:** `custom/head-end.html` writes `og:image`,
`og:image:type`, `og:image:width`/`height`, `og:image:alt` and
`twitter:image:alt`. The alt text is `devvm docs: TITLE: EXPLAINER`.
`_partials/_funcs/get-page-images.html` replaces Hugo's own, which
Hugo's `twitter_cards.html` and `schema.html` call, so `twitter:card` is
`summary_large_image` and `twitter:image` and `itemprop=image` are the
same card. `params.images` is removed from `hugo.yaml`, so Hextra's
`opengraph.html` writes no second `og:image`. In the built site, every
one of the 115 HTML pages (the 404 included) has exactly one `og:image`,
and each card is different.
- **The explainer** is a new front matter key, `explainer`, not
`description`. `description` is the page's meta description,
`og:description`, the search snippet and its `llms.txt` line. Those want
a sentence or two, and only two pages have one. A 4–9 word card line
would be a weak search snippet. Every hand-written page has one. The CLI
pages get their command's `Short` from `internal/cli/docgen` (`mise run
cli-docs` rerun), and the reference's index gets a fixed one. The home
page also sets `cardTitle: One VM for every project` (the hero's
headline), because its title, `devvm`, would repeat the logo.
- **The guard:** `TestExplainers` in
`internal/cli/docgen/explainer_test.go` fails when any page under
`docs/content` has no `explainer`. It also fails when the explainer
takes more than two card lines of 48 characters (33px), or when the
title (or `cardTitle`) takes more than two lines of 36 characters
(44px). Those are the card's real limits, and they also cover the
longest `Short`s. It runs in `mise run test` and in `mise run
lint:docs`, next to `TestDocLinks`. `TestFrontMatter` and
`TestWrappedLines` cover its parsing.
- **Docs:** Contributing › Writing docs describes the cards, the key and
the test. The branding page says each page has its own card.
`social-card.png` stays as the brand asset.

### Numbers

| | Before (main) | After |
| --- | --- | --- |
| Built site (`hugo -s docs --minify`, apparent size) | 40,194 KB |
42,138 KB (+1.9 MB) |
| Cards | 1 static card | 115 PNGs, 14.9–16.6 KB each, 1.84 MB total |
| Build time, image cache cold (`--ignoreCache`) | ~1.0 s | 1.4–1.95 s |
| Build time, image cache warm | ~1.0 s | ~1.0 s |

The cards are smaller than the prototype's estimate (about 16 KB, not
22–34 KB), because they have only four colors.

next.devvm.dev: `hugo -s docs --minify --config hugo.yaml,next.yaml`
gives `og:image`, `twitter:image` and `itemprop=image` as
`https://next.devvm.dev/images/og-template_hu_….png` on every page.

### Examples

| Home | Short title |
| --- | --- |
|
![home](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/home.png?raw=true)
|
![Installing](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/getting-started-install.png?raw=true)
|
| **Longest title (two lines)** | **CLI page, longest explainer** |
| ![What devvm keeps on this
machine](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/using-space.png?raw=true)
| ![devvm
limactl](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/cli-devvm-limactl.png?raw=true)
|
| **Section index** | **How it works page** |
| ![Using
devvm](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/using.png?raw=true)
| ![.git
protection](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/internals-git-protection.png?raw=true)
|

### Every page's card

From a local `hugo -s docs --minify` build. "(none)" is a page whose
card has no section label or no explainer. The 404 page's card, titled
*404 Page not found*, isn't listed.

| Section | Page | Title | Explainer | Card |
| --- | --- | --- | --- | --- |
| (none) | `/branding/` | Branding | devvm's logo, icons, colors and
fonts | 15.6 KB |
| (none) | `/categories/` | Categories | (none) | 15.0 KB |
| Docs | `/docs/backends/` | Backends | The program that runs devvm's
VMs | 15.7 KB |
| Backends | `/docs/backends/lima/` | Lima | What Lima needs, and how
devvm uses it | 15.7 KB |
| CLI reference | `/docs/cli/devvm_adopt/` | devvm adopt | Give this
folder the VM made for an earlier folder or path | 16.3 KB |
| CLI reference | `/docs/cli/devvm_agent_import/` | devvm agent import |
Copy the agents' settings and logins from this machine into devvm's
store | 16.6 KB |
| CLI reference | `/docs/cli/devvm_agent_login/` | devvm agent login |
Log an agent in, in this folder's VM, and save the login in devvm's
store | 16.6 KB |
| CLI reference | `/docs/cli/devvm_agent_save/` | devvm agent save |
Copy the agents' settings from this folder's VM into devvm's store |
16.5 KB |
| CLI reference | `/docs/cli/devvm_agent/` | devvm agent | Fill devvm's
store of the agents' settings and logins that every VM gets | 16.6 KB |
| CLI reference | `/docs/cli/devvm_build/` | devvm build | Build an
image and the images under it, unless they're built | 16.4 KB |
| CLI reference | `/docs/cli/devvm_clone/` | devvm clone | Show or
change whether this folder's VM has its own clone of the repo | 16.4 KB
|
| CLI reference | `/docs/cli/devvm_code/` | devvm code | Open this
folder's VM in VS Code over Remote-SSH | 15.9 KB |
| CLI reference | `/docs/cli/devvm_completion/` | devvm completion |
Print the shell completion script for bash, zsh or fish | 16.3 KB |
| CLI reference | `/docs/cli/devvm_desktop/` | devvm desktop | Open this
folder's VM's desktop in a VNC viewer | 16.0 KB |
| CLI reference | `/docs/cli/devvm_doctor/` | devvm doctor | Check what
devvm needs on this machine | 15.8 KB |
| CLI reference | `/docs/cli/devvm_gc/` | devvm gc | Delete stale
images, unused tools, old files and the Nix cache over its cap | 16.4 KB
|
| CLI reference | `/docs/cli/devvm_git-protect/` | devvm git-protect |
Show or change .git protection for this folder's VM | 16.3 KB |
| CLI reference | `/docs/cli/devvm_group_join/` | devvm group join | Put
this folder's VM in a group of VMs | 15.9 KB |
| CLI reference | `/docs/cli/devvm_group_leave/` | devvm group leave |
Take this folder's VM out of its group | 16.0 KB |
| CLI reference | `/docs/cli/devvm_group/` | devvm group | Show the
group this folder's VM is in | 15.9 KB |
| CLI reference | `/docs/cli/devvm_history_export/` | devvm history
export | Save this folder's VM's agent history to a .tar.gz | 16.5 KB |
| CLI reference | `/docs/cli/devvm_history_import/` | devvm history
import | Put an export of agent history into this folder's VM | 16.4 KB
|
| CLI reference | `/docs/cli/devvm_history/` | devvm history | List the
saved exports of agents' history | 16.0 KB |
| CLI reference | `/docs/cli/devvm_host/` | devvm host | Get this
folder's VM ready for ssh and editors, and show its host name | 16.4 KB
|
| CLI reference | `/docs/cli/devvm_images_rm/` | devvm images rm |
Delete images, by name or by key | 15.9 KB |
| CLI reference | `/docs/cli/devvm_images/` | devvm images | List the
images and the shared tools | 15.9 KB |
| CLI reference | `/docs/cli/devvm_layer_add/` | devvm layer add | Make
this folder's VM again with more layers, then open a shell in it | 16.6
KB |
| CLI reference | `/docs/cli/devvm_layer_new/` | devvm layer new | Start
a layer of your own | 15.8 KB |
| CLI reference | `/docs/cli/devvm_layer_rm/` | devvm layer rm | Make
this folder's VM again without some of its layers, then open a shell in
it | 16.6 KB |
| CLI reference | `/docs/cli/devvm_layer/` | devvm layer | Make image
layers of your own, or change this folder's VM's layers | 16.6 KB |
| CLI reference | `/docs/cli/devvm_limactl/` | devvm limactl | Run
Lima's limactl for debugging, which starts VMs unconfined, whatever
their tier | 16.6 KB |
| CLI reference | `/docs/cli/devvm_link_add/` | devvm link add | Link
this folder's VM to a port of another VM | 16.0 KB |
| CLI reference | `/docs/cli/devvm_link_publish/` | devvm link publish |
Show or add the ports this folder's VM offers to links | 16.3 KB |
| CLI reference | `/docs/cli/devvm_link_rm/` | devvm link rm | Remove
one of this folder's VM's links | 15.8 KB |
| CLI reference | `/docs/cli/devvm_link_unpublish/` | devvm link
unpublish | Stop offering ports of this folder's VM to links | 16.1 KB |
| CLI reference | `/docs/cli/devvm_link/` | devvm link | List this
folder's VM's links to your other VMs | 16.0 KB |
| CLI reference | `/docs/cli/devvm_ls/` | devvm ls | List the project
VMs | 15.7 KB |
| CLI reference | `/docs/cli/devvm_network_allow/` | devvm network allow
| Allow hosts for this folder's VM | 15.9 KB |
| CLI reference | `/docs/cli/devvm_network_deny/` | devvm network deny |
Deny hosts for this folder's VM | 15.9 KB |
| CLI reference | `/docs/cli/devvm_network_log/` | devvm network log |
Show what this folder's VM connected to and what its proxy blocked |
16.5 KB |
| CLI reference | `/docs/cli/devvm_network_rm/` | devvm network rm |
Remove rules from this folder's VM | 15.8 KB |
| CLI reference | `/docs/cli/devvm_network/` | devvm network | Show or
change the network tier of this folder's VM | 16.2 KB |
| CLI reference | `/docs/cli/devvm_ports_add/` | devvm ports add |
Forward more ports from this folder's VM | 16.0 KB |
| CLI reference | `/docs/cli/devvm_ports_rm/` | devvm ports rm | Stop
forwarding some ports from this folder's VM | 16.1 KB |
| CLI reference | `/docs/cli/devvm_ports/` | devvm ports | Show or
change which ports this folder's VM forwards | 16.3 KB |
| CLI reference | `/docs/cli/devvm_rebuild/` | devvm rebuild | Build an
image again, and delete the old one | 16.0 KB |
| CLI reference | `/docs/cli/devvm_restart/` | devvm restart | Restart
this folder's VM and open a shell in it | 16.0 KB |
| CLI reference | `/docs/cli/devvm_retention/` | devvm retention | Show
or change what devvm deletes on its own | 15.9 KB |
| CLI reference | `/docs/cli/devvm_rm/` | devvm rm | Delete this
folder's VM, or a VM whose folder is gone | 16.1 KB |
| CLI reference | `/docs/cli/devvm_secret_rm/` | devvm secret rm |
Delete a saved secret | 15.7 KB |
| CLI reference | `/docs/cli/devvm_secret_set/` | devvm secret set |
Save a secret on this machine | 15.8 KB |
| CLI reference | `/docs/cli/devvm_secret_unuse/` | devvm secret unuse |
Stop this folder's VM using a secret | 16.0 KB |
| CLI reference | `/docs/cli/devvm_secret_use/` | devvm secret use | Let
this folder's VM use a secret | 15.8 KB |
| CLI reference | `/docs/cli/devvm_secret/` | devvm secret | List the
secrets kept on this machine, for VMs to use | 16.2 KB |
| CLI reference | `/docs/cli/devvm_setup/` | devvm setup | Choose base's
features, and new VMs' size, network tier, coding agents and layers |
16.6 KB |
| CLI reference | `/docs/cli/devvm_size/` | devvm size | Show or change
this folder's VM's size | 15.9 KB |
| CLI reference | `/docs/cli/devvm_space/` | devvm space | Show what
devvm keeps on this machine and the space it takes | 16.3 KB |
| CLI reference | `/docs/cli/devvm_ssh-agent_add/` | devvm ssh-agent add
| Load a key into devvm's own SSH agent | 16.0 KB |
| CLI reference | `/docs/cli/devvm_ssh-agent_rm/` | devvm ssh-agent rm |
Remove a key from devvm's own SSH agent | 16.0 KB |
| CLI reference | `/docs/cli/devvm_ssh-agent/` | devvm ssh-agent | Show
or change SSH agent forwarding for this folder's VM | 16.4 KB |
| CLI reference | `/docs/cli/devvm_stop/` | devvm stop | Stop this
folder's VM | 15.6 KB |
| CLI reference | `/docs/cli/devvm_tools_add/` | devvm tools add | Add
shared tools to this folder's VM, then open a shell in it | 16.3 KB |
| CLI reference | `/docs/cli/devvm_tools_rm/` | devvm tools rm | Take
shared tools out of this folder's VM, then open a shell in it | 16.3 KB
|
| CLI reference | `/docs/cli/devvm_tools_update/` | devvm tools update |
Move this folder's VM to the newest shared tools, then open a shell in
it | 16.5 KB |
| CLI reference | `/docs/cli/devvm_tools/` | devvm tools | Show or
choose this folder's VM's shared tools | 15.9 KB |
| CLI reference | `/docs/cli/devvm_update/` | devvm update | Bring this
folder's VM up to date, then open a shell in it | 16.3 KB |
| CLI reference | `/docs/cli/devvm_upgrade/` | devvm upgrade | Install
devvm's newest release | 15.8 KB |
| CLI reference | `/docs/cli/devvm/` | devvm | Open a shell in this
folder's VM, creating it first | 16.1 KB |
| Docs | `/docs/cli/` | CLI reference | Every devvm command, with its
arguments and flags | 16.1 KB |
| Docs | `/docs/contributing/` | Contributing | Build devvm, run its
tests and follow its rules | 15.8 KB |
| Contributing | `/docs/contributing/maintaining/` | Maintaining | Bump
pinned versions, release devvm and run the docs sites | 16.3 KB |
| Contributing | `/docs/contributing/testing/` | Testing on other hosts
| Run devvm's tests on Linux, x86_64 and other hosts | 16.3 KB |
| Getting started | `/docs/getting-started/commands/` | Everyday
commands | The commands you use most, in their groups | 16.0 KB |
| Getting started | `/docs/getting-started/first-vm/` | Your first VM |
Make a project's VM and start an agent in it | 16.0 KB |
| Docs | `/docs/getting-started/` | Getting started | From installing
devvm to your first VM | 15.9 KB |
| Getting started | `/docs/getting-started/install/` | Installing |
Install devvm and check what it needs | 15.8 KB |
| (none) | `/docs/` | Docs | The guides, in the order you'll need them |
15.6 KB |
| How it works | `/docs/internals/backends/` | Backends | What a backend
gives devvm, and how VMs are named | 16.1 KB |
| How it works | `/docs/internals/design/` | Design notes | Why devvm is
built this way, and what's open | 15.9 KB |
| How it works | `/docs/internals/desktop/` | The desktop | How devvm
desktop serves a VM's desktop | 15.9 KB |
| How it works | `/docs/internals/git-protection/` | .git protection |
What devvm locks in .git, and when | 15.9 KB |
| How it works | `/docs/internals/images/` | Images and caching | How
images and shared tools are built and cached | 16.2 KB |
| Docs | `/docs/internals/` | How it works | How devvm works, for
reviewers and contributors | 15.9 KB |
| How it works | `/docs/internals/install/` | Installing and updating |
What the install script and devvm doctor check | 16.1 KB |
| How it works | `/docs/internals/lima/` | Lima | How devvm sets up,
confines and clones Lima's VMs | 16.0 KB |
| How it works | `/docs/internals/network/` | Network tiers | How the
proxy confines VMs and keeps your secrets | 16.2 KB |
| How it works | `/docs/internals/overview/` | Overview | What devvm
does at each step of a VM's life | 15.8 KB |
| How it works | `/docs/internals/ports/` | Port forwarding | How devvm
forwards a VM's ports to this machine | 16.1 KB |
| How it works | `/docs/internals/security/` | Security model | What
devvm protects, how, and what it doesn't | 16.0 KB |
| Staying safe | `/docs/safety/attack-vectors/` | Attack vectors |
Common attacks, and what devvm does about each | 15.9 KB |
| Staying safe | `/docs/safety/git-protection/` | .git protection | Keep
code in the VM out of your .git | 16.0 KB |
| Docs | `/docs/safety/` | Staying safe | How devvm keeps untrusted code
off your machine | 16.0 KB |
| Staying safe | `/docs/safety/network/` | Network tiers | Choose what
each VM can reach on the network | 15.9 KB |
| Using devvm | `/docs/using/clone/` | Working on a clone | Give a VM
its own clone of the repo | 15.9 KB |
| Using devvm | `/docs/using/coding-agents/` | Coding agents | Run
Claude Code, Codex and opencode in a VM | 16.0 KB |
| Using devvm | `/docs/using/command-line/` | The command line | Help,
flags, questions, JSON output and completion | 16.3 KB |
| Using devvm | `/docs/using/customizing/` | Customizing images | Add
your own layers and choose base's features | 16.1 KB |
| Using devvm | `/docs/using/desktop/` | A VM's desktop | Add a desktop
to a VM and open it | 15.8 KB |
| Using devvm | `/docs/using/devcontainer/` | devcontainer.json | Set up
a VM from a project's devcontainer.json | 16.1 KB |
| Using devvm | `/docs/using/from/` | Starting from a container image |
Start base from a Debian, Ubuntu or Alpine image | 16.6 KB |
| Using devvm | `/docs/using/images/` | Images and tools | The images
VMs are made from, and their tools | 16.1 KB |
| Docs | `/docs/using/` | Using devvm | What you change in your VMs as
you work | 15.9 KB |
| Using devvm | `/docs/using/limits/` | Known limits | What devvm can't
do, and where | 15.7 KB |
| Using devvm | `/docs/using/links/` | Links between VMs | Let one VM
reach a service in another by name | 16.1 KB |
| Using devvm | `/docs/using/ports-size/` | Ports and size | Forward a
VM's ports and change its size | 15.9 KB |
| Using devvm | `/docs/using/settings/` | Settings and files | The files
you edit and the files devvm keeps | 16.2 KB |
| Using devvm | `/docs/using/space/` | What devvm keeps on this machine
| Each file devvm keeps, and how it's cleaned up | 16.5 KB |
| Using devvm | `/docs/using/ssh/` | SSH and editors | Reach VMs by name
from ssh and VS Code | 15.9 KB |
| Using devvm | `/docs/using/toolchains/` | Toolchains | The toolchains
VMs get, and the files that choose them | 16.2 KB |
| Using devvm | `/docs/using/troubleshooting/` | Troubleshooting | What
to do when something fails | 15.9 KB |
| Using devvm | `/docs/using/upgrading/` | Upgrading and uninstalling |
Upgrade devvm, or remove it and what it keeps | 16.5 KB |
| Using devvm | `/docs/using/vms/` | Managing VMs | Open, stop, delete
and list your VMs | 15.9 KB |
| (none) | `/` | One VM for every project | An isolated sandbox for you
or a coding agent | 16.1 KB |
| (none) | `/tags/` | Tags | (none) | 14.9 KB |

## How it was tested

- `mise run fmt && mise run lint && mise run test` passes on macOS.
`mise run lint:docs` passes: markdownlint, Vale, lychee, `TestDocLinks`,
`TestCommandLines`, `TestExplainers` and the `--panicOnWarning` build.
- I built devvm.dev and next.devvm.dev, checked that every HTML page has
exactly one `og:image`, and opened the cards for the home page, a short
title, the longest title, the longest CLI explainer, a section index, a
How it works page and the 404. I checked each card's color histogram:
four colors, so there's no antialiasing and no marks from the template.
- No e2e: the change is docs only.

## Checklist

- [x] The title is a Conventional Commit, `type(scope): summary`,
because it becomes the squashed commit's subject.
- [x] `mise run fmt && mise run lint && mise run test` passes.
- [x] New behaviour has tests, and every behaviour change updates its
page in `docs/content/docs/`.
- [x] A changed command follows the cli skill, and `mise run cli-docs`
is rerun when its help changed. (No command changed. `cli-docs` was
rerun for the generated explainers.)
- [x] Nothing here belongs in a private security advisory instead (see
SECURITY.md).

**Ready to merge:** the previews are removed and main (#25) is merged
in. The gate passes on macOS (2362 tests).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-07 15:17:55 -07:00
Jürgen ŠuvalovandClaude Fable 5.1 72f6284eb9 fix(lima): VM names leave the NUL byte out of the ssh socket's path (#25)
`NameMax` budgets for `paths.SocketMax - 1`, as
`ControlMax` does, and the Lima package's own copy of the limit goes, so
`paths.SocketMax` is the one owner. On the edge case above, devvm now
picks a one-character-shorter folder part,
`devvm-jyrkki-webs-fbe3918054ffd3`, and the VM is made. The Lima limits
page says a socket path has fewer than 104 characters.

Co-authored-by: Claude Fable 5.1 <[email protected]>
2026-11-07 15:01:08 -07:00
CJandClaude Opus 5.5 72b648df31 feat(release): prereleases on the Homebrew tap, as devvm-rc (#19)
Prereleases now reach the Homebrew tap through a second formula, `devvm-rc`. The stable `devvm` formula stays on the last final release.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-07 11:36:20 -07:00
CJ c27b913b17 build(release): 0.1.1-rc.1, and its changelog entry (#18)
VERSION is 0.1.1-rc.1, and CHANGELOG.md has its entry, which becomes the release candidate's notes on GitHub.

Refs #1
2026-11-07 11:03:56 -07:00
CJandClaude Opus 5.5 8d8da01037 feat(tools): dotnet, the .NET SDK, as a shared toolchain (#7)
Adds `dotnet`, the .NET SDK, as a fifth shared toolchain next to node,
python, rust and go. `--tools dotnet`, `devvm tools add dotnet` and the
picker offer it, and a folder with `*.sln`, `*.slnx`, `*.csproj`,
`*.fsproj` or `global.json` at its top level suggests it in the new VM's
summary, the way `package.json` suggests node.

Refs #2. Thanks to @jsskeen-utah for the detailed request.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-07 10:44:25 -07:00
CJandClaude Opus 5.5 da804f0568 ci: devvm.dev shows the latest release's docs, next.devvm.dev shows main's (#16)
Two docs sites, from one Docs workflow (`.github/workflows/docs.yml`):

- **devvm.dev** shows the latest release's docs. The `release` job
builds a tag's `docs/` and the `deploy` job deploys it to GitHub Pages
(`github-pages` environment), on a published release that isn't a
prerelease, and on a `workflow_dispatch` with `site=devvm.dev` and `ref`
(a release tag; empty means the latest release, from `gh release view`).
The tag is checked against `^v[0-9]+\.[0-9]+\.[0-9]+$` through `env:`
before it's used, and checked out as `refs/tags/<tag>`. Pushes to main
no longer deploy devvm.dev.
- **next.devvm.dev** shows main's docs. On pushes to main that touch the
docs (the same paths anchor), or a dispatch with `site=next.devvm.dev`,
`check` lints and builds, then `next` builds with `hugo -s docs --minify
--config hugo.yaml,next.yaml`, checks out devvmhq/docs-next with
`DOCS_NEXT_DEPLOY_KEY` (environment `docs-next`, only after the build),
replaces everything but README.md, and commits `Build from devvm <short
sha>` as github-actions[bot], skipping an unchanged build. Its
concurrency group keeps pushes from racing.
- `docs/next.yaml` sets `baseURL: https://next.devvm.dev/`, Hextra's
`params.banner` (a note that links devvm.dev), and `noindex` both as a
site param and through `cascade`, so Hextra's head writes `noindex,
nofollow` on every page. `docs/layouts/robots.txt` adds `Disallow: /`
when the site's `noindex` is set. The build stays in Hugo's production
environment, so Hextra's minified, fingerprinted assets are the same as
devvm.dev's.
- PRs get the same lint and build as before, and nothing runs with an
environment or a secret on `pull_request`. Permissions: `contents: read`
at the top; only `deploy` has `pages: write` and `id-token: write`. The
publishing jobs set `cache: false` on mise-action (zizmor's
cache-poisoning, now that the workflow publishes on `release`), and so
does `check`.
- Docs: Contributing's Maintaining has a new section, The docs sites
(what deploys each, the hand redeploy, the key and environments,
Cloudflare Pages serving devvmhq/docs-next); Contributing's two mentions
of the deploy point at it; Upgrading's Trying a prerelease links
next.devvm.dev.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-07 09:02:34 -07:00
CJandClaude Opus 5.5 b3a188712f fix(tools): the host's mise trusts the system's and devvm's CAs (#9)
devvm's host mise didn't trust the CAs in ~/.config/devvm/ca, so behind a
network that inspects TLS, resolving the shared tools' versions failed with
UnknownIssuer and a message to check the connection.

The host mise and its download now trust the folder's checked CAs: mise gets
them as MISE_EXTRA_CA_CERTS, and on Linux also an SSL_CERT_FILE bundle of the
system's roots plus those CAs (SSL_CERT_DIR only when the user set neither
variable). On macOS, mise's Sigstore client still needs the CA trusted in the
Keychain, as the docs say. A certificate failure now shows tools_untrusted,
pointing at the CA docs.

Refs #1

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-07 08:33:56 -07:00
CJandClaude Opus 5.5 63e41118c6 feat(release): release candidates and betas, as GitHub prereleases (#13)
devvm can ship prereleases, such as release candidates and betas, for
people to try before a release is out. A prerelease's version is
`x.y.z-<word>.N`, such as `0.2.0-rc.1` or `0.2.0-beta.2`. `VERSION`
holds it, the tag is `v0.2.0-rc.1`, and it gets a `CHANGELOG.md` entry
as usual.

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-06 23:36:15 -07:00
CJandClaude Opus 5.5 3c4e90da0c fix(tools): opencode's backend is named, so mise's registry can't move it to npm (#10)
## What this changes

**The cause.** The pin bump in 588ba6f9 moved devvm's mise, on the host
and in VMs, from 2026.10.7 to 2026.11.3. Starting with mise 2026.10.9
(jdx/mise#14295), mise's registry puts npm first for opencode 2.x. Here
is `registry/opencode.toml` at each version:

```toml
# v2026.10.7
backends = ["aqua:anomalyco/opencode"]

# v2026.11.3
backends = [
  { full = "npm:@opencode/cli", min_version = "2.0.0", options = { allow_builds = ["@opencode/cli"] } },
  "aqua:anomalyco/opencode",
]
```

devvm named opencode only as `opencode = "2"`, so mise 2026.11.3
resolved it to `npm:@opencode/cli`. That lock entry has no download for
any platform. As a result, every resolve warned that opencode 2.2.5
isn't published for every platform, opencode's tool image couldn't be
built, and the e2e check "the shared tools resolve to upstream's newest"
failed on every machine. opencode's GitHub releases still ship v2
binaries for every platform, musl included, along with a `SHA256SUMS`.

**The fix.** `assets/shared-tools/mise.toml` now has a `[tool_alias]`
table. It names the backend of every shared tool that isn't one of
mise's own `core:` tools, so the registry's choice can't move them:

- `opencode = "github:anomalyco/opencode"`: its GitHub releases. With
mise 2026.11.3, the aqua backend now gives opencode.ai URLs, and on musl
it gives the glibc tarball. The github backend gives musl VMs opencode's
own `-musl` build and records `provenance = "github-attestations"`.
- `claude`, `codex`, `pnpm` and `uv` keep the aqua backends they already
resolve to, so their lock entries are unchanged. They are named because
each of them already lists a second backend in the registry (http, npm,
npm, and asdf/pipx). That is how opencode's switch happened.
- node, bun, python, go and rust are mise's `core:` tools. None of them
changed between 2026.10.7 and 2026.11.3, so they are not aliased.

The other two places where mise picks a backend now follow the same
table:

- The step back (`lockVersions`) locks older versions from the backend
the newest one came from.
- Each project VM's `/etc/mise/config.toml` gets the same table, sent as
`tool-alias.toml` in the setup. Without it, the VM's mise 2026.11.3
reports opencode's backend as npm, and a non-shared version would be
installed from npm.

`tests/e2e-mise.lock` was resolved again with mise 2026.11.3 through
`scripts/bump.sh e2e-tools`. It now has lockfile version 4 and opencode
from GitHub. codex stays at 0.166.0, because mise's latest for codex is
still the older 0.163.0.

**The guard.** `TestToolBackendsNamed` fails in two cases: when a shared
tool that isn't on a `core:` backend has no `[tool_alias]` entry, and
when an alias isn't the backend that `tests/e2e-mise.lock` resolved. On
main it would have failed for claude, codex, opencode, pnpm and uv. The
existing download-per-platform check (`TestE2ELockPins`) couldn't catch
this regression, because the e2e lock had never been resolved again with
2026.11.3. `TestAliases` covers the VM's table, and
`TestRefreshStepsBack` now checks the step back's `mise.toml`.

Docs: internals/images.md (Versions) explains the aliases.
contributing/maintaining.md says where a new shared tool's alias goes
and what the test checks.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-06 18:52:16 -07:00
CJandClaude Opus 5.5 062c89c913 ci: the docs deploy from main only when the docs change (#12)
## What this changes

The Docs workflow deploys from `main` only when a push changes the docs:
`docs/**`, Markdown files, the Vale and markdownlint config, or
`docs.yml` itself. Both triggers use one path list (a YAML anchor), so
they can't drift apart. `workflow_dispatch` still deploys by hand.

Why it's safe:
- The site is built from `docs/` alone; Hugo mounts nothing outside it.
- The generated CLI reference is in `docs/content/docs/cli/`, and
`TestReferenceIsCurrent` makes a help change commit it there, so those
pushes still deploy.
- The Hextra theme's version is in `docs/go.mod`, so its updates still
deploy.
- CI's `mise run lint` runs the docs checks (Vale, markdownlint,
`TestDocLinks`, `TestCommandLines`) on every code change, so skipping
this workflow loses no checking.

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-06 18:50:29 -07:00
dependabot[bot] a965e68651 build(deps): bump github.com/spf13/pflag from 1.0.9 to 1.0.10 in the go group across 1 directory (#8)
Updates github.com/spf13/pflag from 1.0.9 to 1.0.10: a deprecation comment fix (spf13/pflag#447) and no errors.Is, for old Go versions (spf13/pflag#448).

https://github.com/spf13/pflag/compare/v1.0.9...v1.0.10

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-06 18:33:05 -07:00
w3cjandClaude Opus 5.5 770cb99329 build(deps): go-i18n 2.7.0, and pflag stays on 1.0.x
pflag 1.1 prints every boolean flag as --flag[=true|false] in the help, with no way to turn
it off, so Dependabot ignores pflag 1.1 and later.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 12:53:26 -07:00
w3cjandClaude Opus 5.5 588ba6f9a1 build: bump docker 29.9.3, mise 2026.11.3, rustup 1.29.3, oh-my-bash, tealdeer 1.9.1 and the --from digests
docker 29.9.3, containerd 2.4.2, buildx 0.38.1, compose 5.7.0, model 1.2.9;
mise 2026.11.3 (VMs and the host mise); rustup 1.29.3; oh-my-bash 94c2977;
tealdeer 1.9.1; e2e's node:24 and alpine:3 digests. Every checksum is from
upstream's published sums.

bump.sh's value check now knows a Go constant's camelCase *Digest name, which
it refused before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 11:53:56 -07:00
w3cjandClaude Opus 5.5 1276474123 ci: a weekly check of the pins scripts/bump.sh keeps, as an issue
Mondays, scripts/bump.sh --check runs and its outdated lines go into one
open issue, "Pinned versions to bump", created or updated with gh and
--body-file; with none left the issue is closed. bump.sh's output passes
through files only. maintaining.md says what to do with it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 11:36:38 -07:00
w3cjandClaude Opus 5.5 22387c5b78 fix(scripts): bump.sh --check never offers an older version as the latest
When upstream's latest is a version older than the pin (a release marker
that lags, as codex's and opencode's have), report() says the pin is newer
and neither counts it as outdated nor bumps it. Digests and dated releases
are compared as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 11:32:37 -07:00
w3cjandClaude Opus 5.5 c3a262bec9 ci: Dependabot's updates come monthly
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 11:31:30 -07:00
w3cjandClaude Opus 5.5 5fb0732580 ci: Dependabot's weekly updates for Go modules and pinned actions, a week after each release
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 11:25:51 -07:00
w3cjandClaude Opus 5.5 1a6d653431 chore(github): a pull request template, and every pull request asks the maintainer for a review
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 11:25:51 -07:00
w3cjandClaude Opus 5.5 57cf548b31 ci: pull request titles follow Conventional Commits, as squash merges take them as the subject
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 11:18:53 -07:00
w3cjandClaude Opus 5.5 b24da31e41 build: Lima 2.3 in CI, bump.sh e2e-lima, and Lima 2.2 as devvm's minimum
CI's e2e workflow installs Lima 2.3.0, its tarball's checksum taken from the release's SHA256SUMS, checked against the sha256 Lima's release notes publish. scripts/bump.sh e2e-lima moves that pin the same way. devvm's doctor, install.sh, the README and the Lima page ask for Lima 2.2 or newer, compared by major and minor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 09:57:01 -07:00
w3cjandClaude Opus 5.5 f3e4753445 build(release): the Homebrew formula installs the release's signed binary
The formula has an archive per platform (macOS and Linux, arm64 and
Intel), each URL and checksum filled in by release.sh from the
SHA256SUMS it wrote, and installs only the binary; no Go dependency.
release.sh --formula-from DIR writes the formula for a published
release from its downloaded SHA256SUMS, checked against minisign.pub.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-06 09:34:18 -07:00
846 changed files with 48125 additions and 4782 deletions

No files matched your search

+9 -9
View File
@@ -9,22 +9,22 @@ devvm's command line should be easy to learn: once you know a few commands, you
The reasoning behind most rules is in the [Command Line Interface Guidelines](https://clig.dev/), and the mechanics of commands, flags and groups are in [Cobra's docs](https://cobra.dev/docs/). Read them there, because this skill doesn't restate them. It says only what devvm decided and how devvm's code does it.
[judgment.md](judgment.md) explains, with examples, the rules that no test can check: where a command goes, rm or unX, which commands are settings, what an argument is, what a destructive command does, and how help and usage errors are worded. [Contributing](../../../docs/content/docs/contributing/_index.md) covers the code: [Command arguments](../../../docs/content/docs/contributing/_index.md#command-arguments) for the checks in `internal/cli/args.go`, [JSON output](../../../docs/content/docs/contributing/_index.md#json-output) for `--json`, [A command's help](../../../docs/content/docs/contributing/_index.md#a-commands-help) for help and groups, and [The CLI rule tests](../../../docs/content/docs/contributing/_index.md#the-cli-rule-tests) for what each test checks.
[judgment.md](judgment.md) explains, with examples, the rules that no test can check: where a command goes, rm or unX, which commands are settings, what an argument is, what a destructive command does, and how help and usage errors are worded. [Contributing](../../../docs/content/docs/contributing/_index.md) covers the code: [Command arguments](../../../docs/content/docs/contributing/cli.md#command-arguments) for the checks in `internal/cli/args.go`, [JSON output](../../../docs/content/docs/contributing/cli.md#json-output) for `--json`, [A command's help](../../../docs/content/docs/contributing/docs.md#a-commands-help) for help and groups, and [The CLI rule tests](../../../docs/content/docs/contributing/cli.md#the-cli-rule-tests) for what each test checks.
## The tree
devvm has 33 commands at the top, plus help. Each one is in a group of the root's help, in this order. The table shows each command with its subcommands and the values a setting takes, and each command's help lists its flags.
devvm has 34 commands at the top, plus help. Each one is in a group of the root's help, in this order. The table shows each command with its subcommands and the values a setting takes, and each command's help lists its flags.
| Group | Commands |
| --- | --- |
| Your VM | devvm, with --tools, --agents and --layers; restart, stop, update, rm [VM], adopt [VM], ls, code, desktop, host, history, history export [FILE], history import [FILE] |
| Change your VM | tools (a picker in a terminal), tools add\|rm TOOL..., tools update; size, with --cpus, --memory and --disk; ports [all\|none\|LIST], ports add\|rm LIST; network [open\|internet\|allowlist\|none], network allow\|deny\|rm RULE..., network log; ssh-agent [on\|devvm\|off], ssh-agent add\|rm KEY_FILE; git-protect [on\|strict\|off]; clone [on\|off]; secret, secret set\|rm\|use\|unuse NAME; layer add\|rm LAYER... |
| Change your VM | tools (a picker in a terminal), tools add\|rm TOOL..., tools update; size, with --cpus, --memory and --disk; mount-cache [none]; ports [all\|none\|LIST], ports add\|rm LIST; network [open\|internet\|learn\|allowlist\|none], network allow\|deny\|rm RULE..., network log, network lock, network transparent [on\|off]; ssh-agent [on\|devvm\|off], ssh-agent add\|rm KEY_FILE; git-protect [on\|off]; clone [on\|off], clone fetch, clone add PATH; secret, secret set\|rm\|use\|unuse NAME; layer add\|rm LAYER... |
| Links between VMs | group, group join NAME, with --as NAME, group leave; link, link add\|rm TARGET PORT, with --as NAME on add; link publish [PORTS], link unpublish PORTS |
| Images | images, images rm IMAGE\|KEY..., build IMAGE, rebuild IMAGE, layer new NAME |
| Disk space | space, gc, retention [KEY=VALUE...] |
| This machine | setup, agent, agent import [AGENT...], agent login AGENT, agent save [AGENT...], doctor, upgrade, completion SHELL, limactl [ARGS...] |
size, ports and network take `-g` for what new VMs get. Every command takes `-h`/`--help`, `--no-input` and `-v`/`--verbose`, and the root takes `--version`. `devvm --help` prints the tree as it is, and `commandGroups` in `internal/cli/help.go` holds the groups. A subcommand can sit in a group other than its parent's, as layer add and layer rm do, and `devvm --help` then lists it by both names in that group.
size, ports and network take `-g` for what new VMs get. Every command takes `-h`/`--help`, `--no-input` and `-v`/`--verbose`, and the root takes `--version`. `devvm --help` prints the tree as it is. `helpGroups` in `internal/cli/help.go` holds the groups, in order, and each command names its own group in its `about`. A subcommand can sit in a group other than its parent's, as layer add and layer rm do, and `devvm --help` then lists it by both names in that group.
## The rules
@@ -54,12 +54,12 @@ Work through this list for each new command, in order, then run [the review](#re
4. **Add its flags** in the command's own `Flags()`, reusing an adder from `internal/cli/flags.go` or a flag name that already means the same thing. A new flag name means one thing, and its help text is lower case without a full stop, with its value as a backticked placeholder, such as ``the `N` CPUs the VM gets``. Check a flag's value in `checkFlagValue` and flags that can't go together with `exclusive`.
5. **Settings:** when the command shows a setting bare and changes it with a value, wrap its `Args` in `showsOnly`, and give it `-g` (`--global`) when new VMs have a default for it ([settings](judgment.md#settings)).
6. **Questions:** every question the command asks needs a flag or a command that answers it beforehand, declared where it's asked: `u.Ask(msg.X(...).AnsweredBy("--flag"))`, so its refusal names it. A command that deletes takes `addForceFlag`, asks only without `--force`, with `AnsweredBy("--force")`, and returns the question's error ([destructive commands](judgment.md#destructive-commands)).
7. **Output:** when it shows or lists something, give it `jsonFlag`, a struct of its own with snake_case `json` tags, `printJSON`, a row in `TestJSONShapes` and a section with an example on its docs page. Otherwise add it to `withoutJSON` in `internal/cli/json_test.go` with why.
8. **Help:** write a `Short`, a `Long` of one to three sentences and an `Example` from `examples()`, with the docs-voice skill ([help](judgment.md#help)). Add its path to `commandDocs` in `internal/msg/docs.go`, pointing at the user page that covers it, and add a root command to its group in `commandGroups`.
7. **Output:** when it shows or lists something, give it `jsonFlag`, a struct of its own with snake_case `json` tags, `printJSON`, a row in `TestJSONShapes` and a section with an example on its docs page. Otherwise say why it has none in its `about`'s `noJSON`, such as `noJSON: "it deletes"`.
8. **Help:** write a `Short`, a `Long` of one to three sentences and an `Example` from `examples()`, with the docs-voice skill ([help](judgment.md#help)). Set its `Annotations` from an `about` (`internal/cli/help.go`): `docs`, the user page that covers it as `page#anchor`, and for a root command its `group`, one of `helpGroups`, such as `Annotations: about{docs: "using/vms#listing-vms", group: groupVM}.annotations()`.
9. **Messages:** every message goes in `locales/en.toml`, with the docs-voice skill's Messages rules, and then `go generate ./internal/msg`. A usage error names what the command expected ([usage errors](judgment.md#usage-errors)). The command fails by returning its error from `RunE`, as `failed(err, msg.XFailed)` when the error may not be a message, or through `a.env`, which does the same, and never prints the failure itself, because `execute` shows it (`TestExecuteShowsEachFailure`).
10. **Register it** with `AddCommand` in `NewRoot` (`internal/cli/root.go`) or under its noun, and write it in its own file, `internal/cli/<command>.go`, named in AGENTS.md's Layout row for `internal/cli`.
11. **Tests:** add a CLI test in `testdata/script/` for what it does and for each refusal, with `DEVVM_MESSAGES=names`. Add the command's arguments to `argSamples` in `internal/cli/args_test.go` when `TestUseMatchesArgs` asks for them.
12. **Docs:** add the command to its group's table on the Commands page (`docs/content/docs/getting-started/commands.md`), and to the page that `commandDocs` names, with the docs-voice skill. Then run `mise run cli-docs` and commit the pages it writes.
10. **Register it** with `AddCommand` in `NewRoot` (`internal/cli/root.go`) or under its noun, and write it in its own file, `internal/cli/<command>.go`, with what completes its arguments and flags (`ValidArgsFunction`, `RegisterFlagCompletionFunc`) set there too.
11. **Tests:** add a CLI test in `testdata/script/` for what it does and for each refusal, with `DEVVM_MESSAGES=names`. Add a sample value to `argSamples` in `internal/cli/args_test.go` when `TestUseMatchesArgs` asks for one, for a placeholder no command had, and a command on this folder's VM to `folderCommands` in `internal/cli/flags_test.go`.
12. **Docs:** add the command to its group's table on the Commands page (`docs/content/docs/getting-started/commands.md`), and to the page its `about` names, with the docs-voice skill. Then run `mise run cli-docs` and commit the pages it writes.
13. **The gate:** `mise run fmt && mise run lint && mise run test`.
## Changing a command
+4 -4
View File
@@ -1,6 +1,6 @@
# The rules a reviewer checks
The tests in [The CLI rule tests](../../../docs/content/docs/contributing/_index.md#the-cli-rule-tests) check a command's shape: its names, its flags, its help's parts and its `--json`. They can't tell whether a command is in the right place, whether its arguments are the right ones, or whether its words help the user. Those choices are yours, and this page explains each one with examples from devvm's own commands. Each section ends with the question to ask in a review.
The tests in [The CLI rule tests](../../../docs/content/docs/contributing/cli.md#the-cli-rule-tests) check a command's shape: its names, its flags, its help's parts and its `--json`. They can't tell whether a command is in the right place, whether its arguments are the right ones, or whether its words help the user. Those choices are yours, and this page explains each one with examples from devvm's own commands. Each section ends with the question to ask in a review.
## Where a command goes
@@ -34,11 +34,11 @@ Don't name a command `delete`, `remove` or `disable`, because rm and unX cover t
A setting is a value devvm keeps, which a user reads and changes. Each setting is one command that does both:
- **Bare, it shows the value.** devvm size shows the VM's CPUs, memory and disk, devvm ports shows what it forwards, and devvm git-protect shows its `.git` protection.
- **With a value, it changes it.** devvm ports none, devvm network open, devvm ssh-agent devvm and devvm git-protect strict each set the value. devvm size takes its values as `--cpus`, `--memory` and `--disk`, because it holds three, and devvm retention takes `KEY=VALUE` words, because it holds many.
- **With a value, it changes it.** devvm ports none, devvm network open, devvm ssh-agent devvm and devvm git-protect off each set the value. devvm size takes its values as `--cpus`, `--memory` and `--disk`, because it holds three, and devvm retention takes `KEY=VALUE` words, because it holds many.
- **With `-g`, it shows or changes what new VMs get.** devvm size -g --memory 16, devvm ports -g none and devvm network -g none change the defaults. A setting takes `-g` only when new VMs get a default for it, so devvm git-protect, devvm ssh-agent and devvm clone have none, and devvm retention is about the whole machine.
- **With `--json`, it only shows.** `showsOnly` refuses a value, so devvm network --json off is a usage error and changes nothing.
The commands that are settings are size, ports, network, ssh-agent, git-protect, clone and retention. devvm clone holds whether the VM has its own clone of the repo, the setting `--clone` gives a new VM, and setting it makes the VM again, as devvm layer add does. tools isn't one, because its value is a list that devvm tools add and devvm tools rm change, and that devvm tools shows in a terminal as a picker whose changes become add and rm. setup isn't one either: it asks the first-run questions, and its flags, `--features` and `--agents`, answer the two that no other command sets.
The commands that are settings are size, mount-cache, ports, network, network transparent, ssh-agent, git-protect, clone and retention. devvm mount-cache holds how a Linux host's VM caches its project folder, and takes one value, none, the only mode devvm sets, as a word rather than a bare opt-in command, so it reads as what it shows and stays the same should another mode be worth setting. It has no `-g`, because every new VM gets none. devvm network transparent has no `-g` either: a VM without its own value follows config.toml's `transparent-proxy` as it is at each launch, so there's no default new VMs take. devvm clone holds whether the VM has its own clone of the repo, the setting `--clone` gives a new VM, and setting it makes the VM again, as devvm layer add does. tools isn't one, because its value is a list that devvm tools add and devvm tools rm change, and that devvm tools shows in a terminal as a picker whose changes become add and rm. setup isn't one either: it asks the first-run questions, and its flags, `--features` and `--agents`, answer the two that no other command sets.
A command is a setting when its bare form shows one value and the user can type the new value after its name. When the value is a list that grows and shrinks, give it add and rm, as devvm ports has besides devvm ports LIST.
@@ -78,7 +78,7 @@ A command that takes out only what the user named, and what one command puts bac
A command's help is short, and its docs page holds the rest. Write it with the docs-voice skill.
- **`Short` is an action on a named thing.** "Delete this folder's VM", "Forward more ports from this folder's VM" and "Load a key into devvm's own SSH agent" each say what happens and to what. A noun's `Short` says what it shows: "List the secrets kept on this machine, for VMs to use". A settings command starts with "Show or change", as in "Show or change this folder's VM's size".
- **`Long` says what the command does in one to three sentences.** devvm rm's says what it deletes, that it asks in a terminal, and that it exports the agents' history unless `--no-export` is given. Edge cases, limits and how it works go on the docs page that `commandDocs` names.
- **`Long` says what the command does in one to three sentences.** devvm rm's says what it deletes, that it asks in a terminal, and that it exports the agents' history unless `--no-export` is given. Edge cases, limits and how it works go on the docs page that its `about` names.
- **The examples start with the common case.** devvm rm's first example is devvm rm, then devvm rm --force, then devvm rm --no-export. Each comment says what that line does, in lower case, such as "delete it without asking, as a script must". A noun's examples can show its subcommands, as devvm secret's show devvm secret set github.
- **A flag's help is a short phrase in lower case without a full stop,** with its value as a backticked placeholder, such as ``the `N` CPUs the VM gets``. A default goes at its end in parentheses, as in "(default: devvm ports -g, else all)".
- **The same thing has the same words everywhere.** Say this folder's VM, new VMs, devvm's own SSH agent and shared tools, as the docs-voice skill's Terms say. A flag shared between commands has one help text, unless `manyUses` in `internal/cli/flags_test.go` says why it differs.
+2 -2
View File
@@ -59,11 +59,11 @@ Messages use the same voice as the docs, only shorter, so the CLI reads like the
Use these terms on every page and in every message.
- **Secret** is the general term for what devvm keeps on this machine for VMs to use, as in devvm secret. The Staying safe and Network policy pages define it: "A secret is a credential devvm keeps on this machine for VMs to use: your GitHub token, Claude Code's token, an agent's login or an API key."
- **Name the secret when the specific one matters:** "GitHub token", "Claude Code token" (from claude setup-token), "API key", "Codex login" or "opencode login". Never write a bare "token" or "tokens", because agents use "tokens" for model tokens. The one exception is right after a prompt that names the token: after "GitHub token:", "You didn't paste a token" is clear.
- **Name the secret when the specific one matters:** "GitHub token", "Claude Code token" (from claude setup-token), "API key", "Codex login", "opencode login" or "pi's API key". Never write a bare "token" or "tokens", because agents use "tokens" for model tokens. The one exception is right after a prompt that names the token: after "GitHub token:", "You didn't paste a token" is clear.
- **Feature** on user pages means only base image features (omb, fzf, cli-tools) and devcontainer features. Backend features, which are native, emulated or none, appear only on the How it works pages. devvm doctor prints backend features as "features", so say so where a user page compares backends.
- **Image** means devvm's images, such as base or foo+bar. Say "container image" for the images that `--from` and a `devcontainer.json` start from.
- **Layer** means devvm's layers. Say "Docker's image layers" when you mean Docker's.
- **Shared tool** means node, python, rust, go, claude, codex or opencode.
- **Shared tool** means a toolchain or a coding agent that devvm shares read-only between VMs, such as node or claude: the toolchains page and the coding agents page's Supported agents table list them.
## Workflow
+3
View File
@@ -0,0 +1,3 @@
# Generated files: GitHub collapses them in diffs.
internal/msg/messages_gen.go linguist-generated=true
docs/content/docs/cli/** linguist-generated=true
+2
View File
@@ -0,0 +1,2 @@
# Every pull request asks the maintainer for a review.
* @w3cj
+7 -7
View File
@@ -1,5 +1,5 @@
name: Toolchain request
description: A language or runtime you'd like devvm to build in, such as .NET, Java, PHP, Ruby or Elixir.
description: A language or runtime you'd like devvm to build in, such as Java, PHP, Ruby or Elixir.
labels: ["enhancement", "toolchain", "triage"]
body:
- type: markdown
@@ -18,7 +18,7 @@ body:
attributes:
label: The toolchain
description: Its usual name, and its mise tool name if you know it (what `mise registry NAME` prints).
placeholder: .NET (mise's dotnet)
placeholder: Ruby (mise's ruby)
validations:
required: true
- type: textarea
@@ -26,7 +26,7 @@ body:
attributes:
label: Files that should pick it
description: The project files that tell devvm a folder needs this toolchain.
placeholder: "*.csproj, *.sln, global.json"
placeholder: "Gemfile, .ruby-version"
validations:
required: true
- type: textarea
@@ -41,25 +41,25 @@ body:
attributes:
label: Versions
description: Whether the latest is enough or you need several major versions, and which.
placeholder: The latest LTS, and 8 for older projects
placeholder: The latest, and 3.3 for older projects
- type: input
id: source
attributes:
label: Official install source
description: Where the toolchain's own builds come from.
placeholder: https://dotnet.microsoft.com/download
placeholder: https://www.ruby-lang.org/en/downloads/
- type: textarea
id: registries
attributes:
label: Package managers and their hosts
description: The package managers people use with it and the hosts they download from, which the toolchain's network policy lets through.
placeholder: "NuGet: api.nuget.org, globalcdn.nuget.org"
placeholder: "RubyGems: rubygems.org, index.rubygems.org"
- type: textarea
id: writes
attributes:
label: What it writes into its own folder
description: Global installs, plugins or self-updates that write into the toolchain's install folder, which devvm has to send somewhere else because shared tools are read-only in VMs.
placeholder: "`dotnet tool install -g` writes to ~/.dotnet/tools"
placeholder: "`gem install` writes into Ruby's own gems folder"
- type: dropdown
id: builds
attributes:
+35
View File
@@ -0,0 +1,35 @@
# Monthly updates, each ecosystem in one grouped pull request, for devvm's Go modules and the actions its workflows pin by SHA. Their titles follow
# Conventional Commits, as the PR title check asks. Pinned downloads in assets/, the shared tools' lock
# and the e2e pins are bumped with scripts/bump.sh, which Dependabot doesn't know.
version: 2
updates:
- package-ecosystem: gomod
directories: ["/", "/docs"]
schedule:
interval: monthly
# A release has a week to be found bad before an update proposes it.
cooldown:
default-days: 7
commit-message:
prefix: build
include: scope
# pflag 1.1 prints every boolean flag as --flag[=true|false] in the help, with no way to turn it
# off, so devvm stays on 1.0.x.
ignore:
- dependency-name: github.com/spf13/pflag
versions: [">= 1.1.0"]
groups:
go:
patterns: ["*"]
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
cooldown:
default-days: 7
commit-message:
prefix: ci
include: scope
groups:
actions:
patterns: ["*"]
+16
View File
@@ -0,0 +1,16 @@
<!-- markdownlint-disable-file MD041 -- a pull request's body, under GitHub's own title -->
## What this changes
<!-- What the change does and why. Link the issue it fixes, as in "Fixes #12". -->
## How it was tested
<!-- The tests you added or ran. For a change that touches VMs, the e2e sections you ran (mise run e2e -- --only SECTION) and on which OS. -->
## Checklist
- [ ] The title is a Conventional Commit, `type(scope): summary`, because it becomes the squashed commit's subject.
- [ ] `mise run fmt && mise run lint && mise run test` passes.
- [ ] New behaviour has tests, and every behaviour change updates its page in `docs/content/docs/`.
- [ ] A changed command follows the cli skill, and `mise run cli-docs` is rerun when its help changed.
- [ ] Nothing here belongs in a private security advisory instead (see SECURITY.md).
+136 -13
View File
@@ -1,30 +1,53 @@
name: Docs
# Pull requests touching the docs get their lints and a build; main deploys.
# Two sites. devvm.dev shows the latest release's docs: a published release that isn't a
# prerelease deploys its tag's docs to GitHub Pages, and so does a dispatch, with any release's
# tag. next.devvm.dev shows main's: each push to main that changes the docs builds them with
# docs/next.yaml and commits the site to devvmhq/docs-next, which Cloudflare Pages serves.
# Pull requests touching the docs get their lints and a build, and nothing else.
# The site is built from docs/ alone (the CLI reference included, which a help change commits
# there), and CI's lint runs the docs checks on every code change, so other pushes skip this.
# A release event runs this file as its tag has it.
on:
push:
branches: [main]
pull_request:
paths:
paths: &docs-paths
- "docs/**"
- "**.md"
- ".vale.ini"
- ".vale/**"
- ".markdownlint-cli2.yaml"
- ".github/workflows/docs.yml"
pull_request:
paths: *docs-paths
release:
types: [published]
workflow_dispatch:
inputs:
site:
description: The site to deploy
type: choice
options: [devvm.dev, next.devvm.dev]
default: devvm.dev
ref:
description: "devvm.dev only: the release tag whose docs it shows, such as v0.1.0 (empty: the latest release)"
type: string
required: false
permissions:
contents: read
# Deploys queue one after another; a pull request's newer run replaces its last.
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build:
# main's docs, or a pull request's: the lints and a build.
check:
if: >-
github.event_name == 'pull_request' || github.event_name == 'push' ||
(github.event_name == 'workflow_dispatch' && inputs.site == 'next.devvm.dev')
runs-on: ubuntu-latest
# A pull request's newer run replaces its last.
concurrency:
group: docs-check-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
# Only the docs' tools, not every tool in mise.toml.
MISE_TASK_RUN_AUTO_INSTALL: "false"
@@ -38,18 +61,118 @@ jobs:
with:
version: 2026.10.18
install_args: go hugo-extended node markdownlint-cli2 vale lychee
# The workflow publishes, so no job in it reads a cache another run could have written.
cache: false
- run: mise run lint:docs
# The site's address is baseURL in docs/hugo.yaml.
- run: hugo -s docs --minify
- if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
# next.devvm.dev: main's docs, committed to devvmhq/docs-next.
next:
if: >-
github.ref == 'refs/heads/main' &&
(github.event_name == 'push' ||
(github.event_name == 'workflow_dispatch' && inputs.site == 'next.devvm.dev'))
needs: check
runs-on: ubuntu-latest
# One push at a time; a newer run waiting replaces an older one.
concurrency:
group: docs-next
cancel-in-progress: false
# The environment holds the deploy key, and only main can use it.
environment:
name: docs-next
url: https://next.devvm.dev/
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- uses: jdx/mise-action@6be3c7ed4c21d4f76b208d351d95aac273ebb76d # v5.2.4
with:
version: 2026.10.18
install_args: go hugo-extended
# What's published is built from no cache.
cache: false
# docs/next.yaml over docs/hugo.yaml: next.devvm.dev's address, the banner and noindex.
- run: hugo -s docs --minify --config hugo.yaml,next.yaml -d "$RUNNER_TEMP/next"
# The key is checked out only after the build, which never sees it.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: devvmhq/docs-next
ref: main
path: docs-next
ssh-key: ${{ secrets.DOCS_NEXT_DEPLOY_KEY }}
# The push below needs the key; this checkout is the only thing that uses it.
persist-credentials: true # zizmor: ignore[artipacked] -- the push needs the deploy key, and nothing is uploaded
- name: Publish
working-directory: docs-next
run: |
# Everything but README.md is the site's.
find . -mindepth 1 -maxdepth 1 ! -name .git ! -name README.md -exec rm -rf {} +
cp -R "$RUNNER_TEMP/next/." .
git add -A
if git diff --cached --quiet; then
echo "next.devvm.dev is already this build."
exit 0
fi
git -c user.name="github-actions[bot]" \
-c user.email="41898282+github-actions[bot]@users.noreply.github.com" \
commit -q -m "Build from devvm ${GITHUB_SHA::7}"
git push origin HEAD:main
# devvm.dev: a release's docs, built from its tag.
release:
if: >-
(github.event_name == 'release' && !github.event.release.prerelease) ||
(github.event_name == 'workflow_dispatch' && inputs.site == 'devvm.dev')
runs-on: ubuntu-latest
steps:
- id: tag
name: The release's tag
env:
GH_TOKEN: ${{ github.token }}
EVENT: ${{ github.event_name }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
INPUT_REF: ${{ inputs.ref }}
run: |
if [ "$EVENT" = release ]; then
tag=$RELEASE_TAG
elif [ -n "$INPUT_REF" ]; then
tag=$INPUT_REF
else
tag=$(gh release view --repo devvmhq/devvm --json tagName --jq .tagName)
fi
if ! [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::error::A release tag is vX.Y.Z, such as v0.1.0; this is $tag."
exit 1
fi
echo "tag=$tag" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: refs/tags/${{ steps.tag.outputs.tag }}
persist-credentials: false
# Full history, for each page's last updated date.
fetch-depth: 0
- uses: jdx/mise-action@6be3c7ed4c21d4f76b208d351d95aac273ebb76d # v5.2.4
with:
version: 2026.10.18
install_args: go hugo-extended
# What's published is built from no cache.
cache: false
# The tag's docs/hugo.yaml, whose baseURL is devvm.dev.
- run: hugo -s docs --minify
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: docs/public
deploy:
if: github.event_name != 'pull_request'
needs: build
needs: release
runs-on: ubuntu-latest
# Deploys queue one after another.
concurrency:
group: docs-pages
cancel-in-progress: false
permissions:
pages: write # to deploy the site
id-token: write # to prove the deployment comes from this workflow
+4 -3
View File
@@ -15,9 +15,10 @@ concurrency:
cancel-in-progress: false
env:
LIMA_VERSION: 2.2.1
# lima-2.2.1-Linux-x86_64.tar.gz in the release's SHA256SUMS.
LIMA_SHA256: b391ac7fcac2b2a5a1628107756463188ded4d18d3104a40a66a8bb6fec01bcb
LIMA_VERSION: 2.3.0
# lima-$LIMA_VERSION-Linux-x86_64.tar.gz in the release's SHA256SUMS
# (scripts/bump.sh e2e-lima).
LIMA_SHA256: cc8ba97f1c801b899f7c9eda9919dfc4ce4fa2c140c53e5add15aa2d0a1936f9
jobs:
project:
+66
View File
@@ -0,0 +1,66 @@
name: Pins
# scripts/bump.sh --check once a week: the pins with a newer upstream go in
# one open issue, which closes when none is left. It reports and never bumps.
on:
schedule:
- cron: "47 6 * * 1"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: pins
cancel-in-progress: false
jobs:
check:
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Check the pins
run: |
set -euo pipefail
scripts/bump.sh --check | tee "$RUNNER_TEMP/check.txt"
# bump.sh's output is upstream's text: it goes through files, never into
# a script.
- name: Open, update or close the issue
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
set -euo pipefail
title="Pinned versions to bump"
grep -F ' -> ' "$RUNNER_TEMP/check.txt" > "$RUNNER_TEMP/outdated.txt" || true
number=$(gh issue list --state open --search "in:title \"$title\"" --json number,title \
--jq "map(select(.title == \"$title\")) | .[0].number // empty")
if [[ ! -s $RUNNER_TEMP/outdated.txt ]]; then
if [[ -n $number ]]; then
gh issue close "$number" --comment "Every pin is up to date: scripts/bump.sh --check lists nothing to bump."
fi
exit 0
fi
{
echo "scripts/bump.sh --check found pins with a newer upstream version:"
echo
# Four backticks: a line from upstream can't end the block early.
echo '````'
cat "$RUNNER_TEMP/outdated.txt"
echo '````'
echo
echo "Bump them with \`scripts/bump.sh TOOL…\` (the tools named above), or \`scripts/bump.sh\` for all."
echo "Pin bumps change images, so run the \`--from\` tier of the end-to-end tests before merging:"
echo "see [Updating pinned versions](https://devvm.dev/docs/contributing/maintaining/#updating-pinned-versions)."
} > "$RUNNER_TEMP/body.md"
if [[ -n $number ]]; then
gh issue edit "$number" --body-file "$RUNNER_TEMP/body.md"
else
gh issue create --title "$title" --label enhancement --body-file "$RUNNER_TEMP/body.md"
fi
+38
View File
@@ -0,0 +1,38 @@
name: PR title
# Pull requests are squash-merged with their title as the commit's subject, so the title follows
# Conventional Commits, with the types AGENTS.md lists. pull_request, not pull_request_target: the
# check only reads the title through the API with a read-only token and checks out no code.
on:
pull_request:
types: [opened, edited, reopened, synchronize]
permissions:
contents: read
concurrency:
group: pr-title-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
title:
name: Conventional Commits title
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
pull-requests: read
steps:
- uses: amannn/action-semantic-pull-request@2252a14e810aa9b85c2d560bd7070c802206ecf6 # v6.1.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
feat
fix
docs
test
refactor
build
ci
chore
requireScope: false
+1 -1
View File
@@ -1,5 +1,5 @@
.dex/
.claude/
/.claude/
dist/
docs/public/
docs/resources/
+24 -2
View File
@@ -26,17 +26,19 @@ linters:
settings:
depguard:
rules:
# The proxy, and the background-process helper it uses: the
# standard library alone.
# The proxy, and the background-process helper and the file
# reader it uses: the standard library alone.
proxy:
list-mode: strict
files:
- "**/internal/proxy/**"
- "**/internal/daemon/**"
- "**/internal/safefile/**"
allow:
- $gostd
- github.com/devvmhq/devvm/internal/proxy
- github.com/devvmhq/devvm/internal/daemon
- github.com/devvmhq/devvm/internal/safefile
main:
list-mode: strict
files:
@@ -44,6 +46,7 @@ linters:
- "!$test"
- "!**/internal/proxy/**"
- "!**/internal/daemon/**"
- "!**/internal/safefile/**"
allow:
- $gostd
- github.com/devvmhq/devvm
@@ -67,6 +70,7 @@ linters:
- $test
- "!**/internal/proxy/**"
- "!**/internal/daemon/**"
- "!**/internal/safefile/**"
allow:
- $gostd
- github.com/devvmhq/devvm
@@ -104,6 +108,10 @@ linters:
msg: write a file whole through state.WriteFile, or state.WriteFileMode for another mode, which replace it atomically; internal/proxy uses its writeAtomic; a log or a download streamed into its file says why in a nolint.
- pattern: ^(os|syscall)\.(Setenv|Unsetenv|Clearenv)$
msg: devvm's environment never changes, as every command and process it starts inherits it; set a command's own (exec.Cmd's Env), as a VM's SSH agent is (backend.ExecOpts.Agent). Only daemon.Ready takes its status file out.
- pattern: ^unicode\.(IsGraphic|IsPrint|IsControl|Bidi_Control)$
msg: ask msg.Safe which characters reach the terminal (msg.Printable and msg.OneLine drop the rest); a check that isn't about the terminal says why in a nolint.
- pattern: ^(os\.(Open|OpenFile|ReadFile|OpenRoot|OpenInRoot|DirFS)|os\.Root\.(Open|OpenFile|ReadFile|FS))$
msg: read a file a VM can write through internal/safefile (Read, Open, OpenRoot), which never waits on a FIFO or follows a link it wasn't asked to, and reads only a regular file within its cap; what opens a file to write, or a folder, says why in a nolint.
nolintlint:
require-explanation: true
require-specific: true
@@ -122,6 +130,10 @@ linters:
presets:
- std-error-handling
rules:
# msg.Safe is the one rule for which characters reach the terminal.
- path: ^internal/msg/
linters: [forbidigo]
text: ask msg\.Safe
- path: ^cmd/devvm/
linters: [forbidigo]
text: os\.Exit|context\.(Background|TODO)
@@ -168,6 +180,16 @@ linters:
- path: ^internal/daemon/status\.go$|_test\.go$
linters: [forbidigo]
text: devvm's environment never changes
# The readers of files a VM can write, or swap, are held to
# internal/safefile: the project folder's (devcontainer.json, its
# default.nix, .git's), devvm agent save's store, the agents' logins and
# the policy files. Tests make their own fixtures.
- path-except: ^internal/(gitprotect/|vm/(devcontainer|detect|agentsave[a-z_]*)\.go$|agentlogin/|netpolicy/rules\.go$|proxy/(config|policy)\.go$)|^testdata/lint/
linters: [forbidigo]
text: internal/safefile
- path: _test\.go$
linters: [forbidigo]
text: internal/safefile
paths:
- ^\.agents/
+69 -74
View File
@@ -4,42 +4,46 @@ devvm: one isolated VM per project folder, cloned from a base image, with toolch
## Layout
Each package's concerns and identifiers: [The packages](docs/content/docs/contributing/structure.md#the-packages).
| Path | What |
| --- | --- |
| `cmd/devvm/` | the entry point: `ui.Main` makes the run's UI and runs the root command with it; the only `os.Exit` |
| `internal/cli/` | Cobra commands, one file each (root = up, `build`/`rebuild`, `images`, `gc`, `space`, `retention`, `layer` (its new, add and rm), `setup`, `agent` (its import and save; login in `agentlogin.go`), `restart`, `tools`, `adopt`, `rm`, `stop`, `update`, `history`, `ls`, `network` (its rules and log too), `doctor`, `secret`, `link` (its add, rm, publish and unpublish too), `group` (join, leave), `ssh-agent`, `host`, `code`, `desktop`, `limactl`, `ports`, `size`, `git-protect`, `clone`, `completion`, `upgrade`, hidden `version`, `_msg`, `_qemu`, `_proxy`, `_ports` (`forwarder.go`), `_links`, `_refresh-tools`); `app.go`: the run's services, each made once (folders, overrides, secrets, registry, tools, `vmEnv`, `builder`; `a.env` runs a command on the folder's VM); `args.go` checks arguments and flags (usage errors), `flags.go` the flags several commands share, `word.go` refuses devvm WORD and help's unknown words (a part's name points to its flag; did-you-mean over commands, `msg.Closest`); `help.go` the help's groups, `Example`s and docs links (`msg.CommandDocURL`); `json.go`: `--json` (`printJSON`, `"version": 1`), its shapes in `json_test.go`; `script_test.go` runs testscript; `docgen/` writes the CLI reference |
| `internal/vm/` | `Env` (`env.go`: shared dependencies, and its parts, each made once by `wire`, which the commands reach, never converting one type to another); the start (`start.go`: `starter.bringUp`, every path's one start, `requirements`, `confinementFor`, `hostChecks`); the finder (`finder.go`: `target` finds the VM a command acts on, as its `need` says; `target.go`: that VM, read once, and what a command does with it; `move.go`: a VM whose folder moved, devvm adopt VM); the inventory (`inventory.go`: every VM's state, backend and list, read in one place, one failure policy); `Launch`: a new VM (`up.go`; `parts.go`: its toolchains, agents and layers, the picker, setup's agents and layers; `detect.go`: what the folder's files call for), an existing one (`existing.go`), `ssh.go`, agents' mounts from devvm's agent store (`agents.go`: `agentStore`, the one reader of `Dirs.AgentSettings`; `secrets.LoginFile` the logins'), `AgentImport` (`agentimport.go`: devvm agent import, the one reader of the home's agent files), `AgentLogin` (`agentlogin.go`: devvm agent login, the agent's login in the VM, its forward, API keys), `AgentSave` (`agentsave.go`: devvm agent save, a VM's settings into the store, after a diff (`linediff.go`) and a yes; `agentsave_read.go`: its fixed list and the checks on the VM's stream); `Lifecycle` (`lifecycle.go`; `remake.go`: the one remake, a VM made again from another image, devvm layer add, devvm layer rm, devvm update and devvm clone; `home.go`: its home folder's copy); `Housekeeping` (`housekeep.go`: images, shared tools, exports and leftovers for devvm images, gc, space and retention); `Exports` (`exports.go`: the exports of agents' history, their `.folder` files, `Newest`); `Tools` (`tools.go`: a VM's shared tools); `Settings` (`settings.go`, `size.go`, `ports.go`, `sshagent.go`); `Net` (`network.go`, `secret.go`); `Links` (`links.go`: links between VMs, published ports), `Groups` (`groups.go`: the links a group makes); `--clone` (`clone.go`: the clone, rm's check, devvm clone's switch); a devcontainer.json's mapping and commands (`devcontainer.go`); the setup it sends (`sync.go`) |
| `internal/shell/`, `internal/vmname/` | stdlib leaves: quoting for a POSIX shell (`Quote`, `QuoteJoin`) and its variables' names (`EnvName`); a project VM's name grammar (`Prefix`, `HashLen`, `IsVM`, `HashOf`, `SlugOf`, a remake's `Aside`) |
| `internal/project/`, `internal/gitprotect/`, `internal/hostsafety/`, `internal/hostgit/` | a project folder (VM name, link targets, unsafe folders, parents); `.git` protection; the folder's other host checks (set-id files, skipping `.git`, once stopped; an SSH origin); every host git command devvm runs (no fsmonitor, hooks or filters, ssh only, no `GIT_*` of the environment, no prompts) |
| `internal/sshconfig/`, `internal/sshagent/` | the ssh config for running VMs by name, the `~/.ssh/config` Include line; each VM's SSH agent choice, devvm's own agent and its keys |
| `internal/build/`, `internal/image/` | building and rebuilding images, their records; image keys and names (pure) |
| `internal/fetch/` | every HTTP client (stdlib): `NewClient` (timeout, `HTTPSOnly`/`SameScheme`), `Retry`/`Transient`, `ReadCapped`, `Get`, `Resolve` (where a HEAD's redirects end), `Download` (checks the SHA-256, capped) |
| `internal/upgrade/` | devvm upgrade: how this devvm was installed (`Detect`), the releases (`Source`: the newest, `Check` for a notice, `Fetch`: minisign's `ED` signature by the built-in key, then the SHA-256), the unpack, the link's switch and rollback, brew; `upgradetest/` (tests only: a TLS release server, a minisign signer) |
| `internal/from/` | `--from`: references, registry digests (anonymous token), Docker's IDs, the recorded digests |
| `internal/redact/` | passwords out of logs (stdlib): `String` (the run log's lines: proxy keys, URL passwords), `File` (another program's log, in place, its length kept) |
| `internal/devcontainer/`, `internal/jsonc/` | a project's devcontainer.json (pure): finding it, mapping it to a new VM's plan, refusals, what devvm update's reading again replaces (`Reread`); JSON with comments (`jsonc.Strip`, stdlib) |
| `cmd/devvm/` | the entry point (`ui.Main`); the only `os.Exit` |
| `internal/cli/` | the command line: one file per Cobra command, the run's services (`app.go`), argument checks, help, `--json`, the CLI tests, `docgen/`; `doc.go` maps it |
| `internal/vm/` | what each command does to a folder's VM, below the command line; `doc.go` maps the package and its owners |
| `internal/shell/`, `internal/vmname/` | quoting for a POSIX shell; a project VM's name grammar |
| `internal/project/`, `internal/gitprotect/`, `internal/hostsafety/`, `internal/hostgit/` | a project folder; `.git` protection; the folder's other host checks; every host git command devvm runs |
| `internal/sshconfig/`, `internal/sshagent/` | the ssh config for running VMs by name; each VM's SSH agent and devvm's own |
| `internal/build/`, `internal/image/` | building images and their records; image keys and names, and the shared tools' registry (`SharedTools`) |
| `internal/fetch/` | every HTTP client |
| `internal/upgrade/` | devvm upgrade; `upgradetest/` (tests only) |
| `internal/from/` | `--from`'s references and digests |
| `internal/redact/` | passwords out of logs |
| `internal/safefile/` | every read of a file a VM can write or swap |
| `internal/devcontainer/`, `internal/jsonc/` | a project's devcontainer.json; JSON with comments |
| `internal/tools/` | the shared tools: the lock, host mise, the daily check, tool image builds, the share |
| `internal/netpolicy/`, `internal/secrets/` | network policy (the choice, the VM's proxy, the self-check); tokens on the host and the VM's bindings |
| `internal/trust/` | the user's CAs (`~/.config/devvm/ca`): read and checked, sent to VMs, build VMs' `Trust` scripts, the guest environment; each VM's own CA and its next (`InitCA`, in `vms/<hash>/run/ca/`) |
| `internal/agentlogin/` | agents' login and settings files on the host: the VM's copies with placeholders, bindings, values and OAuth refresh (`File`), `Redact`, and `Restore`, which puts the store's values back for a VM's placeholders |
| `internal/netpolicy/`, `internal/secrets/` | network policy; tokens on the host, the VM's bindings and your own secrets |
| `internal/trust/` | your CAs, and each VM's own CA |
| `internal/agents/` | the coding agents' registry: one `Def` each, which every list of the agents derives from |
| `internal/agentlogin/` | agents' login and settings files on the host, and their placeholders |
| `internal/proxy/` | the proxy, run as `devvm _proxy`; see its `README.md` |
| `internal/daemon/` | devvm's background processes (stdlib only): detached starts, pid files checked against the process's arguments, stopping (TERM, then KILL), readiness by status file, the lifeline; the only place a process is signalled by pid (forbidigo) |
| `internal/desktop/` | devvm desktop's relay on the host: VNC's password checked here, then an ssh channel to the VM's socket, the viewer's clipboard dropped; passwords |
| `internal/backend/` | `Backend` and its roles, `Caps`, `Require`, `Check`, the registry and its guard (`As`); `backendtest/` (fake), `registry/` (every backend's), `lima/` |
| `internal/vmssh/` | devvm's own over a VM's ssh, on every backend: `Checked`, the one way to a VM's ssh (the review, the backend's `SSH` checked by `FromTarget`, its host keys read or pinned; `UnusableError`, `ErrNoHostKeys`), the port forwarder and its one owner (`Forwards`: lock, stop, start, its ports from vm.json), a login's forward of this machine's loopback ports in devvm's own process (`ForwardLoopback`), links' sessions, each VM's one host-key record per start (`PinHostKeys`, `vms/<hash>/run/known_hosts`) that every ssh of devvm's checks |
| `internal/ui/` | the only package that prints: `ui.UI` (messages, prompts, status line, run log, cleanups), `ui.Main` (signals); no package state |
| `internal/msg/`, `locales/` | messages: `en.toml`, the generated functions, doc links (`docs.go`), the generator (`gen/`); `Reporter` (`reporter.go`: what every package prints and asks through, `*ui.UI` its one implementation, `Fake` the tests'); `Question` (`question.go`: a question and what answers it, `AnsweredBy`/`RefusedWith`; where devvm can't ask, its `Refusal` is the prompt's error) |
| `internal/ports/` | a VM's ports section (forwards asked for, host ports chosen) and the one allocator of host ports, under the claims lock |
| `internal/paths/`, `internal/state/` | every folder and file devvm uses, a VM's in its folder (`Dirs.VM`: `vms/<hash>/`), host paths resolved and compared (`Physical`, `PhysicalParent`, `Within`, `Below`: `resolve.go` says which for what); a VM's state, `vm.json` (core fields, one section per package, changed only in `VM.Update` under the VM's lock); the layout version (`CheckLayout`, `migrations`; `testdata/script/layout.txtar` lists every file); every file written whole (`WriteFile`, `WriteFileMode`: forbidigo bans `os.WriteFile`, `os.Create` and `O_TRUNC` elsewhere but the proxy), private folders (`PrivateDir`) |
| `internal/settings/` | the defaults (`Defaults`, `Read`, `Save`): `config.toml` (yours, strict) over `settings.json` (devvm's), each value's check (`ParsePorts`, `ParseCPUs`, `ParseGiB`, the retention settings) |
| `internal/platform/`, `internal/ubuntu/`, `internal/testbuild/` | build-tagged OS code; finding and verifying Ubuntu's cloud image (never downloads); whether this is a test build (ldflags: only it reads the test overrides, `cli`'s `readOverrides`) |
| `assets/` | the files devvm ships, embedded (`assets.FS`, passed to constructors by `cli`): `base.yaml`, `prelude.sh` (`$devvm_arch`, `$devvm_libc`, `devvm_sha`: first in each build script run with bash, read through `image.OwnScript`), `layers/` (base's Lima template and scripts; the built-in layers, `desktop`, `docker` and `nix`, each with its policy), `features/` (base's optional ones), `shared-tools/` (`mise.toml`, `build.sh`, `*.policy`), `guest/` (in-VM scripts sent on every launch, and the port forwarder's `ports.sh`), `oci/` (`--from`'s conversion; see its `README.md`) |
| `internal/structure/` | the structure test (tests only) |
| `internal/stubtest/` | the test stubs (tests only): `stub/`, one Go binary for every host command, dispatched on `argv[0]` (each stub's comment lists its switches; `guest.go`, the VM behind limactl shell and ssh; `stub`, scripts' commands on its state), built once into `$TMPDIR/devvm-stubs-<hash>`; `stubstate/`, their typed JSON state under a lock; `stubtest` puts them on `PATH`: their folder, calls, files and state, `ExecRunner`; `msg.Fake`, `msg.Recorder`, `msg.IDOf` and `msg.NamesOf` are tests' too, `backendtest.Stored` a fake with disks |
| `testdata/` | `script/*.txtar` (CLI tests), `golden/<os>/` (what the real tools printed, `mise run e2e -- --golden`; the stubs and devvm's parsers are checked against it), `mise.lock` (fixture), `coverage/<os>.txt` (each package's coverage baseline, per system), `lint/` (a line breaking each forbidigo rule, which `lint:code` checks) |
| `tests/e2e/`, `tests/e2e-mise.lock` | end-to-end tests on real VMs (Go, tag `e2e`, a file per section; `TestE2E` is the run, `mise run e2e -- FLAGS`; the sandbox, slots, locks and `e2eUbuntuRelease` in `sandbox_test.go`); the shared tools' versions every section but `tools` uses (`scripts/bump.sh e2e-tools`) |
| `scripts/`, `packaging/`, `.goreleaser.yaml`, `VERSION`, `CHANGELOG.md` | `bump.sh` (pins), `release.sh` (signed-tag checks around GoReleaser, then minisign), `publish.sh` (the release: checks, release.sh, one yes, then pushes, `gh release` and the tap), `test.sh` and `coverage.sh` (mise's test tasks); the Homebrew formula; `packaging/key.go` embeds the folder, so devvm upgrade's key is `minisign.pub`'s (none without it); `VERSION` is read by the scripts only |
| `install.sh` | `curl \| bash`: the host's archive (the binary, README, changelog, license), checked, into `~/.local/lib/devvm/<version>`, then doctor's fixes, asking first; tests source it (`DEVVM_INSTALL_TEST`) |
| `internal/daemon/` | devvm's background processes; the only place a process is signalled by pid |
| `internal/desktop/` | devvm desktop's relay on the host |
| `internal/backend/` | `Backend`, its roles, `Caps`, the registry and its guard; `backendtest/`, `registry/`, `lima/` |
| `internal/vmssh/` | devvm's own ssh to a VM (`Checked`), the port forwarder (`Forwards`), each start's host keys |
| `internal/ui/` | the only package that prints |
| `internal/msg/`, `locales/` | messages, `Reporter` and `Question` |
| `internal/ports/` | a VM's ports and the one allocator of host ports |
| `internal/paths/`, `internal/state/` | every folder and file devvm uses; `vm.json`, the layout version, files written whole |
| `internal/settings/` | the defaults: `config.toml` over `settings.json`, each value's check |
| `internal/platform/`, `internal/ubuntu/`, `internal/testbuild/` | build-tagged OS code; Ubuntu's cloud image (never downloads); whether this is a test build |
| `assets/` | the files devvm ships, embedded (`assets.FS`) |
| `internal/structure/` | the structure test |
| `internal/stubtest/` | the test stubs |
| `testdata/` | CLI tests, golden fixtures, coverage baselines, each release's frozen state (`v<release>/`), `lint/` |
| `tests/e2e/`, `tests/e2e-mise.lock` | end-to-end tests on real VMs |
| `scripts/`, `packaging/`, `.goreleaser.yaml`, `VERSION`, `CHANGELOG.md` | pins, releases, the test tasks' scripts, the Homebrew formula, devvm upgrade's key |
| `install.sh` | `curl \| bash`, asking before doctor's fixes |
| `docs/` | the docs site (Hugo + Hextra); `content/docs/cli/` is generated, never edit it |
| `mise.toml`, `.golangci.yml`, `.vale*`, `.markdownlint-cli2.yaml`, `.github/` | tools, tasks, linters, CI and Pages |
| `.agents/skills/security-audit/` | the security-audit skill, for backend reviews |
@@ -48,7 +52,7 @@ devvm: one isolated VM per project folder, cloned from a base image, with toolch
## Tasks
`mise run <task>`: `fmt`; `lint` (`lint:code`: Go, shellcheck, workflows with actionlint and zizmor; `lint:docs`: docs, `TestDocLinks`, `TestCommandLines`); `test` (`scripts/test.sh`: `-race`, in a throwaway `HOME`; needs a C compiler; then each package's coverage, unit and CLI tests merged, against `testdata/coverage/<os>.txt`); `coverage` (the same, then raises the baselines it beat: commit them with the change); `vuln`; `deadcode` (lists only `backendtest`, `stubtest`, `upgradetest`, `msg.IDOf`, `msg.NamesOf`, `msg.Recorder` and `msg.Fake`, which tests use; anything else gets a caller or goes); `cli-docs` (after changing any command's `Use`, `Short`, `Long` or flags; commit the pages); `docs` (serves `http://localhost:1313/`); `e2e`.
`mise run <task>`: `fmt`, `lint` (`lint:code`, `lint:docs`), `test`, `coverage` (commit the baselines it raised with the change), `vuln`, `deadcode` (anything but the tests' helpers gets a caller or goes), `cli-docs` (after changing a command's help, flags or docs page; commit the pages), `docs`, `e2e`: [Tools and tasks](docs/content/docs/contributing/_index.md#tools-and-tasks).
## Rules
@@ -57,87 +61,78 @@ devvm: one isolated VM per project folder, cloned from a base image, with toolch
- **devvm's own files never get a shared copy on disk:** the proxy reads them from the binary, base.yaml and scripts go on stdin, `--from`'s build writes its scripts into its own temp folder.
- **Credentials never go into images.** Host agent history never goes into VMs.
- **Never auto-delete project VMs:** they may hold unsaved work. Warn instead.
- **Every release's state keeps working** until 1.0: a change to state runs its new commands on every frozen `testdata/v<release>/` fixture (never edited or regenerated) in the same commit, and a change for existing state gets a Breaking changelog entry ([Released state](docs/content/docs/contributing/structure.md#released-state)).
- **The startup check only reports.** Never install host software without asking.
- **Image keys hash everything that goes into an image**, the backend included. A tool image's key is its lock entry, `assets/shared-tools/build.sh` after the prelude, `shared-tools/mise.toml`'s `[settings]`, the mise `layers/base.sh` pins (not rust's), the libc and the base it builds in: devvm's own Ubuntu base for gnu, the only one gnu ones build in, and for musl its `--from` base's digest (`Share.Build` checks the base's record).
- **Image keys hash everything that goes into an image**, the backend included; a tool image's key is in [Building tools](docs/content/docs/internals/images.md#building-tools).
- **Pin every download** in `assets/`'s `layers/`, `features/`, `shared-tools/build.sh`, `oci/build.sh`: `<tool>_version` and `<tool>_sha256_arm64`/`_amd64` at the top, picked with the prelude's `devvm_sha`, fetched with `devvm-fetch` (`oci/build.sh`: `sha256sum`). No `curl | sh`, no "latest". Upstream-checked exceptions: shared tools (`MISE_LOCKED=1`), Ubuntu's signed `SHA256SUMS`, Lima in `install.sh`. Go checks a download's SHA-256 before use.
- **Shared tools are read-only in VMs:** whatever writes into a tool's folder (global installs, self-updates, `corepack enable`, `rustup component add`) is redirected (`~/.npm-global`, `go_set_gobin = false`), done in `assets/shared-tools/build.sh`, or off.
- **In-VM scripts are bash 3.2-safe and shellcheck-clean** (`assets/`, `install.sh`): guard empty arrays (`${a[@]+"${a[@]}"}`), no associative arrays. Everything else is Go.
- **Docs:** an easy-to-follow guide in full, joined sentences, every fact kept; write and edit prose with the docs-voice skill (Vale's `devvm.AIWords` fails on chatbot vocabulary). Every behavior change updates its page in `docs/content/docs/` in the same task. The README stays high level.
- **Docs:** an easy-to-follow guide in full, joined sentences, every fact kept, written with the docs-voice skill; every behavior change updates its page in the same task, and the README stays high level ([Writing docs](docs/content/docs/contributing/docs.md#writing-docs)).
- **Adding or changing a command** follows the cli skill (`.agents/skills/cli/`): its checklist, then its review.
- **Adding or changing a shared tool** updates its page: `using/toolchains.md` for a toolchain, `using/coding-agents.md`'s Supported agents for an agent.
- **Docs by reader:** user pages (`getting-started/`, `using/`, `safety/`, `backends/`) say what devvm does and what you type, without repo paths, Go identifiers or message names; How it works (`internals/`) explains mechanisms; Contributing (`contributing/`) has repo paths and Go identifiers.
- **Extend the owner, don't copy it:** before adding a helper, parser, path, file reader, message or table, find its owner and extend it; a new owner gets a forbidigo rule or a structure-test check only when a second copy would be a bug ([Contributing](docs/content/docs/contributing/_index.md#one-owner-for-each-concern)).
- **Adding or changing a shared tool** updates its page and follows Contributing's checklist: `using/toolchains.md` for a toolchain ([Adding a toolchain](docs/content/docs/contributing/extending.md#adding-a-toolchain)), `using/coding-agents.md`'s Supported agents for an agent ([Adding a coding agent](docs/content/docs/contributing/extending.md#adding-a-coding-agent)).
- **Docs by reader:** user pages name no repo paths, Go identifiers or message names; How it works explains mechanisms; Contributing has the paths and identifiers ([Writing docs](docs/content/docs/contributing/docs.md#writing-docs)).
- **Extend the owner, don't copy it:** before adding a helper, parser, path, file reader, message or table, find its owner and extend it; a new owner gets a forbidigo rule or a structure-test check only when a second copy would be a bug ([Contributing](docs/content/docs/contributing/structure.md#one-owner-for-each-concern)).
- **Edit files with the editor tools,** not `sed`, `awk`, `python`, heredocs or `cat >`.
- **Ask first** before anything outward-facing (publishing, releases, repos, pushing) and before deleting anything you didn't create.
- **A task that turns out wrong or incomplete** gets a proposed change (`dex edit`), not quietly something else.
- **A task that turns out wrong or incomplete:** say so and propose the change; don't quietly do something else.
## Go conventions
- **Only `internal/ui` prints.** forbidigo bans `fmt.Print*`, `os.Stdout`/`os.Stderr` elsewhere and `os.Exit` outside `cmd/devvm`. Data goes to the UI's `Stdout()`, non-message log lines to its `Stderr()`.
- **Functions take their caller's `ctx`:** forbidigo bans `context.Background`/`TODO` outside `internal/ui` and `cmd/devvm`; one that must outlive its caller's gets `//nolint:forbidigo // why`.
- **Every `//nolint` names its linters and says why** (nolintlint). Functions stay within revive's `function-length` and `cognitive-complexity` limits: split one that grows past them.
- **Fail by returning:** `RunE` returns the error, as `failed(err, msg.XFailed)` when it may not be a message; `execute` alone prints it (`showFailure`: a `LoggedError` with the log's end via `ErrorLogged`, a message as it is, else `what`) and returns 1, then `ui.Main` runs the cleanups. Only the UI ends a run itself (`die`: no run log). INT/TERM/HUP cancel the root context, wait for the logged command, then, with cleanups to run, up to 2 s for the command to return (`returnGrace`; not while it waits at a question, whose answer after a signal is refused), run the cleanups and return 130; a second signal is ignored; after one, failures print nothing. A logged command a signal ended (or 128+) waits up to 1 s for devvm's own interrupt, as Ctrl+C can end it first.
- **Only `cmd/devvm` and `internal/cli` import `internal/ui`** (the structure test's layers): cli passes the run's `app` (its `*ui.UI` and services) to each command; other packages embed the one `msg.Reporter` (messages, prompts, status line, run log, cleanups), which their constructors take and cli gives them, or cli asks first and passes the answer in; a package's own `Warn` that says where the run log is too (Lima's, the shared tools') is a method over it.
- **Arguments and flag values are checked before anything runs**, in `Args` (`noArgs`, `exactArgs`… from `args.go`, never Cobra's; values with `cobra.MatchAll`), `checkFlagValue` and `exclusive`: a usage error exits 2 and names the command's --help. Exit codes: 0, 1, 2, 130.
- **Only `internal/ui` prints, functions take their caller's `ctx`, and every `//nolint` names its linters and says why;** functions stay within revive's limits ([Go lint rules](docs/content/docs/contributing/_index.md#go-lint-rules)).
- **Fail by returning:** `RunE` returns the error and `execute` alone prints it; signals, exit codes and the run log: [CLI conventions](docs/content/docs/contributing/cli.md#cli-conventions).
- **Only `cmd/devvm` and `internal/cli` import `internal/ui`;** other packages print and ask through the one `msg.Reporter` their constructors take ([Messages](docs/content/docs/contributing/cli.md#messages)).
- **Arguments and flag values are checked before anything runs**, with `args.go`'s checks, never Cobra's; a usage error exits 2 ([Command arguments](docs/content/docs/contributing/cli.md#command-arguments)).
- **Cleanups:** whatever a failure would leave (a build VM, a temp file) registers with the UI's `AddCleanup` and is removed once done; one only for interrupts checks `Interrupted()` and stays once interrupted, as the cleanups run after the command returns. Cleanups get a fresh context.
- **External commands run with the UI's `LoggedCmd(ctx, step, cmd)`** (a backend's `Runner`): output to the run log, a failure after one returned as `backend.Logged(m)`. `WithSteps(ctx, n)` numbers steps.
- **External commands run with the UI's `LoggedCmd(ctx, step, cmd)`**, a failure after one returned as `backend.Logged(m)` ([CLI conventions](docs/content/docs/contributing/cli.md#cli-conventions)).
- **OS-specific code goes behind build tags** in `internal/platform` (`*_darwin.go`, `*_linux.go`, `*_other.go`).
- **Dependencies:** the depguard allowlist (cobra, pflag, cobra/doc, go-i18n, BurntSushi/toml, x/text, x/term, x/sys, x/crypto's `blake2b` only (minisign's prehash); go-internal in tests; cobra/doc's own deps never imported directly). `internal/proxy` and `internal/daemon` are stdlib only. Adding one: ask.
- **Dependencies:** the depguard allowlist (cobra, pflag, cobra/doc, go-i18n, BurntSushi/toml, x/text, x/term, x/sys, x/crypto's `blake2b` only (minisign's prehash); go-internal in tests; cobra/doc's own deps never imported directly). `internal/proxy`, `internal/daemon` and `internal/safefile` are stdlib only. Adding one: ask.
- **External tools are commands, never linked** (`limactl`, `docker`, `security`, `git`, `chflags`…); prefer the standard library to shelling out. Strings into a shell are quoted with `shell.Quote`.
- **Test seams are fields** tests set (`Host`, `Exec`, `Runner`, `OS`, `Reporter`…), never package vars (reassign: no package sets another's); `internal/proxy`'s are its `server`'s, which each test makes.
- **The structure test** (`internal/structure`, in `mise run test`) holds types to 24 methods, bans `func init`, allows only constants' kin as package vars, checks the package layers and the owners (host git only in `internal/hostgit`; `DEVVM_` variables only in `readOverrides` and the listed settings; `HOME` only in `internal/paths`, as `Dirs.Home`; shell quoting only in `internal/shell`, the VM-name grammar only in `internal/vmname`, `state.ReadHash` and `project.Parents` only in the finder, `state.ReadAll` only in the inventory, `Dirs.AgentSettings` only in `vm/agents.go` and `Dirs.AgentLogins` only in `secrets/secrets.go`): see [Contributing](docs/content/docs/contributing/_index.md#the-structure-test) before raising a limit or listing an exception.
- **The structure test** holds types to 24 methods, bans `func init`, limits package vars, checks the layers and keeps each concern in its owner (its failure names the owner: extend that); read [The structure test](docs/content/docs/contributing/structure.md#the-structure-test) before raising a limit or listing an exception, and regenerate [the checks on owners](docs/content/docs/contributing/structure.md#the-checks-on-owners) after changing its tables (`go test ./internal/structure -run TestOwnersDoc -update`).
- **The CLI reference is generated:** `TestReferenceIsCurrent` fails on a stale one (`mise run cli-docs`).
- `CGO_ENABLED=0`. `internal/proxy` and `internal/daemon` are unix-only for now (`syscall.Kill`, `Setsid`, `Flock`).
## Backends
- Every backend implements `backend.Backend` and declares `Caps` per feature: native, emulated (reviewed) or none. A new `Feature` goes in `backend.Features` and the table in `docs/content/docs/internals/backends.md`.
- **`backend.Backend` is `Name`, `Caps` and four roles**, `Host`, `Images`, `Machines`, `Housekeeping`, all required; a backend's type splits the same way (Lima's `host`, `images`, `machines`, `housekeeping`). The one optional role, `Forgetter`, is found with `backend.As`.
- **A missing feature fails** in one line naming the VM and what to do; never fall back silently. Callers check the registry's `Review.Require(b, vm, spec.Features()...)` first, and its guard refuses the rest (it has every role's methods); backends don't decide what a VM needs.
- **A backend implements `backend.Backend`'s four roles, declares `Caps` for every feature and returns errors, never ending the run:** [How a backend plugs in](docs/content/docs/contributing/extending.md#how-a-backend-plugs-in); a new `Feature` goes in `backend.Features` and [the feature table](docs/content/docs/internals/backends.md#the-feature-table).
- **A missing feature fails, naming the VM and what to do; never fall back silently** ([Missing and unreviewed features](docs/content/docs/internals/backends.md#missing-and-unreviewed-features)).
- **Every emulation is refused until reviewed:** a design note in `docs/content/docs/internals/design.md`, a threat check with the security-audit skill, and e2e checks proving the guarantee; then it's marked reviewed in `Caps`.
- Backend-specific code stays in its package; what isn't (`.git` protection, the proxy) stays out.
- **Backends return errors, they don't die:** a `msg.M`, or `backend.Logged(m)` after a logged command failed. A stopped VM changes only at `Start`, which applies what its `Want` asks where it differs (`backend.Validate` first); a running one is left as it is; restart warnings are the callers'. Ports are never the backend's: `vmssh.Forwards` forwards over its `SSH`, which `vmssh.FromTarget` checks.
- **Lima edits only what differs:** any `limactl edit` gives the VM new ssh host keys at its next boot, so `Start` compares first and makes one edit. `Start` owns `env:`, `propagateProxyEnv`, `dns` and `hostResolver`, and a project VM's size, agent mounts and `forwardAgent`.
- **Lima edits only what differs:** any `limactl edit` gives the VM new ssh host keys at its next boot, so `Start` compares first and makes one edit ([What devvm sets on a VM](docs/content/docs/internals/lima.md#what-devvm-sets-on-a-vm)).
## Messages
- **Messages use the docs voice**, only shorter: the docs-voice skill's Messages and Terms rules.
- **Every message lives in `locales/en.toml`**, called through its generated function (`msg.NoVM(dir)`); `go generate ./internal/msg` after editing. Only go-i18n's fields (`other`, `one`, `description`); snake_case plain template fields (`{{.vm_name}}`); `one` makes it plural (`count int`). Doc links go in `internal/msg/docs.go`. A message without a caller fails the tests. `msg.M` is an `error`. Never build prose with `fmt`. Message values render on one line without control or bidi characters (`msg.OneLine`, at render); a VM's text shown as data goes through `msg.Printable`. A message made from an error carries it (`.Because(err)`), not only `err.Error()`.
- **Every question declares what answers it** (`msg.X().AnsweredBy("--force")` or `.RefusedWith(msg.Y())`); `Ask`/`Confirm`/`Answer`/`Secret` return its refusal where devvm can't ask (no terminal, `--no-input`, end of input), which callers return or fall back on, never checking for a terminal. The CLI tests answer with `ttyin` or `DEVVM_PIPED_ANSWERS=1`.
- An error or warning is at most two sentences; a prompt gets at most two lines of context.
- **The mechanism goes in the doc link**, not the message: every warning or error the user can act on has one.
- Status steps stay a few words, lowercase. Commands are written as devvm x, not quoted. No "please", "note that" or "simply". `[y/N]`/`[Y/n]` stay literal.
- Not messages: data output and text in scripts that run elsewhere.
- **Tests check which message and with what, never its wording:** `DEVVM_MESSAGES=names` prints `no_vm dir=/x`; `devvm _msg NAME k=v…` gives e2e the text.
- **Every message lives in `locales/en.toml`**, called through its generated function (`go generate ./internal/msg` after editing), with its doc link in `internal/msg/docs.go`; prose is never built with `fmt` ([Messages](docs/content/docs/contributing/cli.md#messages)).
- **Every question declares what answers it** (`AnsweredBy`, `RefusedWith`), and callers never check for a terminal ([Questions](docs/content/docs/contributing/cli.md#questions)).
- **Messages use the docs voice, only shorter:** the docs-voice skill's [Messages](.agents/skills/docs-voice/SKILL.md#messages) and Terms rules; the mechanism goes in the doc link.
- **Tests check which message and with what, never its wording** ([Names mode](docs/content/docs/contributing/cli.md#names-mode)).
## Testing
- **Unit tests** are Go table tests next to the code; **CLI tests** are testscript against the built binary in a `/tmp` sandbox in names mode, stubs first on `PATH` (`stub_calls`, `stub_reset`), with `project`, `vm_name`, `catg`, `vm_state`, `json_set` and `$DATA`/`$VMS`/`$RUN`/`$CFG`; the binary has `assets/` embedded (no override: scripts read `$DEVVM_REPO/assets/`; rebuild before a manual run after editing them). New logic needs a test. Neither touches the Keychain, real VMs or the user's folders; state-writing tests point the XDG folders at `t.TempDir()`. Go tests never run up: scripts do.
- **New logic needs a test:** Go table tests next to the code, and CLI tests (testscript against the built binary and the stubs); neither touches the Keychain, real VMs or your folders ([Tests](docs/content/docs/contributing/tests.md)).
- **Never touch VMs, images or containers devvm's tests didn't make:** your own stay as they are. Manual runs: `DEVVM_LIMA_HOME=~/.lt LIMA_HOME=~/.lt XDG_DATA_HOME=/tmp/x/data XDG_CONFIG_HOME=/tmp/x/config DEVVM_SECRET_SERVICE=devvm-sandbox-test` (devvm's Lima home is `$XDG_DATA_HOME/devvm/lima` unless `DEVVM_LIMA_HOME`; `LIMA_HOME` is for your `limactl`). Add a `config.toml` with `features = []` and pass `--network TIER` so nothing prompts. Delete test Keychain items. Never use your own tokens or logins: a network-policy VM reads its agent's login file from `HOME`, so give it its own (the Keychain needs the real `HOME`: test it apart).
- **End-to-end:** `mise run e2e -- FLAGS` (`--only`, `--from`, `--clean`, `--slots`, `--golden`…) builds devvm from the checkout and drives real VMs in its sandbox (`~/.lt-e2e-go`, `/tmp/devvm-go-e2e`, service `devvm-go-e2e`), deleting only what it made; images stay cached (`--clean`). `--slots N` spreads the sections over N sandboxes at once (slot K's paths end `-K`, its ports +100·K, its images cloned from slot 0's). Only `tools` resolves the newest tool versions; the rest use the pinned lock, and `--from` images go by pinned digest but one tag (`scripts/bump.sh e2e-tools e2e-from`). Run it in the background. Sections: `images`, `project`, `clone` (a throwaway repo, its own `HOME`), `gc` (an `img-*` folder's VM, a stale fixture), `tools` (a node VM), `network` (a VM with Claude Code, Codex and opencode), `desktop` (a base VM refused, then the desktop layer, devvm desktop), `nix` (a node VM with the nix layer and a flake), `from` (Debian 12, Alpine and Ubuntu bases, a docker that isn't running), `link` (two targets and a client, then the three in a group, the design note's threat check). Tiers: none (all but `desktop` and `from`, no features); `--from` (everything, every feature; before merging `assets/` or `--from` changes); `--only a,b` (with `from`: every feature). Hosted CI can't run it on macOS.
- **Linux hosts:** `LIMA_HOME=~/.lt-linux-go`, VM `linuxhost` (nested virtualization, the repo read-only, copied to `~/devvm`), set up as [testing.md](docs/content/docs/contributing/testing.md) says, apart from any Lima home of your own.
- **Unreviewed emulations** are checked through `DEVVM_UNREVIEWED=backend:feature`, which only test builds (e2e's, the CLI tests', by ldflags) read.
- **End-to-end:** `mise run e2e -- --only SECTIONS` in the background for what changed, `--from` before merging `assets/` or `--from` changes ([End-to-end tests](docs/content/docs/contributing/tests.md#end-to-end-tests)).
- **Linux hosts:** `LIMA_HOME=~/.lt-linux-go`, VM `linuxhost`, set up as [Linux hosts](docs/content/docs/contributing/testing.md#linux-hosts) says, apart from any Lima home of your own.
- **Unreviewed emulations** are checked through `DEVVM_UNREVIEWED=backend:feature`, in test builds only ([Unreviewed emulations](docs/content/docs/contributing/testing.md#unreviewed-emulations)).
- **Delete test VMs and temp files afterwards.** Long builds run in the background. Tests that `chflags` real files unlock them (`chflags -R nouchg`), only in their own temp folders.
- **The testscript runner stops the sandbox's proxies** (`pkill -f` on `_proxy -config` in the sandbox): the stub hostagent is gone before they look, so they'd wait 15 minutes.
- **The testscript runner stops the sandbox's proxies** (`pkill -f` on `_proxy -config` in the sandbox): the stub hostagent is gone before they look, so they'd wait 15 minutes. It also stops the sandbox's port forwarders, link sessions and stub ssh masters.
- **`limactl shell` reads stdin:** give it none unless the input is meant for it.
- **Boot problems:** read `<devvm's Lima home>/<vm>/serialv.log` before restarting; every start overwrites it.
## Gotchas learned
- **Lima `vz`:** raw disks only; clones are APFS copy-on-write (`du` overcounts). Direct kernel boot needs an uncompressed arm64 `Image`. Stopping sends a GPIO power key, so guests need `gpio_keys`, or Lima hard-kills them after 30 s. Lima can't shrink disks. virtiofs tags are `lima-<hash>`. The project mount is `/.vol/<dev>/<ino>` at its path; vz serves a share by the path it had at the start, so a rename while it runs gives "Operation not permitted". After root touches a directory on a virtiofs mount, the guest sees it as root's for a few seconds (git: "dubious ownership"). `mounts: []` doesn't remove the home mount from `base: template:…`: pass `--mount-none` (or `--mount-only`) to `limactl create`/`clone`.
- **Lima can report a failed start for a VM that is running but degraded.** Starting tolerates it.
- **`limactl list --json` fills in the config:** mounts get `mountPoint`, port forwards a `guestIP` (`127.0.0.1`) and host side; compare only what devvm set. `--set` applies after `--mount-none`. `limactl create` downloads the image at once (no dry run).
- **`limactl shell` quotes each argument for the guest's shell**, so `Exec` passes `sh -c` and one `shell.QuoteJoin` string. QEMU's guestfwd command goes through `/bin/sh -c` too, commas doubled.
- **The ssh socket path limit (104 characters)** bounds VM names (`NameMax`).
- **The ssh socket path limit (103 characters at most: macOS's 104 include the NUL)** bounds VM names (`NameMax`).
- **Linux hosts (QEMU):** mounts are 9p, and a 9p share mounts once per guest. Debian's tmpfs `/tmp` hides anything mounted below it during boot. Project VMs' qcow2 disks are overlays of their image's, so never start an image VM or write its disk after it's built.
- **Shared tools:** mise rewrites `latest`/`24`/`lts` links in a tool's folder after any install, so those folders are local in the VM; only version folders are mounted.
- **Lima can report a failed start for a VM that is running but degraded;** starting tolerates it.
- **Linux's `pgrep -f` matches the shell running it** (procps), so e2e's patterns are written `[_]proxy`. mise skips minisign on linux/arm64 (no build).
- **Lima writes `lima.REJECTED.yaml` into the current folder** on an invalid config: run `limactl` outside the repo (devvm runs it from its data folder).
## Commits and tasks
- Tasks are in dex (`.dex/`, git-ignored).
- **One commit when each task is complete**, its Docs and Review subtasks included. Conventional Commits: `type(scope): summary`, types `feat`, `fix`, `docs`, `test`, `refactor`, `build`, `ci`, `chore`. Then `dex complete <id> --commit <sha>`.
- **Don't commit or `dex complete` until the gate passes**, with whatever `mise run fmt` changed in the commit.
- **Dex task IDs never go in commit messages, code comments or docs.**
- **AGENTS.md stays short:** one line per path or rule. Inventories (functions, messages, test names) go in the commit message and the `dex complete` result, not here.
- **One commit when each task is complete**, its docs and review included. Conventional Commits: `type(scope): summary`, types `feat`, `fix`, `docs`, `test`, `refactor`, `build`, `ci`, `chore`.
- **Don't commit until the gate passes**, with whatever `mise run fmt` changed in the commit.
- **Task IDs from any tracker never go in commit messages, code comments or docs.**
- **AGENTS.md stays short:** one line per path or rule. Inventories (functions, messages, test names) go in the commit message, not here.
+50
View File
@@ -1,5 +1,55 @@
# Changelog
## 0.1.1-rc.2
A release candidate for 0.1.1, adding to 0.1.1-rc.1. Install it with `devvm upgrade --to 0.1.1-rc.2`, the install script's `--version 0.1.1-rc.2`, or `brew install devvmhq/tap/devvm-rc`. Homebrew's `devvm` stays on 0.1.0.
### After you upgrade
- Base and every image built on it are built again once, for transparent mode's programs.
- Run `devvm update` in an existing VM's folder to give it transparent mode, which new VMs get by default: its image predates the programs it needs.
- On a Linux host, run `devvm mount-cache none` for each existing VM, to stop the 9p cache bug below. Each launch reminds you until you do.
- If you used `devvm git-protect strict`, use `devvm clone on` for code you don't trust: strict is gone.
- Make new API keys for any VM you don't trust that had keys passed to it as they were.
### New
- **Transparent mode (#35), on by default:** on every tier but open, tools that ignore the proxy settings, such as `wrangler dev`, static Go binaries and containers, reach the VM's proxy and its allowlist anyway. A VM made before needs `devvm update` first, and `devvm network transparent off` turns it off for a VM ([what it covers](https://next.devvm.dev/docs/safety/network/#tools-that-ignore-the-proxy)).
- **Folders of repos with `--clone` (#3):** one VM gets a clone of each repo you pick, at the same paths. `devvm clone fetch` brings back every repo's work, and `devvm clone add PATH` adds one ([folders of repos](https://next.devvm.dev/docs/using/clone/#folders-of-repos)).
- **Rules by HTTP method and path:** `devvm network allow|deny HOST --method … --path …`, such as `devvm network deny api.github.com --method POST,PUT,PATCH,DELETE`.
- **Your own secrets:** `devvm secret set NAME --host HOST --env VARIABLE`, then `devvm secret use NAME`. The VM only ever sees a placeholder, and `--method` and `--path` limit where the real value goes.
- **Learning a VM's hosts (#17):** `--network learn`, then `devvm network lock` to keep the hosts you choose.
- **`.git` protection on Linux (#4, #20):** `.git` is locked read-only around QEMU, without root. Where a host can't, such as Ubuntu with AppArmor, devvm watches `.git`, warns at each launch, and names what changed.
- **Nested repos (#3):** a VM protects the `.git` of each repo up to 4 folders down. `devvm doctor` suggests `safe.bareRepository explicit`.
- **pi and more providers (#23, #31, #32):** pi is a fourth agent, and Gemini, Groq, Mistral, xAI and DeepSeek keys stay on this machine.
- **Prereleases on Homebrew (#19):** `brew install devvmhq/tap/devvm-rc`.
### Changed
- **The 9p cache on Linux (#36):** Lima's default cache could write files to this machine empty or cut short, and made SQLite and Gradle fail. New Linux VMs use `none`, and `devvm mount-cache none` switches existing ones. Under `none`, keep SQLite WAL databases and other files that programs map for writing on the VM's own disk, or use `--clone`. macOS doesn't change.
- **A `--clone` VM in a folder another VM mounts** is refused, and `devvm rm` asks before deleting one made earlier.
- **Logins:** a VM's copy of Codex's and Claude Code's login files keeps only the fields devvm knows. opencode, like pi, gets no key devvm doesn't bind, unless you list the provider in `config.toml`'s `[pass-keys]` (#30).
- **Warnings** print once per command.
- **Nix** is 2.35.5.
### Removed
- **`devvm git-protect strict` (#37):** it couldn't keep git on this machine out of submodules the VM adds, so it's a usage error now. Strict VMs become `on`, and devvm takes out the `diff.ignoreSubmodules = all` it set, keeping a value of your own ([VMs that were strict](https://next.devvm.dev/docs/safety/git-protection/#vms-that-were-strict)).
### Fixed
- opencode's history copy with SQLite 3.54 (#26), a NUL byte in an ssh socket's path (#25), a build VM reusing its clone's ssh port, a login saved for an agent the VM lacks (#27), and `.git` protection locking a folder that only looks like a git folder (#28).
## 0.1.1-rc.1
A release candidate for 0.1.1, for trying the changes below before the release. Install it with `devvm upgrade --to 0.1.1-rc.1`, or with the install script's `--version 0.1.1-rc.1`. Homebrew stays on 0.1.0.
- **A dotnet toolchain:** the .NET SDK is a shared toolchain, chosen by a folder's `*.sln`, `*.slnx`, `*.csproj`, `*.fsproj` or `global.json`, and a `global.json`'s `sdk.version` picks the SDK. devvm downloads Microsoft's archive for each platform and checks its SHA-512, global tools and workloads go to the VM's home folder, and the .NET CLI's telemetry is off ([toolchains](https://next.devvm.dev/docs/using/toolchains/)).
- **A network that inspects TLS:** devvm's own mise, which looks up the shared tools' versions on this machine, now trusts the CAs in `~/.config/devvm/ca` as well as the system's, so resolving works behind a proxy that re-signs HTTPS. When a certificate isn't trusted, devvm says so and points to the docs instead of saying to check the connection. On macOS, the CA also has to be trusted in the Keychain.
- **Release candidates:** devvm can ship prereleases, such as this one. `devvm upgrade --to` installs one, and devvm upgrade, the release check and the install script's default never pick one on their own.
- **Lima 2.2 or newer:** devvm needs Lima 2.2 at least, and it's tested with Lima 2.3. `devvm doctor` says when Lima is older.
- **Updated pins:** base's docker is 29.9.3, mise 2026.11.3, rustup 1.29.3, and tealdeer 1.9.1, with a newer oh-my-bash. The shared tools' backends are named, so mise's registry can't switch opencode to a source with no downloads. base installs ICU, which .NET needs, so base and every image built on it are built again once.
## 0.1.0
Released 2026-11-06.
+2
View File
@@ -9,3 +9,5 @@ Before sending a change, run:
```sh
mise run fmt && mise run lint && mise run test
```
Pull requests are squash-merged, and the pull request's title becomes the commit's subject, so write it as a [Conventional Commit](https://www.conventionalcommits.org/), `type(scope): summary`, with a type of `feat`, `fix`, `docs`, `test`, `refactor`, `build`, `ci` or `chore`. A check fails a title that doesn't follow it.
+4 -3
View File
@@ -30,7 +30,7 @@ Then run `devvm doctor`, which checks what devvm needs on your machine and says
Each release is signed with devvm's minisign key, `RWSjzFsn7ETaijKJ2y7F4DtZobXmyv+LmdclJwZP/KmAkLUwOCzWF/2b`, and [Checking the install script](https://devvm.dev/docs/internals/install/#checking-the-install-script) shows how to check the script with it before you run it.
- **Requirements:** macOS 13 or newer, or Linux, on arm64 or x86_64, with Lima 2.0 or newer ([Lima's requirements](https://devvm.dev/docs/backends/lima/#requirements)).
- **Requirements:** macOS 13 or newer, or Linux, on arm64 or x86_64, with Lima 2.2 or newer ([Lima's requirements](https://devvm.dev/docs/backends/lima/#requirements)).
- **Tested on** Apple silicon Macs and on Linux on arm64 and x86_64, but not yet on Intel Macs.
- [Installing](https://devvm.dev/docs/getting-started/install/) has the full list of requirements and the install script's options, and [Upgrading and uninstalling](https://devvm.dev/docs/using/upgrading/) covers what comes later.
@@ -58,8 +58,8 @@ devvm
## What's supported
- **Toolchains:** devvm detects them from the project's files, so a folder with `package.json` gets node ([toolchains](https://devvm.dev/docs/using/toolchains/)).
- **Coding agents:** Claude Code, Codex and opencode run in the VM, with your settings, skills and MCP servers. devvm keeps their settings and logins in a store of its own, and `devvm agent import` copies them in from an agent you already use on your machine ([coding agents](https://devvm.dev/docs/using/coding-agents/)).
- **Toolchains:** devvm detects them from the project's files, so a folder with `package.json` gets node, and the [toolchains](https://devvm.dev/docs/using/toolchains/) page lists them all.
- **Coding agents:** Claude Code, Codex, opencode and pi run in the VM, with your settings, skills and MCP servers. devvm keeps their settings and logins in a store of its own, and `devvm agent import` copies them in from an agent you already use on your machine ([coding agents](https://devvm.dev/docs/using/coding-agents/)).
- **Layers:** the built-in `docker`, `nix` and `desktop` layers, and your own from `devvm layer new` ([layers](https://devvm.dev/docs/using/images/#layers)).
- **Backend:** devvm runs its VMs on [Lima](https://lima-vm.io) ([backends](https://devvm.dev/docs/backends/)).
@@ -92,6 +92,7 @@ The docs are at [devvm.dev](https://devvm.dev/), and their source is in `docs/`.
- [Using devvm](https://devvm.dev/docs/using/): images and tools, clones, links between VMs, ports and size, coding agents, SSH and editors, and troubleshooting.
- [Staying safe](https://devvm.dev/docs/safety/): the habits that keep you safe, network tiers, `.git` protection and attack vectors.
- [Backends](https://devvm.dev/docs/backends/): Lima, which runs the VMs, and what it gives them.
- [Compared to other tools](https://devvm.dev/docs/compared/): how devvm differs from Docker Sandboxes and other sandboxes.
- [CLI reference](https://devvm.dev/docs/cli/): every command, with its arguments and flags.
- [How it works](https://devvm.dev/docs/internals/): how devvm does what it does, for checking a claim or reviewing its security.
- [Contributing](https://devvm.dev/docs/contributing/): building, testing and writing docs.
+1 -1
View File
@@ -1 +1 @@
0.1.0
0.1.1-rc.2
+78 -9
View File
@@ -1,28 +1,97 @@
package assets
import (
"crypto/sha256"
"crypto/sha512"
"encoding/hex"
"io/fs"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
)
// Every VM's shells get the tools' environment from base's
// /etc/profile.d/devvm-tools.sh, which turns off the agents'
// self-updates: their installs are read-only shared tools, and mise pins
// their versions.
func TestToolsEnvironment(t *testing.T) {
// heredoc is the body of the heredoc that base.sh starts with this line,
// up to its end marker.
func heredoc(t *testing.T, start, end string) string {
t.Helper()
b, err := fs.ReadFile(FS, "layers/base.sh")
if err != nil {
t.Fatal(err)
}
_, rest, ok := strings.Cut(string(b), "/etc/profile.d/devvm-tools.sh >/dev/null <<'SH'\n")
block, _, closed := strings.Cut(rest, "\nSH\n")
_, rest, ok := strings.Cut(string(b), start+"\n")
block, _, closed := strings.Cut(rest, "\n"+end+"\n")
if !ok || !closed {
t.Fatal("base.sh writes no /etc/profile.d/devvm-tools.sh")
t.Fatalf("base.sh has no %q", start)
}
for _, line := range []string{"export DISABLE_AUTOUPDATER=1", "export OPENCODE_DISABLE_AUTOUPDATE=1"} {
return block
}
// Every VM's shells get the tools' environment from base's
// /etc/profile.d/devvm-tools.sh, which reads the toolchains' environment
// (their telemetry off, their global installs into the VM's home) and
// their folders for the PATH from /etc/devvm/toolchains.sh, and the
// agents' (their self-updates, version checks and telemetry off) from
// /etc/devvm/agents.sh, which every launch's setup writes, so base holds
// none of it (internal/vm's TestToolchainsOwnTheirEnvironment): their
// installs are read-only shared tools, and mise pins their versions.
// Non-login shells read it too (BASH_ENV), but not devvm-telemetry.sh, so
// no agent's switch is there.
func TestToolsEnvironment(t *testing.T) {
block := heredoc(t, "sudo tee /etc/profile.d/devvm-tools.sh >/dev/null <<'SH'", "SH")
for _, line := range []string{
"if [ -r /etc/devvm/toolchains.sh ]; then . /etc/devvm/toolchains.sh; fi",
` export PATH="$devvm_path$HOME/.local/bin:$HOME/.local/share/mise/shims:$PATH" ;;`,
"if [ -r /etc/devvm/agents.sh ]; then . /etc/devvm/agents.sh; fi",
} {
if !strings.Contains("\n"+block+"\n", "\n"+line+"\n") {
t.Errorf("devvm-tools.sh lacks %q", line)
}
}
telemetry := heredoc(t, "sudo tee /etc/profile.d/devvm-telemetry.sh >/dev/null <<'SH'", "SH")
for _, v := range []string{"DISABLE_AUTOUPDATER=", "DISABLE_TELEMETRY=", "DISABLE_ERROR_REPORTING=", "OPENCODE_", "PI_"} {
if strings.Contains(block, "export "+v) || strings.Contains(telemetry, "export "+v) {
t.Errorf("base sets %s, an agent's, which the setup's agents.sh sets", v)
}
}
}
// base.sh's devvm-fetch keeps a download only when its checksum is the
// one given: a SHA-256, or a SHA-512 by its length.
func TestDevvmFetch(t *testing.T) {
for _, c := range []string{"sh", "curl", "sha256sum", "sha512sum", "cut"} {
if _, err := exec.LookPath(c); err != nil {
t.Skip("no " + c)
}
}
dir := t.TempDir()
script := filepath.Join(dir, "devvm-fetch")
if err := os.WriteFile(script, []byte(heredoc(t, "sudo tee /usr/local/bin/devvm-fetch >/dev/null <<'SH'", "SH")+"\n"), 0o600); err != nil {
t.Fatal(err)
}
src := filepath.Join(dir, "src")
body := []byte("an archive\n")
if err := os.WriteFile(src, body, 0o600); err != nil {
t.Fatal(err)
}
s256, s512 := sha256.Sum256(body), sha512.Sum512(body)
for _, tc := range []struct {
name, sum string
ok bool
}{
{"its SHA-256", hex.EncodeToString(s256[:]), true},
{"its SHA-512", hex.EncodeToString(s512[:]), true},
{"another SHA-256", strings.Repeat("0", 64), false},
{"another SHA-512", strings.Repeat("0", 128), false},
{"its SHA-256 twice", strings.Repeat(hex.EncodeToString(s256[:]), 2), false},
} {
out := filepath.Join(dir, "out")
err := exec.CommandContext(t.Context(), "sh", script, "file://"+src, tc.sum, out).Run() //nolint:gosec // base.sh's devvm-fetch, on the test's own files
_, kept := os.Stat(out)
if (err == nil) != tc.ok || (kept == nil) != tc.ok {
t.Errorf("%s: %v, kept %v", tc.name, err, kept == nil)
}
_ = os.Remove(out)
}
}
+3 -3
View File
@@ -8,9 +8,9 @@ set -euxo pipefail
eza_version=0.23.5
eza_sha256_arm64=40b87ae8628aa2ff0f0d2dc24ab52f689631366385c3da630bae745671fd71ec
eza_sha256_amd64=e06eebab74b73d6b7d51a796a353824b001bea82df077706382e100815d28904
tealdeer_version=1.9.0
tealdeer_sha256_arm64=a748f181c00933980cb850f4a24199c45900fc523787f6c524232a6bfc66b895
tealdeer_sha256_amd64=dc7263b550e90c0689ea2cb434e3144469805d5dddecbb1f7fc534e1185b7408
tealdeer_version=1.9.1
tealdeer_sha256_arm64=247746dd2d18f0135da79b849bb6b49e45262e2fe4318adfc3082dc6ce3ee968
tealdeer_sha256_amd64=5a9c3f0691b9cf375ee5c99de802885f3d50498cf686a539e2ddda028eb6b4f6
if [[ $devvm_libc == musl ]]; then
# Alpine packages eza too (its arm64 release build below is glibc).
+1 -1
View File
@@ -2,7 +2,7 @@
# oh-my-bash: themed prompt, completions, aliases
set -euxo pipefail
# Pinned commit (scripts/bump.sh updates it); git checks the content against it.
omb_commit=abf846186ab0a8a41ec5888e827ece6277dfe446
omb_commit=94c2977eda06f230aafa9628fcd869123f01896b
# Its own installer, from the pinned commit and cloning from it (OSH_REPOSITORY), so nothing comes
# from master. Replaces ~/.bashrc (backed up first); re-add the ~/.bashrc.d loader afterwards.
+3 -3
View File
@@ -20,17 +20,17 @@ Every request goes through a proxy that devvm runs on the host, and the VM's net
| `allowlist` | only the hosts on the VM's allowlist (the default) |
| `none` | only its agents' hosts, its secrets' hosts and its links |
The VM doesn't record its tier, and the user sees it with devvm network on the host. A request that the tier refuses fails with a 403 from the proxy, which names the host and the rule that would allow it, and on every tier but open a direct connection or a DNS lookup that skips the proxy fails at once.
The VM doesn't record its tier, and the user sees it with devvm network on the host. A VM can also learn the hosts it needs: it's on the internet tier while it learns, and once the user runs devvm network lock on the host, it's on the allowlist tier with the hosts the user kept, so a host that works while it learns may be blocked after. A request that the tier refuses fails with a 403 from the proxy, which names the host and the rule that would allow it, and on every tier but open a direct connection to an address fails at once.
- Run `devvm-why` to see what the proxy blocked lately. A note before each shell prompt says when something new was blocked.
- The proxy settings are in the environment (`HTTP_PROXY`, `HTTPS_PROXY` and their lowercase forms). A tool that ignores them, such as Java, needs the proxy's address in its own settings. A DNS or connection error for a host the tier allows means the tool skipped the proxy, and devvm-why doesn't show it.
- The proxy settings are in the environment (`HTTP_PROXY`, `HTTPS_PROXY` and their lowercase forms). On every tier but open, a tool that ignores them still reaches the proxy by the names it looks up, over HTTPS and HTTP and on the ports the rules name, unless the user turned transparent mode off: every name resolves to 198.18.0.1, and the proxy reads the real host from the connection and judges it the same way, so a blocked HTTPS host shows the proxy's 403. Another port of such a name is refused at once, and so is a protocol that names no host, such as a database's, so a tool like that needs the proxy's address in its own settings. `devvm-why` lists both what the proxy blocked and what the VM refused.
- No secret is in the VM. `GH_TOKEN`, `CLAUDE_CODE_OAUTH_TOKEN` and the agents' logins hold placeholders, and the proxy puts the real value into each request for that secret's hosts. Use them as they are, and don't copy them anywhere else, because they work nowhere but through this VM's proxy.
- git over ssh goes through the proxy too, with `devvm-ssh-proxy` as its ProxyCommand, so the host must be one the tier allows.
- Browsers ask for a proxy's password, so they use `devvm-local-proxy`, which the desktop starts on the VM's loopback.
## Tools and installs
- The toolchains (node, python, rust, go) and the coding agents are shared tools, mounted read-only from images that every VM shares. They can't update themselves, and global installs go into your home: `npm i -g` installs into `~/.npm-global`, and Python's packages go into a virtual environment or `~/.local/bin`.
- The toolchains, such as node ([the list](https://devvm.dev/docs/using/toolchains/)), and the coding agents are shared tools, mounted read-only from images that every VM shares. They can't update themselves, and global installs go into your home: `npm i -g` installs into `~/.npm-global`, Python's packages go into a virtual environment or `~/.local/bin`, and `dotnet tool install -g` installs into `~/.dotnet/tools`.
- mise runs the shared tools. A project that asks for another version, in `.tool-versions`, `mise.toml` or its own toolchain file, gets it from mise, which installs it in your home on first use.
- `sudo` needs no password, and `apt install` (`apk add` on Alpine) goes through the proxy, whose allowlist for every VM has Ubuntu's, Debian's and Alpine's package hosts. What it installs is lost when the VM is made again.
- `devvm-fetch URL SHA256 OUT` downloads a file and fails when its checksum doesn't match.
+63 -10
View File
@@ -14,9 +14,21 @@
# vm DEVVM_* host settings applied to every VM: hostname, timezone, locale, git identity,
# DEVVM_PROXY (the proxy URL, empty when the guest has none),
# DEVVM_NO_PROXY (what reaches the VM itself without the proxy; its links go through it),
# and DEVVM_LOCAL_PROXY (ADDRESS:PORT on the VM's loopback, where devvm-local-proxy
# listens; empty without a proxy)
# DEVVM_LOCAL_PROXY (ADDRESS:PORT on the VM's loopback, where devvm-local-proxy
# listens; empty without a proxy), and DEVVM_TRANSPARENT_ADDR and
# DEVVM_TRANSPARENT_HOST (transparent mode's stand-in address, empty for off, and the
# proxy's reserved target; transparent.sh)
# transparent.sh devvm-transparent: transparent mode, for tools that ignore the proxy settings
# tools the VM's shared tool images, "FILE TOOL VERSION" lines; tools.sh mounts them
# tool-alias.toml the [tool_alias] table of devvm's shared-tools/mise.toml: the backend each
# tool's image was built from, which mise's registry might not give its name
# agent-env export lines of every coding agent's guest environment (its self-update, version
# check and telemetry off), installed as /etc/devvm/agents.sh, which devvm-tools.sh reads
# toolchain-env export lines of every toolchain's guest environment (its telemetry off, its global
# installs into ~), then devvm_path, their folders of ~ for the PATH, each followed by a
# colon; installed as /etc/devvm/toolchains.sh, which devvm-tools.sh reads
# version-files.toml the VM's mise's idiomatic_version_file_enable_tools setting: the toolchains'
# tools whose version files (.nvmrc, global.json) a project chooses versions with
# opencode-import.json the store's opencode logins as opencode auth import reads them, with
# placeholders (none: no opencode login in the store); opencode.sh imports them
# hosts the VM's links (devvm checked them): a line per target, "ADDRESS NAME
@@ -72,12 +84,21 @@ if [[ -n "$DEVVM_LANG" ]] && command -v locale-gen >/dev/null && ! locale -a | g
fi
# Shared tools: mount this VM's images (at boot too, by devvm-tools.service), then tell mise which
# versions to use. /etc/mise is mise's system config: the user's own (~/.config/mise) comes first.
# versions to use, and each one's backend. /etc/mise is mise's system config: the user's own
# (~/.config/mise) comes first.
cmp -s "$s/tools.sh" /usr/local/sbin/devvm-tools 2>/dev/null || sudo install -D -m 755 "$s/tools.sh" /usr/local/sbin/devvm-tools
cmp -s "$s/tools" /etc/devvm/tools 2>/dev/null || sudo install -D -m 644 "$s/tools" /etc/devvm/tools
# The toolchains' and the agents' environment (their telemetry and self-updates off, the toolchains'
# folders for the PATH), which base's devvm-tools.sh reads in every shell, before anything here runs
# one.
cmp -s "$s/toolchain-env" /etc/devvm/toolchains.sh 2>/dev/null ||
sudo install -D -m 644 "$s/toolchain-env" /etc/devvm/toolchains.sh
cmp -s "$s/agent-env" /etc/devvm/agents.sh 2>/dev/null || sudo install -D -m 644 "$s/agent-env" /etc/devvm/agents.sh
# A tool it can't mount fails the setup, and devvm names it from /run/devvm/tools-unmounted.
sudo /usr/local/sbin/devvm-tools
{
cat "$s/tool-alias.toml"
echo
echo '[tools]'
while read -r _ tool version; do [[ -z $tool || $tool == rust ]] || echo "$tool = \"$version\""; done < "$s/tools"
cat <<'T'
@@ -85,18 +106,22 @@ sudo /usr/local/sbin/devvm-tools
[settings]
experimental = true
shared_install_dirs = ["/opt/devvm/tools"]
# A project's version files choose versions, as their own tools would; a version that isn't shared
# installs into the VM on first use. Not go: go.mod's go line is a minimum, and Go's own GOTOOLCHAIN
# reads its toolchain line.
idiomatic_version_file_enable_tools = ["node", "python", "bun", "pnpm"]
# A version that a project's version files choose and that isn't shared installs into the VM on first
# use.
auto_install = true
not_found_auto_install = true
python.compile = false
# mise points GOBIN into Go's install, which is read-only: go install goes to ~/go/bin.
go_set_gobin = false
# Each .NET SDK in a folder of its own, the shared one's its image: mise would otherwise run every SDK
# from one folder of the VM's, which the shared one isn't in.
dotnet.isolated = true
# The project folder is the user's own: trust its mise.toml without asking.
trusted_config_paths = ["/"]
T
# A project's version files choose versions, as their own tools would: the toolchains' tools that
# devvm's registry names, in [settings] still.
cat "$s/version-files.toml"
} > "$s/mise.toml"
cmp -s "$s/mise.toml" /etc/mise/config.toml 2>/dev/null || sudo install -D -m 644 "$s/mise.toml" /etc/mise/config.toml
# Links into tools this VM doesn't have any more (devvm tools rm, devvm tools update).
@@ -119,6 +144,17 @@ go=$(awk '$2 == "go" { print $3 }' "$s/tools")
if [[ -n $go && "$(cat ~/.config/go/telemetry/mode 2>/dev/null)" != off* ]]; then
/opt/devvm/tools/go/"$go"/bin/go telemetry off
fi
# .NET's global tools (~/.dotnet/tools) find the shared runtime in every shell through
# /etc/dotnet/install_location, where .NET's programs look for an installed one: mise sets
# DOTNET_ROOT only in the shells it activates.
dotnet=$(awk '$2 == "dotnet" { print $3 }' "$s/tools")
loc=$(cat /etc/dotnet/install_location 2>/dev/null || true)
if [[ -n $dotnet && $loc != "/opt/devvm/tools/dotnet/$dotnet" ]]; then
sudo mkdir -p /etc/dotnet
echo "/opt/devvm/tools/dotnet/$dotnet" | sudo tee /etc/dotnet/install_location >/dev/null
elif [[ -z $dotnet && $loc == /opt/devvm/tools/* ]]; then
sudo rm -f /etc/dotnet/install_location
fi
# Claude Code checks for itself at ~/.local/bin/claude.
claude=$(awk '$2 == "claude" { print $3 }' "$s/tools")
if [[ -n $claude ]]; then mkdir -p ~/.local/bin; ln -sfn /opt/devvm/tools/claude/"$claude"/claude ~/.local/bin/claude; fi
@@ -418,11 +454,13 @@ SH
mkdir -p ~/.ssh
proxy_block ~/.ssh/config "Host *
ProxyCommand /usr/local/bin/devvm-ssh-proxy %h %p"
# devvm-why: what the proxy blocked lately, and how to allow it.
# devvm-why: what the proxy blocked lately, and how to allow it; then, with transparent mode, what
# it refused in the VM and the names tools looked up.
sudo tee /usr/local/bin/devvm-why >/dev/null <<'SH'
#!/bin/sh
# What this VM's proxy blocked recently, and the host command that allows it.
exec curl -sS --proxy "$HTTP_PROXY" http://devvm.proxy/blocked
curl -sS --proxy "$HTTP_PROXY" http://devvm.proxy/blocked
if [ -x /usr/local/sbin/devvm-transparent ]; then sudo -n /usr/local/sbin/devvm-transparent status; fi
SH
sudo chmod 755 /usr/local/bin/devvm-why
# Before each prompt: what was blocked since the last one (HTTPS clients don't show the proxy's
@@ -451,6 +489,21 @@ else
if $systemd; then sudo rm -f "$dropin"; else conf_block "$dropin"; fi
[[ ! -f ~/.ssh/config ]] || proxy_block ~/.ssh/config
fi
# Transparent mode (transparent.sh, devvm-transparent) on a confined VM: every name resolves to the
# stand-in address, whose ports 80, 443 and those the rules name go to the proxy, which reads the host
# from the connection. The proxy URL, which holds the password, goes on stdin, never in arguments.
# Off on an open VM. An image from before transparent mode lacks its programs, so names don't resolve.
if [[ -n ${DEVVM_TRANSPARENT_ADDR:-} && -n ${DEVVM_PROXY:-} ]]; then
rc=0
printf '%s\n' "$DEVVM_PROXY" | sudo bash "$s/transparent.sh" setup "$DEVVM_TRANSPARENT_ADDR" "$DEVVM_TRANSPARENT_HOST" || rc=$?
if [[ $rc == 3 ]]; then
echo "devvm: this VM's image has no dnsmasq, socat or nft, so tools that skip the proxy can't resolve names in it; devvm update makes it again from a newer image" >&2
elif [[ $rc != 0 ]]; then
echo "devvm: transparent mode didn't start in this VM, so tools that skip the proxy can't resolve names in it; the next launch tries again" >&2
fi
else
sudo bash "$s/transparent.sh" teardown || true
fi
if command -v dockerd >/dev/null; then
docker_proxies ~/.docker/config.json
docker_proxies /root/.docker/config.json sudo
@@ -485,7 +538,7 @@ if [[ "$(cat /usr/local/bin/devvm-help 2>/dev/null)" != "$(printf '#!/bin/sh\nex
fi
# Tell agents why the network may fail, and what to do about it.
note="Network access in this VM goes through devvm's proxy, which allows what the VM's network tier allows. If a download or request fails with a connection error or a 403 from the proxy, run \`devvm-why\` to see what was blocked; the user can allow it on the host with \`devvm network allow <host>\`. A DNS or connection error for an allowed host while \`devvm-why\` shows nothing means the tool skipped the proxy: turn on its own proxy setting, or give it \`\$HTTPS_PROXY\`."
note="Network access in this VM goes through devvm's proxy, which allows what the VM's network tier allows. If a download or request fails with a connection error or a 403 from the proxy, run \`devvm-why\` to see what was blocked; the user can allow it on the host with \`devvm network allow <host>\`. A tool that ignores the proxy settings still reaches the proxy over HTTPS and HTTP, and on the ports the rules name, by the names it looks up (transparent mode). A connection refused on another port, or a DNS error where transparent mode is off, while \`devvm-why\` shows nothing blocked means the tool skipped the proxy: turn on its own proxy setting, or give it \`\$HTTPS_PROXY\`."
for f in ~/.claude/CLAUDE.md ~/.codex/AGENTS.md; do
[[ -d "$(dirname "$f")" ]] || continue
[[ -f "$f" ]] && sed -i '/^<!-- devvm-proxy -->/,/^<!-- \/devvm-proxy -->/d' "$f"
+493
View File
@@ -0,0 +1,493 @@
#!/bin/bash
# devvm-transparent: transparent mode, for tools that ignore the proxy settings on a confined VM.
# dnsmasq answers every name with the stand-in address (proxy.SentinelAddr, on lo) and nothing else,
# with no upstream, so no DNS query leaves the VM. nftables sends a connection to one of the
# stand-in address's ports (80, 443 and the ports the VM's allow rules name, from the proxy's
# /transparent/ports) to a socat listener on that address, which makes it an ordinary CONNECT to the
# VM's proxy with the VM's password, for the reserved target (proxy.TransparentHost) at that port.
# The proxy reads the host from the connection's first bytes and judges it as any CONNECT. Every
# other port of the address is refused at once, and DNS to a public server goes to dnsmasq too.
# None of it is a boundary: the host confines the VM to its proxy, whatever root here changes.
# devvm-transparent setup ADDR HOST < PROXY_URL root, sync.sh: install it all, start the service
# devvm-transparent teardown root, sync.sh: stop the service, remove it all
# devvm-transparent run the service: start and watch what it runs
# devvm-transparent down the service's stop: the table, the address, the children
# devvm-transparent status devvm-why, as root: whether it runs, refusals, names
# devvm-transparent render PORT=LISTEN... the ruleset for those ports and their listeners, and
# DEVVM_TRANSPARENT_RESOLVERS's name servers
# devvm-transparent slots PORT... each port's listener, keeping the ports that stay
# devvm-transparent valid FILE whether FILE is a port list the ruleset takes
# Exit 3 from setup: dnsmasq, socat or nft is missing (an image from before transparent mode).
set -u
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
tp=${DEVVM_TRANSPARENT_DIR:-/etc/devvm/transparent}
run_dir=/run/devvm-transparent
self=/usr/local/sbin/devvm-transparent
user=devvm-transparent
table=devvm_transparent
# The listeners' ports: 80's, 443's and 32 more, above Linux's ephemeral range (32768-60999), so no
# connection out or bind(0) is given one; dead has no listener, so what goes there is refused.
listen80=61080 listen443=61443 first_slot=61100 last_slot=61131 dead=61079
# The VM's own name servers the loaded ruleset sends to dnsmasq (apply).
resolvers=''
# load_env: addr, host, proxy_host and proxy_port from the env file setup wrote.
load_env() {
addr='' host='' proxy_host='' proxy_port=''
# shellcheck source=/dev/null
[[ -f $tp/env ]] && . "$tp/env"
[[ -n $addr && -n $host && -n $proxy_host && -n $proxy_port ]]
}
# valid_ports FILE: 2 to 34 lines, each a port from 1 to 65535 in digits, once, never 22 or 53, with
# 80 and 443 among them. Anything else from the proxy is kept out of the ruleset.
valid_ports() {
local p n=0 seen=' '
while IFS= read -r p; do
n=$((n + 1))
[[ $p =~ ^[1-9][0-9]{0,4}$ ]] && ((p <= 65535)) && [[ $p != 22 && $p != 53 && $seen != *" $p "* ]] || return 1
seen+="$p "
done <"$1"
((n >= 2 && n <= 34)) && [[ $seen == *' 80 '* && $seen == *' 443 '* ]]
}
# slots PORT...: "PORT LISTEN" for each port, 80 and 443 on their own listeners, the others each on
# the one the slots file gave it, while they stay, else on the lowest that's free.
slots() {
local p l used=' ' pending='' out=''
for p in "$@"; do
case $p in
80) out+="80 $listen80"$'\n' ;;
443) out+="443 $listen443"$'\n' ;;
*)
l=$(awk -v p="$p" '$1 == p { print $2; exit }' "$tp/slots" 2>/dev/null)
if [[ $l =~ ^[0-9]+$ ]] && ((l >= first_slot && l <= last_slot)) && [[ $used != *" $l "* ]]; then
used+="$l " out+="$p $l"$'\n'
else
pending+="$p "
fi
;;
esac
done
for p in $pending; do
for ((l = first_slot; l <= last_slot; l++)); do
[[ $used == *" $l "* ]] && continue
used+="$l " out+="$p $l"$'\n'
break
done
done
printf '%s' "$out"
}
# render PORT=LISTEN...: the ruleset, one transaction that replaces the table whole. Both NAT chains
# run before Docker's (dstnat, -100: priorities are numbers, which Debian 12's nft needs here) and
# give every TCP and UDP port of the stand-in address a
# mapping, so Docker's chains, which would send a published port's traffic to a container, never
# see one: a redirected port goes to its listener, DNS to dnsmasq, and every other port to the dead
# port, which refuses it at once. DNS to any public server goes to dnsmasq, and so does DNS to the
# VM's own name servers ($resolvers, own_resolvers), which Docker gives containers; loopback's other
# addresses, private, link-local and CGNAT ones are left as they are. 127.0.0.1:53 is where the
# VM's resolver asks (Lima's DNS setting): it goes to dnsmasq, which listens on the stand-in
# address alone, so nothing of transparent mode listens on loopback.
render() {
local pl r redirects='' own='' a=${addr:-198.18.0.1}
for pl in "$@"; do
redirects+=" ip daddr $a tcp dport ${pl%%=*} dnat ip to $a:${pl#*=}"$'\n'
done
for r in ${resolvers:-}; do own+="${own:+, }$r"; done
if [[ -n $own ]]; then
redirects+=" ip daddr { $own } udp dport 53 dnat ip to $a:53"$'\n'
redirects+=" ip daddr { $own } tcp dport 53 dnat ip to $a:53"$'\n'
fi
cat <<EOF
table inet $table
delete table inet $table
table inet $table {
set kept {
type ipv4_addr; flags interval
elements = { 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.168.0.0/16, $a }
}
# Before every NAT chain (-150): the stand-in address takes only the VM's own and Docker's bridges,
# and only TCP, UDP and ICMP, so another bridge (Podman's, LXD's) or a protocol the NAT chains don't
# map (SCTP) never reaches Docker's DNAT of a published port through it.
chain early_in {
type filter hook prerouting priority -150; policy accept;
ip daddr $a iifname != "lo" iifname != "docker0" iifname != "br-*" drop
ip daddr $a meta l4proto != { tcp, udp, icmp } drop
}
chain early_out {
type filter hook output priority -150; policy accept;
ip daddr $a meta l4proto != { tcp, udp, icmp } drop
}
chain output {
type nat hook output priority -110; policy accept;
${redirects} jump sentinel
ip daddr 127.0.0.1 udp dport 53 dnat ip to $a:53
ip daddr 127.0.0.1 tcp dport 53 dnat ip to $a:53
ip daddr != @kept udp dport 53 dnat ip to $a:53
ip daddr != @kept tcp dport 53 dnat ip to $a:53
}
chain prerouting {
type nat hook prerouting priority -110; policy accept;
iifname "docker0" jump from_containers
iifname "br-*" jump from_containers
}
chain from_containers {
${redirects} jump sentinel
ip daddr != @kept udp dport 53 dnat ip to $a:53
ip daddr != @kept tcp dport 53 dnat ip to $a:53
}
# IPv6 returns first: in an inet table, ip daddr matches IPv4 alone, so an IPv6 packet would skip
# the next return and be logged as refused. The stand-in address is IPv4, and a connection to it
# from an IPv6 socket (::ffff:198.18.0.1) leaves as IPv4, so this opens no way to it.
chain sentinel {
meta nfproto != ipv4 return
ip daddr != $a return
udp dport 53 dnat ip to $a:53
tcp dport 53 dnat ip to $a:53
meta l4proto tcp limit rate 5/second log prefix "devvm-transparent refused: " level info
meta l4proto tcp dnat ip to $a:$dead
meta l4proto udp dnat ip to $a:$dead
}
chain input {
type filter hook input priority -10; policy accept;
ip daddr $a iifname != "lo" iifname != "docker0" iifname != "br-*" drop
ip daddr $a udp dport 53 accept
ip daddr $a tcp dport 53 accept
ip daddr $a ct status dnat accept
ip daddr $a meta l4proto tcp reject with tcp reset
ip daddr $a meta l4proto udp reject
}
}
EOF
}
# pairs: the ports file's ports as render takes them (slots), and the slots file written to match.
pairs() {
local p l list
# shellcheck disable=SC2046 # one port a line
list=$(slots $(cat "$tp/ports"))
printf '%s\n' "$list" >"$tp/slots.tmp" && mv "$tp/slots.tmp" "$tp/slots"
while read -r p l; do [[ -z $p ]] || printf '%s=%s ' "$p" "$l"; done <<<"$list"
}
# own_resolvers: the VM's own name servers but loopback's, which its resolver asks besides
# 127.0.0.1 (such as the one Lima's DHCP gives it) and which Docker gives containers: IPv4
# addresses from systemd-resolved's list and /etc/resolv.conf, each once, at most 8.
own_resolvers() {
local r seen=' ' n=0
while read -r r; do
[[ $r =~ ^[0-9]{1,3}(\.[0-9]{1,3}){3}$ && $r != 127.* && $r != "${addr:-198.18.0.1}" && $seen != *" $r "* ]] || continue
n=$((n + 1))
((n <= 8)) || break
seen+="$r "
echo "$r"
done < <(awk '$1 == "nameserver" { print $2 }' /run/systemd/resolve/resolv.conf /etc/resolv.conf 2>/dev/null)
}
# apply: the ruleset for the ports file's ports and the VM's own name servers as they are now, loaded
# whole.
apply() {
local f
resolvers=$(own_resolvers | tr '\n' ' ')
f=$(mktemp)
# shellcheck disable=SC2046 # PORT=LISTEN words
render $(pairs) >"$f"
nft -f "$f" || echo "devvm-transparent: nft didn't load the ruleset" >&2
rm -f "$f"
}
# alive PIDFILE NAME: the process in PIDFILE runs, and is NAME.
alive() {
local pid
pid=$(cat "$1" 2>/dev/null) || return 1
[[ -n $pid && "$(cat "/proc/$pid/comm" 2>/dev/null)" == "$2" ]]
}
# stop PIDFILE NAME: end the process in PIDFILE when it's NAME, and forget it.
stop() {
if alive "$1" "$2"; then kill "$(cat "$1")" 2>/dev/null; fi
rm -f "$1"
}
# search_domains: the domains the VM's resolver appends to a name without a dot (/etc/resolv.conf's
# search line, which Lima fills from this machine's network), each a DNS name, at most 6.
search_domains() {
local d n=0
while read -r d; do
d=${d%.}
[[ $d =~ ^[A-Za-z0-9]([A-Za-z0-9.-]{0,252}[A-Za-z0-9])?$ ]] || continue
n=$((n + 1))
((n <= 6)) || break
echo "$d"
done < <(awk '$1 == "search" { for (i = 2; i <= NF; i++) print $i }' /etc/resolv.conf 2>/dev/null)
}
# start_dnsmasq: dnsmasq, with no answer for the names under the search domains: so a name without
# a dot that isn't in /etc/hosts doesn't resolve, as it doesn't to the stand-in address either
# (address=//), rather than turning into one of this machine's network's names.
start_dnsmasq() {
local d args=()
for d in $(search_domains); do args+=("--address=/$d/"); done
dnsmasq --keep-in-foreground --conf-file="$tp/dnsmasq.conf" ${args[@]+"${args[@]}"} &
echo "$!" >"$run_dir/dnsmasq.pid"
}
# start_socat PORT LISTEN: the listener for PORT on the stand-in address's LISTEN.
start_socat() {
socat "TCP4-LISTEN:$2,bind=$addr,reuseaddr,fork,max-children=256,backlog=256,su=$user" \
"PROXY:$proxy_host:$host:$1,proxyport=$proxy_port,proxyauthfile=$tp/auth,connect-timeout=10" &
echo "$!" >"$run_dir/socat-$1.pid"
}
# listeners: start what isn't running, the listeners of the slots file's ports, and stop those whose
# port is gone.
listeners() {
local f p l
alive "$run_dir/dnsmasq.pid" dnsmasq || start_dnsmasq
for f in "$run_dir"/socat-*.pid; do
[[ -e $f ]] || continue
p=${f##*/socat-} p=${p%.pid}
grep -q "^$p " "$tp/slots" || stop "$f" socat
done
while read -r p l; do
[[ -z $p ]] || alive "$run_dir/socat-$p.pid" socat || start_socat "$p" "$l"
done <"$tp/slots"
}
# fetch: the proxy's port list, into the ports file when it's valid and has changed (0), else 1.
fetch() {
local f
f=$(mktemp)
if curl -sSf --max-time 5 -K "$tp/curlrc" -o "$f" http://devvm.proxy/transparent/ports 2>/dev/null &&
valid_ports "$f" && ! cmp -s "$f" "$tp/ports"; then
mv "$f" "$tp/ports"
return 0
fi
rm -f "$f"
return 1
}
run() {
load_env || { echo "devvm-transparent: no $tp/env" >&2; exit 1; }
mkdir -p "$run_dir" && chmod 700 "$run_dir"
[[ -s $tp/ports ]] && valid_ports "$tp/ports" || printf '80\n443\n' >"$tp/ports"
down_children
ip -4 addr show dev lo | grep -q " $addr/32 " || ip addr add "$addr/32" dev lo
apply
trap 'down; exit 0' TERM INT
local tick=0 hosts_at
hosts_at=$(stat -c %Y /etc/hosts 2>/dev/null)
listeners
touch "$run_dir/ready"
while :; do
sleep 1 &
wait $!
listeners
if [[ "$(stat -c %Y /etc/hosts 2>/dev/null)" != "$hosts_at" ]]; then
hosts_at=$(stat -c %Y /etc/hosts 2>/dev/null)
[[ ! -f $run_dir/dnsmasq.pid ]] || kill -HUP "$(cat "$run_dir/dnsmasq.pid")" 2>/dev/null
fi
# A launch's setup fetched new ports (reload); every tenth second, the proxy's ports, the VM's
# own name servers, and the table back if something removed it (nft flush ruleset).
tick=$(((tick + 1) % 10))
if [[ -e $run_dir/reload ]] || { ((tick == 0)) && { fetch || [[ "$(own_resolvers | tr '\n' ' ')" != "$resolvers" ]] ||
! nft list table inet "$table" >/dev/null 2>&1; }; }; then
rm -f "$run_dir/reload"
apply
listeners
fi
done
}
# down_children: stop every child a supervisor recorded, this one's or one that died.
down_children() {
local f
for f in "$run_dir"/socat-*.pid; do [[ ! -e $f ]] || stop "$f" socat; done
stop "$run_dir/dnsmasq.pid" dnsmasq
}
down() {
load_env || addr=198.18.0.1
down_children
rm -f "$run_dir/ready"
nft delete table inet "$table" 2>/dev/null
ip addr del "$addr/32" dev lo 2>/dev/null
return 0
}
systemd=false
[[ -d /run/systemd/system ]] && systemd=true
# put FILE MODE OWNER: FILE from stdin, written only when it differs; 0 when it changed.
put() {
local tmp
tmp=$(mktemp)
cat >"$tmp"
if cmp -s "$tmp" "$1"; then
rm -f "$tmp"
return 1
fi
install -m "$2" -o root -g "$3" "$tmp" "$1"
rm -f "$tmp"
}
# dnsmasq_conf: dnsmasq's settings, read with --conf-file, so /etc/dnsmasq.conf and /etc/dnsmasq.d
# aren't. Every name's A record is the stand-in address, with TTL 0, and every other type is an empty
# answer, never REFUSED, which musl waits 5 s on. /etc/hosts comes first: localhost, the VM's
# hostname, host.lima.internal and the links' names keep their own addresses. A name without a dot,
# and any other name under devvm.internal, doesn't exist.
dnsmasq_conf() {
cat <<EOF
# devvm: names for tools that skip the proxy (devvm-transparent). No upstream: nothing leaves the VM.
port=53
listen-address=$addr
bind-interfaces
no-resolv
no-poll
pid-file=
user=$user
group=$user
address=/#/$addr
local=/#/
address=/localhost/127.0.0.1
address=/localhost/::1
address=/devvm.internal/
address=//
log-queries
EOF
# systemd's journal keeps stderr; OpenRC's service doesn't, so there it's syslog.
! $systemd || echo 'log-facility=-'
}
unit() {
cat <<'EOF'
[Unit]
Description=devvm: names and connections for tools that skip the proxy
After=network.target systemd-resolved.service
ConditionPathExists=/etc/devvm/transparent/env
[Service]
Type=simple
ExecStart=/usr/local/sbin/devvm-transparent run
ExecStopPost=/usr/local/sbin/devvm-transparent down
Restart=always
RestartSec=1
KillMode=control-group
[Install]
WantedBy=multi-user.target
EOF
}
openrc() {
cat <<'EOF'
#!/sbin/openrc-run
description="devvm: names and connections for tools that skip the proxy"
supervisor=supervise-daemon
command=/usr/local/sbin/devvm-transparent
command_args=run
respawn_delay=1
respawn_max=0
depend() { need net localmount; after firewall; }
start_pre() { [ -f /etc/devvm/transparent/env ]; }
stop_post() { /usr/local/sbin/devvm-transparent down; }
EOF
}
setup() {
addr=$1 host=$2
local url hp auth changed=false svc
for p in dnsmasq socat nft; do command -v "$p" >/dev/null || exit 3; done
IFS= read -r url
hp=${url#http://} auth=''
if [[ $hp == *@* ]]; then auth=${hp%%@*} hp=${hp#*@}; fi
proxy_host=${hp%:*} proxy_port=${hp##*:}
proxy_port=${proxy_port%%/*}
# The user dnsmasq and socat's connections run as: shadow's tools, else busybox's.
grep -q "^$user:" /etc/group || groupadd --system "$user" 2>/dev/null || addgroup -S "$user"
grep -q "^$user:" /etc/passwd || useradd --system --no-create-home --home-dir /nonexistent --shell /sbin/nologin -g "$user" "$user" 2>/dev/null ||
adduser -S -D -H -h /nonexistent -s /sbin/nologin -G "$user" "$user"
install -d -m 755 "$tp"
printf 'addr=%s\nhost=%s\nproxy_host=%s\nproxy_port=%s\n' "$addr" "$host" "$proxy_host" "$proxy_port" | put "$tp/env" 644 root && changed=true
printf '%s' "$auth" | put "$tp/auth" 640 "$user" && changed=true
printf 'proxy = "http://%s:%s"\nproxy-user = "%s"\nnoproxy = ""\n' "$proxy_host" "$proxy_port" "$auth" | put "$tp/curlrc" 600 root || true
dnsmasq_conf | put "$tp/dnsmasq.conf" 644 root && changed=true
put "$self" 755 root <"$0" && changed=true
if $systemd; then
svc=/etc/systemd/system/devvm-transparent.service
unit | put "$svc" 644 root && { changed=true; systemctl daemon-reload; }
systemctl enable devvm-transparent.service >/dev/null 2>&1
else
openrc | put /etc/init.d/devvm-transparent 755 root && changed=true
rc-update add devvm-transparent default >/dev/null 2>&1
fi
# The ports now, so the first shell has them, which a running service takes at once (reload); else
# the last ones, else 80 and 443.
if fetch; then
mkdir -p "$run_dir" && chmod 700 "$run_dir" && touch "$run_dir/reload"
fi
[[ -s $tp/ports ]] || printf '80\n443\n' >"$tp/ports"
if $changed; then
rm -f "$run_dir/ready"
if $systemd; then systemctl restart devvm-transparent; else rc-service devvm-transparent restart >/dev/null; fi
elif $systemd; then
systemctl start devvm-transparent
else
rc-service devvm-transparent status >/dev/null 2>&1 || rc-service devvm-transparent start >/dev/null
fi
local i=0
until [[ -e $run_dir/ready && ! -e $run_dir/reload ]]; do
i=$((i + 1))
((i <= 100)) || { echo "devvm-transparent: the service didn't start" >&2; return 1; }
sleep 0.1
done
}
teardown() {
[[ -e $self || -e $tp ]] || return 0
if $systemd; then
systemctl disable --now devvm-transparent.service >/dev/null 2>&1
rm -f /etc/systemd/system/devvm-transparent.service
systemctl daemon-reload
else
rc-service devvm-transparent stop >/dev/null 2>&1
rc-update del devvm-transparent default >/dev/null 2>&1
rm -f /etc/init.d/devvm-transparent
fi
down
rm -rf "$tp" "$run_dir" "$self"
! $systemd || resolvectl flush-caches 2>/dev/null
return 0
}
status() {
local ports
if [[ -e $run_dir/ready ]]; then
ports=$(tr '\n' ' ' <"$tp/ports" 2>/dev/null)
echo "Transparent mode: on, for ports ${ports% }; other ports are refused."
else
echo "Transparent mode: not running."
return 0
fi
echo "Refused lately (a port devvm doesn't send to the proxy):"
if $systemd; then
journalctl -k -n 1000 -o short-iso --no-pager 2>/dev/null | grep 'devvm-transparent refused: ' | tail -10 |
sed -E 's/^([^ ]+).* DPT=([0-9]+).*/ \2 at \1/'
else
dmesg 2>/dev/null | grep 'devvm-transparent refused: ' | tail -10 | sed -E 's/.* DPT=([0-9]+).*/ \1/'
fi
echo "Names looked up lately:"
{ if $systemd; then journalctl -u devvm-transparent -n 1000 -o cat --no-pager 2>/dev/null; else cat /var/log/messages 2>/dev/null; fi; } |
grep -oE 'query\[A\] [^ ]+' | awk '{ print " " $2 }' | tail -10
}
case ${1:-} in
setup) shift; setup "$@" ;;
teardown) teardown ;;
run) run ;;
down) down ;;
status) status ;;
render) shift; resolvers=${DEVVM_TRANSPARENT_RESOLVERS:-}; render "$@" ;;
slots) shift; slots "$@" ;;
valid) valid_ports "${2:?}" ;;
*) grep '^# devvm-transparent ' "$0" >&2; exit 2 ;;
esac
+38 -22
View File
@@ -4,37 +4,50 @@
set -euxo pipefail
: "${devvm_arch:?}" "${devvm_libc:?}" # devvm's prelude (prelude.sh) comes before this script
# Pinned downloads (scripts/bump.sh updates them).
mise_version=2026.10.7
mise_sha256_arm64=c7108d85a32ba17e4747d31d4a42f39f0c134f16211e204e8ef0a49d4f518fe1
mise_sha256_amd64=6eb1b890e90818417ca34c90dbbd47881917d5cd199f31b63b062ea9c6b18d85
mise_sha256_arm64_musl=e036eb7bd3ca63e8565497e597967484330a74ff24e9c4c9f2ac41824cbf4090
mise_sha256_amd64_musl=fc5137a3147494e039c3d5fc3d84de354170d7d8dafdb0b5f0b6f3f19d1dd922
mise_version=2026.11.3
mise_sha256_arm64=a9a2a66bbbe87ea9cc849e1f006606ae2b34f3d3ba56a54d5cd5d64b6557d164
mise_sha256_amd64=c2f7e814cb39f60b7f67a0ff36cb805e94128bf2dff09d175309d0f095b8cc3b
mise_sha256_arm64_musl=78c87fb8c8af031755f9241cbcd1886cd458c75e8f324020015445a776789e38
mise_sha256_amd64_musl=72f1cb4591ee2ba90150022c3ee8aea4dd88fadac10c56d04ede4faffb5a1b03
export DEBIAN_FRONTEND=noninteractive
# Alpine (--from alpine): apk, OpenRC and musl. Its packages come from the release's repositories,
# which have no snapshots: they aren't pinned.
if [[ $devvm_libc == musl ]]; then
# GNU tar: devvm's launch sends files with it (busybox's lacks options it uses). sqlite: an export
# of agents' history copies opencode's database without its logins with it.
# of agents' history copies opencode's database without its logins with it. icu-libs: the dotnet
# shared tool's .NET needs ICU. fd: the pi shared tool finds files with it, and downloads it
# itself, unpinned, where it's missing. dnsmasq, socat and nftables: transparent mode
# (guest/transparent.sh), whose service only a confined VM's setup enables.
sudo apk add --no-cache git curl wget ca-certificates build-base unzip jq ripgrep bash coreutils tar \
util-linux util-linux-misc losetup findmnt erofs-utils sqlite
util-linux util-linux-misc losetup findmnt erofs-utils sqlite icu-libs fd dnsmasq socat nftables
echo "devvm: Alpine's packages aren't pinned" >&2
else
# The package lists are apt.sh begin's: base's packages are recorded at its first build and replayed
# from devvm's cache after (layers/apt.sh), and a --from image's come from its own sources, unpinned.
# erofs-utils: the shared tools' builds make their images with it, in a VM cloned from base. sqlite3:
# an export of agents' history copies opencode's database without its logins with it.
sudo apt-get install -y git curl wget ca-certificates build-essential unzip jq ripgrep erofs-utils sqlite3
# an export of agents' history copies opencode's database without its logins with it. ICU: the dotnet
# shared tool's .NET needs it, and its package's name has its version (libicu76), so it's the newest
# libicuN the package lists have (a replay's lists have only the one recorded). fd-find (fdfind): the
# pi shared tool finds files with it, and downloads fd itself, unpinned, where it's missing.
# dnsmasq-base (dnsmasq alone, no service of its own), socat and nftables: transparent mode
# (guest/transparent.sh), whose service only a confined VM's setup enables.
icu=$(apt-cache pkgnames libicu | grep -E '^libicu[0-9]+$' | sort -V | tail -1 || true)
sudo apt-get install -y git curl wget ca-certificates build-essential unzip jq ripgrep erofs-utils sqlite3 fd-find \
dnsmasq-base socat nftables ${icu:+"$icu"}
fi
# devvm-fetch URL SHA256 OUT: every layer downloads through this, so an image only ever contains
# files whose checksums are pinned in devvm's scripts.
# files whose checksums are pinned in devvm's scripts. A SHA-512 (128 hex digits) is checked as one:
# the shared tools' build gets the .NET SDK's from the tools lock.
sudo tee /usr/local/bin/devvm-fetch >/dev/null <<'SH'
#!/bin/sh
set -eu
url=$1 want=$2 out=$3
curl -fsSL --retry 3 -o "$out" "$url"
got=$(sha256sum "$out" | cut -d' ' -f1)
sum=sha256sum
[ "${#want}" -ne 128 ] || sum=sha512sum
got=$("$sum" "$out" | cut -d' ' -f1)
if [ "$got" != "$want" ]; then
rm -f "$out"
printf 'devvm-fetch: checksum mismatch for %s\n expected %s\n got %s\n' "$url" "$want" "$got" >&2
@@ -70,7 +83,7 @@ fi
mkdir -p ~/.bashrc.d
grep -qs bashrc.d ~/.bashrc || echo 'for f in ~/.bashrc.d/*.sh; do [ -r "$f" ] && . "$f"; done' >> ~/.bashrc
# mise runs the shared tools (node, python, go, rust, agents), read-only images mounted at
# mise runs the shared tools (the toolchains and the coding agents), read-only images mounted at
# /opt/devvm/tools by devvm-tools (guest/tools.sh). Each VM's tools and versions are in
# /etc/mise/config.toml (written by guest/sync.sh); the user's own mise config and a project's version
# files (.nvmrc, .python-version, ...) come first, and versions that aren't shared install into the VM.
@@ -82,15 +95,20 @@ rm /tmp/mise
# Every shell finds the tools: login shells through profile.d, interactive ones through mise activate
# (it follows `cd` into projects with other versions), and the rest (`bash -c` from agents, editors
# over SSH) through BASH_ENV and mise's shims. Read-only installs can't take global packages or update
# themselves: npm installs globals into ~/.npm-global, and Claude Code's and opencode's auto-updates
# are off.
# themselves, so global installs go into the VM's home, on the PATH, and the coding agents'
# self-updates are off. The toolchains' environment and their folders for the PATH (devvm_path), and
# the agents', come from /etc/devvm/toolchains.sh and /etc/devvm/agents.sh, which every launch's setup
# writes from devvm's registries, so a new toolchain or agent changes no image. Their telemetry and
# version checks are off here rather than in devvm-telemetry.sh, so a tool that a non-login shell runs
# (ssh VM pi, an editor's terminal) sends none either.
sudo tee /etc/profile.d/devvm-tools.sh >/dev/null <<'SH'
devvm_path=
if [ -r /etc/devvm/toolchains.sh ]; then . /etc/devvm/toolchains.sh; fi
case ":$PATH:" in *":$HOME/.local/share/mise/shims:"*) ;; *)
export PATH="$HOME/.npm-global/bin:$HOME/go/bin:$HOME/.cargo/bin:$HOME/.local/bin:$HOME/.local/share/mise/shims:$PATH" ;;
export PATH="$devvm_path$HOME/.local/bin:$HOME/.local/share/mise/shims:$PATH" ;;
esac
export NPM_CONFIG_PREFIX="$HOME/.npm-global"
export DISABLE_AUTOUPDATER=1
export OPENCODE_DISABLE_AUTOUPDATE=1
unset devvm_path
if [ -r /etc/devvm/agents.sh ]; then . /etc/devvm/agents.sh; fi
SH
grep -qs devvm-tools /etc/environment || echo 'BASH_ENV=/etc/profile.d/devvm-tools.sh' | sudo tee -a /etc/environment >/dev/null
echo 'eval "$(mise activate bash)"' > ~/.bashrc.d/mise.sh
@@ -129,11 +147,10 @@ SH
sudo chmod 755 /usr/local/bin/xdg-open
echo 'export BROWSER=xdg-open' | sudo tee /etc/profile.d/devvm-browser.sh >/dev/null
# Telemetry off for every tool that has a switch (installed by devvm or commonly by projects).
# Telemetry off for every tool that has a switch (installed by devvm or commonly by projects), but
# the toolchains' and the coding agents', which devvm-tools.sh turns off in every shell.
sudo tee /etc/profile.d/devvm-telemetry.sh >/dev/null <<'SH'
export DO_NOT_TRACK=1 # generic opt-out (bun and others)
export DISABLE_TELEMETRY=1 # Claude Code
export DISABLE_ERROR_REPORTING=1 # Claude Code
export NEXT_TELEMETRY_DISABLED=1
export TURBO_TELEMETRY_DISABLED=1
export ASTRO_TELEMETRY_DISABLED=1
@@ -141,7 +158,6 @@ export NUXT_TELEMETRY_DISABLED=1
export GATSBY_TELEMETRY_DISABLED=1
export STORYBOOK_DISABLE_TELEMETRY=1
export YARN_ENABLE_TELEMETRY=0
export DOTNET_CLI_TELEMETRY_OPTOUT=1
SH
# Ubuntu: no news fetched for the login banner or apt output.
sudo sed -i 's/^ENABLED=1/ENABLED=0/' /etc/default/motd-news 2>/dev/null || true
+5 -5
View File
@@ -5,11 +5,11 @@ set -euxo pipefail
: "${devvm_libc:?}" # devvm's prelude (prelude.sh) comes before this script
# Pinned downloads (scripts/bump.sh updates them). Docker's repository has no snapshots: its packages
# are pinned by version.
docker_version=29.9.0
containerd_version=2.4.1
buildx_version=0.38.0
compose_version=5.6.0
model_version=1.2.6
docker_version=29.9.3
containerd_version=2.4.2
buildx_version=0.38.1
compose_version=5.7.0
model_version=1.2.9
docker_gpg_sha256=1500c1f56fa9e26b9b8f42452a553675796ade0807cdce11975eb98170b3a570
# Alpine (--from alpine): Docker is Alpine's own package, from the release's repositories, which have
+3 -3
View File
@@ -7,9 +7,9 @@ set -euxo pipefail
: "${devvm_arch:?}" "${devvm_libc:?}" # devvm's prelude (prelude.sh) comes before this script
# Pinned downloads (scripts/bump.sh updates them). Nix's release tarball, with its own installer;
# nix-direnv is one script, the same on every architecture.
nix_version=2.35.4
nix_sha256_arm64=14a940a2d0ae5b2c623dc2ca168311c9367fd4bc416f6ded0c1087089d6de934
nix_sha256_amd64=ff66236d2f7e2a21f3350e73668e021ac6a8881ef277a38e16e952bfb22718c3
nix_version=2.35.5
nix_sha256_arm64=34b8d0c0658321e63143f892086bd2d9623a81bf96e4ffefc1551092d80caedb
nix_sha256_amd64=c349f0559b7849a2cb3b20b8584e532b3fcf5025092cb6180eb0b99240d7b96c
direnv_version=2.38.2
direnv_sha256_arm64=ec2a32dbe2f19dd085bd9315a1b4ea88b55ec288aa7eabe8723490baf466cb23
direnv_sha256_amd64=148820a187930d36ca6a204504e5cdb30d8396cd1a97e64c3b3f10d793c11247
+24 -6
View File
@@ -4,6 +4,7 @@
# (~/.local/share/devvm/mise.lock) in its .build folder. Each tool gets a VM and a folder of its own,
# so nothing one tool's installer does, as root or not, reaches another tool's image.
# build.sh TOOL VERSION FILE
# build.sh dotnet VERSION FILE URL SHA512
# The tool is installed at exactly the locked version (checked against the lock's checksums), then
# packed into one compressed read-only EROFS image, FILE in that folder; devvm moves it into the share
# and records its hash. Project VMs mount it at /opt/devvm/tools/<tool>/<version>, where mise finds it
@@ -14,11 +15,11 @@ set -euxo pipefail
: "${devvm_arch:?}" "${devvm_libc:?}" # devvm's prelude (prelude.sh) comes before this script
# Pinned downloads (scripts/bump.sh updates them). rustup checks the toolchain against Rust's signed
# channel manifest.
rustup_version=1.29.1
rustup_sha256_arm64=15f6e4ce9f583b929c996c91562bad6d4454f3281de858b02cdfdef615fac433
rustup_sha256_amd64=dda7234360b7f578ca8b0ddcb80145646fa61a67c1720a5abc7051b35c9fcb71
rustup_sha256_arm64_musl=1ddf36182ac5d1782dbeefcb9bea7f5f9412d88f4a0d5047b1564a223624e8c6
rustup_sha256_amd64_musl=331228566cc931f32cd684f9bebc5956a5e5d7394c8d5de595f196a658ab98e6
rustup_version=1.29.3
rustup_sha256_arm64=9f608c142e0e38a78957d0661ba1dfaf0b6fb37184cfaa4b9a0aa57af6184282
rustup_sha256_amd64=b1c8cb14e30889e7e2999e6b69e62d9e9b9ffc0f4df8180564d306d9680e6c55
rustup_sha256_arm64_musl=956deacdc27ab82ae7ac821d5d3e9e95e4795d476d17efe99743bb8531ca1031
rustup_sha256_amd64_musl=1552169aba2836777136ccff7a381e95c17233b5d8250cd5e10ae3cb971bfcfc
share=/mnt/devvm-tools
# Where VMs mount the tools: installs record absolute paths (mise's bin links, scripts' shebangs).
@@ -57,7 +58,8 @@ glibc_needs() {
rm -f "$files" "$elf"
}
[[ $devvm_libc != gnu ]] || command -v readelf >/dev/null || { echo "build.sh: base has no readelf (binutils)" >&2; exit 1; }
(( $# == 3 )) || { echo "build.sh: wants TOOL VERSION FILE, got $# arguments" >&2; exit 2; }
(( $# == 3 )) || [[ $# == 5 && $1 == dotnet ]] ||
{ echo "build.sh: wants TOOL VERSION FILE (dotnet: and URL SHA512), got $# arguments" >&2; exit 2; }
tool=$1 version=$2 file=$3
wait_share
@@ -75,6 +77,22 @@ if [[ $tool == rust ]]; then
RUSTUP_HOME=$work/rustup CARGO_HOME=$work/cargo "$dir/rustup-init" -y -q --no-modify-path \
--profile default --default-toolchain "$version" -c rust-src -c rust-analyzer
mv "$work/rustup/toolchains/$version-$triple" "$dir/toolchain"
elif [[ $tool == dotnet ]]; then
# Microsoft's SDK archive, the lock's download for this platform, which devvm passes with the
# SHA-512 the lock records for it: mise's own installer runs Microsoft's install script, which
# checks nothing.
[[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ && $# == 5 ]] || { echo "build.sh: dotnet wants a release's VERSION, URL and SHA512" >&2; exit 2; }
dir=$work/dotnet/$version; mkdir -p "$dir"
devvm-fetch "$4" "$5" /tmp/dotnet-sdk.tar.gz
tar -xzf /tmp/dotnet-sdk.tar.gz -C "$dir"
rm /tmp/dotnet-sdk.tar.gz
sdks=$("$dir/dotnet" --list-sdks)
[[ $sdks == "$version "* ]] || { echo "build.sh: the archive has another SDK than $version: $sdks" >&2; exit 1; }
# Workloads install into the user's ~/.dotnet, which the SDK does when its folder has this marker
# for its feature band (10.0.400 for 10.0.403): the SDK's own folder is read-only in VMs.
band=${version%.*}.$(( ${version##*.} / 100 * 100 ))
mkdir -p "$dir/metadata/workloads/$band"
touch "$dir/metadata/workloads/$band/userlocal"
else
# By name: mise resolves mise.toml's version through the lock (an explicit tool@version isn't
# matched to the lock's entry).
+8
View File
@@ -0,0 +1,8 @@
# dotnet: NuGet's packages and tools, and the revocation lists of DigiCert, which issues NuGet's
# signing certificates, that NuGet checks each package's signatures against; the SDKs mise installs
# for a global.json's version (the install script at dot.net, the SDK's archive). Microsoft's
# telemetry is left out.
api.nuget.org
crl3.digicert.com:80
dot.net
builds.dotnet.microsoft.com
+14
View File
@@ -1,6 +1,18 @@
# The shared tools (the docs' images page, "Shared tools"). devvm resolves each, per user, to upstream's newest
# release matching its version here, into ~/.local/share/devvm/mise.lock with each download's checksum
# per platform. A version here is a hold (node = "24"); nothing is pinned.
# Where each tool that isn't one of mise's own (core:) comes from, named here so that mise's registry
# can't move it to another source: its first choice can change between mise releases (opencode 2
# moved to npm, which has no download per platform). VMs' mise gets the same list.
[tool_alias]
claude = "aqua:anthropics/claude-code"
codex = "aqua:openai/codex"
opencode = "github:anomalyco/opencode" # its GitHub releases: a musl build of its own, attested
pi = "github:earendil-works/pi" # its GitHub releases: one Bun-built program per platform, glibc only
pnpm = "aqua:pnpm/pnpm"
uv = "aqua:astral-sh/uv"
[tools]
node = "24" # Node 25+ drops corepack
pnpm = "latest"
@@ -9,9 +21,11 @@ python = "latest"
uv = "latest"
go = "latest"
rust = "latest" # installed with the rustup pinned in build.sh; rustup checks the toolchain
dotnet = "latest" # the SDK; devvm adds its downloads and their SHA-512 from Microsoft's releases
claude = "latest"
codex = "latest"
opencode = "2" # upstream marks its 1.x releases as GitHub's latest, which "latest" resolves to
pi = "latest"
[settings]
experimental = true
+4
View File
@@ -0,0 +1,4 @@
# pi: its model catalog. Its version check and install report go to the same host, and every VM turns
# them off (PI_SKIP_VERSION_CHECK, PI_TELEMETRY). Add your model provider's API host
# (e.g. api.anthropic.com, api.openai.com) with `devvm network allow`.
pi.dev
+159
View File
@@ -0,0 +1,159 @@
package assets
import (
"io/fs"
"os"
"os/exec"
"path/filepath"
"slices"
"strconv"
"strings"
"testing"
)
// bashes are the shells guest/transparent.sh's test runs it with: bash on
// the PATH, and macOS's /bin/bash, which is 3.2, as in-VM scripts must
// run on.
func bashes(t *testing.T) []string {
t.Helper()
var out []string
if p, err := exec.LookPath("bash"); err == nil {
out = append(out, p)
}
if _, err := os.Stat("/bin/bash"); err == nil && !slices.Contains(out, "/bin/bash") {
out = append(out, "/bin/bash")
}
if len(out) == 0 {
t.Skip("no bash")
}
return out
}
// transparentScript writes guest/transparent.sh into a folder of the
// test's own, and returns its path and the folder, its files' folder.
func transparentScript(t *testing.T) (string, string) {
t.Helper()
b, err := fs.ReadFile(FS, "guest/transparent.sh")
must(t, err)
dir := t.TempDir()
f := filepath.Join(dir, "transparent.sh")
must(t, os.WriteFile(f, b, 0o600))
return f, dir
}
// runTransparent runs the script with bash and args, its files in dir,
// and returns its output and whether it succeeded.
func runTransparent(t *testing.T, bash, script, dir string, args ...string) (string, bool) {
t.Helper()
cmd := exec.CommandContext(t.Context(), bash, append([]string{script}, args...)...) //nolint:gosec // G204: devvm's own embedded script, with the test's arguments
cmd.Env = append(os.Environ(), "DEVVM_TRANSPARENT_DIR="+dir, "DEVVM_TRANSPARENT_RESOLVERS=192.168.5.2 10.0.2.3")
out, err := cmd.Output()
return string(out), err == nil
}
// The ruleset: each redirected port to its listener, every other port of
// the stand-in address to the dead port (so Docker's published ports never
// take it), DNS to public servers and 127.0.0.1 to dnsmasq, private ones
// left alone, and nftables takes it where it can be asked.
func TestTransparentRuleset(t *testing.T) {
script, dir := transparentScript(t)
for _, bash := range bashes(t) {
out, ok := runTransparent(t, bash, script, dir, "render", "80=61080", "443=61443", "8443=61100")
if !ok {
t.Fatalf("%s: render failed:\n%s", bash, out)
}
for _, want := range []string{
"ip daddr 198.18.0.1 tcp dport 80 dnat ip to 198.18.0.1:61080",
"ip daddr 198.18.0.1 tcp dport 8443 dnat ip to 198.18.0.1:61100",
"meta l4proto tcp dnat ip to 198.18.0.1:61079",
"meta l4proto udp dnat ip to 198.18.0.1:61079",
"udp dport 53 dnat ip to 198.18.0.1:53",
"ip daddr 127.0.0.1 tcp dport 53 dnat ip to 198.18.0.1:53",
"ip daddr != @kept udp dport 53 dnat ip to 198.18.0.1:53",
"ip daddr { 192.168.5.2, 10.0.2.3 } tcp dport 53 dnat ip to 198.18.0.1:53",
"10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.168.0.0/16",
"type nat hook output priority -110;",
"type nat hook prerouting priority -110;",
`iifname "br-*" jump from_containers`,
"type filter hook prerouting priority -150;",
"type filter hook output priority -150;",
`ip daddr 198.18.0.1 iifname != "lo" iifname != "docker0" iifname != "br-*" drop`,
"ip daddr 198.18.0.1 meta l4proto != { tcp, udp, icmp } drop",
} {
if !strings.Contains(out, want) {
t.Errorf("%s: the ruleset lacks %q:\n%s", bash, want, out)
}
}
// IPv6 leaves the sentinel before anything else: an inet table's
// ip daddr matches IPv4 alone, so an IPv6 connection would get past
// the address's return and be logged as refused. The log is the
// sentinel's alone.
if !strings.Contains(out, " chain sentinel {\n meta nfproto != ipv4 return\n ip daddr != 198.18.0.1 return\n") ||
strings.Count(out, "log prefix") != 1 || strings.Index(out, "log prefix") < strings.Index(out, "chain sentinel {") {
t.Errorf("%s: the sentinel doesn't return IPv6 first:\n%s", bash, out)
}
if strings.Count(out, "{") != strings.Count(out, "}") || strings.Count(out, "jump sentinel") != 2 {
t.Errorf("%s: unbalanced, or a chain without the stand-in address's ports:\n%s", bash, out)
}
if n, err := exec.LookPath("nft"); err == nil {
f := filepath.Join(dir, "rules.nft")
must(t, os.WriteFile(f, []byte(out), 0o600))
if b, err := exec.CommandContext(t.Context(), n, "-c", "-f", f).CombinedOutput(); err != nil { //nolint:gosec // G204: nft from the PATH, checking the test's ruleset
if strings.Contains(string(b), "Operation not permitted") {
t.Log("nft -c can't run here")
} else {
t.Errorf("nft -c refused it: %v\n%s", err, b)
}
}
}
}
}
// Each port past 80 and 443 keeps the listener it had while it stays, a
// port that's gone frees its own, and a new one takes the lowest free.
func TestTransparentSlots(t *testing.T) {
script, dir := transparentScript(t)
must(t, os.WriteFile(filepath.Join(dir, "slots"), []byte("8080 61101\n9000 61100\n"), 0o600))
for _, bash := range bashes(t) {
out, ok := runTransparent(t, bash, script, dir, "slots", "80", "443", "9000", "8443", "7000")
if want := "80 61080\n443 61443\n9000 61100\n8443 61101\n7000 61102\n"; !ok || out != want {
t.Errorf("%s: slots:\n%s\nwant:\n%s", bash, out, want)
}
}
}
// The proxy's port list goes into the ruleset only when it's 2 to 34
// ports, each once, with 80 and 443, never 22 or 53.
func TestTransparentPortList(t *testing.T) {
script, dir := transparentScript(t)
many := "80\n443\n"
for p := 9000; p < 9033; p++ {
many += strconv.Itoa(p) + "\n"
}
for _, bash := range bashes(t) {
for _, c := range []struct {
list string
ok bool
}{
{"80\n443\n", true},
{"80\n443\n8443\n", true},
{"443\n80\n", true},
{"80\n", false},
{"80\n8443\n", false},
{"80\n443\n22\n", false},
{"80\n443\n53\n", false},
{"80\n443\n8443\n8443\n", false},
{"80\n443\n65536\n", false},
{"80\n443\n08443\n", false},
{"80\n443\n84 43\n", false},
{"80\n443\n$(id)\n", false},
{many, false},
} {
f := filepath.Join(dir, "ports-list")
must(t, os.WriteFile(f, []byte(c.list), 0o600))
if _, ok := runTransparent(t, bash, script, dir, "valid", f); ok != c.ok {
t.Errorf("%s: %q: %v, want %v", bash, c.list, ok, c.ok)
}
}
}
}
+93
View File
@@ -0,0 +1,93 @@
Copyright 2022–2024 Helena Zhang (helenazhang.com).
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

+6 -3
View File
@@ -1,5 +1,8 @@
---
title: devvm
# The social card's title (layouts/_partials/og-image.html): the hero's headline, as the logo says devvm.
cardTitle: One VM for every project
explainer: An isolated sandbox for you or a coding agent
layout: hextra-home
# Mostly shortcodes: no Copy page menu (hugo.yaml gives the home page no Markdown copy).
contextMenu: false
@@ -57,13 +60,13 @@ Claude Code needs your Claude login before its first start, which `devvm agent l
{{< feature title="Toolchains" icon="code" level="3" art="toolchains" >}}
`devvm` chooses the toolchains your project's files call for, and you can choose more when you customize a new VM or name them with `--tools` ([toolchains](docs/using/toolchains.md)).
`devvm` has [toolchains](docs/using/toolchains.md) for your project's languages, node among them. It chooses the ones your project's files call for, and you can choose more when you customize a new VM or name them with `--tools`.
{{< /feature >}}
{{< feature title="Coding agents" icon="robot" level="3" art="coding-agents" >}}
Claude Code, Codex and opencode run in the VM. Choose one when you customize a new VM, or choose them for every new VM in `devvm setup` ([coding agents](docs/using/coding-agents.md)).
The [supported coding agents](docs/using/coding-agents.md#supported-agents) run in the VM, Claude Code among them. Choose one when you customize a new VM, or choose them for every new VM in `devvm setup` ([coding agents](docs/using/coding-agents.md)).
{{< /feature >}}
@@ -108,7 +111,7 @@ devvm ships the `docker`, `nix` and `desktop` layers, which you choose when you
- The VM mounts your project folder at the same path. Apart from your agents' settings from devvm's own store, which it gets read-only, it sees nothing else in your home folder ([what a VM can reach](docs/safety/_index.md#what-a-vm-can-reach)).
- New VMs get the allowlist [network tier](docs/safety/network.md) by default, so they reach only an allowlist of hosts, through a proxy on your machine. You can choose a looser tier, internet or open, or a stricter one, none.
- On macOS, `devvm` locks `.git`'s hooks and config, so the VM can't change what git runs on your machine ([.git protection](docs/safety/git-protection.md)).
- `devvm` locks `.git`'s hooks and config, so the VM can't change what git runs on your machine, except on a Linux host whose kernel doesn't let it lock them, where it watches them instead ([.git protection](docs/safety/git-protection.md)).
- With [`--clone`](docs/using/clone.md), the VM works on a clone of the repo of its own instead of your folder, so nothing in it can touch your working tree or `.git`, and its work reaches your repo only when you fetch it.
- No sandbox closes every gap, so [attack vectors](docs/safety/attack-vectors.md#narrowed-not-closed) lists what's left open, and [staying safe](docs/safety/_index.md#the-habits) lists the habits that close most of it.
+5 -4
View File
@@ -1,5 +1,6 @@
---
title: Branding
explainer: devvm's logo, icons, colors and fonts
layout: branding
description: "devvm's logo, icons, social card, colors and fonts, to download and use when you write about devvm."
sidebar:
@@ -46,7 +47,7 @@ The app icon at any size, and the icons the site uses for browser tabs and home
## The social card
The image that sites and chat apps show with a link to devvm.dev:
The image to show with a link to devvm. Sites and chat apps show each page of devvm.dev with a card of its own in the same style, which has the page's section, its title and a line on what it covers.
{{< brand-assets wide="true" >}}
{{< brand-asset title="Social card, 1200 by 630" src="images/social-card.png" bg="dark" alt="The devvm social card: the logo, One VM for every project, and the tagline" files="images/social-card.png" >}}
@@ -60,7 +61,7 @@ Click a swatch to copy its hex.
## Fonts
All three are free under the SIL Open Font License.
All three are free under the SIL Open Font License, and this site serves each one itself, with its license.
<!-- markdownlint-disable MD034 -- the font-sample shortcodes' parameters, not bare URLs -->
@@ -68,11 +69,11 @@ All three are free under the SIL Open Font License.
A pixel font by Helena Zhang, for the logo, headings and buttons. It's sharp at multiples of 11px.
{{< /font-sample >}}
{{< font-sample name="Instrument Sans" font="sans" link="https://fonts.google.com/specimen/Instrument+Sans" >}}
{{< font-sample name="Instrument Sans" font="sans" link="https://github.com/Instrument/instrument-sans" license="fonts/instrument-sans/LICENSE" >}}
The font for text.
{{< /font-sample >}}
{{< font-sample name="Martian Mono" font="mono" link="https://fonts.google.com/specimen/Martian+Mono" >}}
{{< font-sample name="Martian Mono" font="mono" link="https://github.com/evilmartians/mono" license="fonts/martian-mono/LICENSE" >}}
The font for code, set narrower than its default and without ligatures.
{{< /font-sample >}}
+3 -1
View File
@@ -1,14 +1,16 @@
---
title: Docs
explainer: The guides, in the order you'll need them
---
The docs are in the order you'll need them: getting devvm running, using it day to day, staying safe and choosing a backend, then every command, how devvm works and how to change it.
The docs are in the order you'll need them: getting devvm running, using it day to day, staying safe, choosing a backend and comparing devvm with other tools, then every command, how devvm works and how to change it.
{{< cards >}}
{{< section-card path="getting-started" >}}Installing devvm, making your first VM, and the commands you use most.{{< /section-card >}}
{{< section-card path="using" >}}Images and toolchains, ports and size, coding agents, editors, settings, and what to do when something fails.{{< /section-card >}}
{{< section-card path="safety" >}}The habits that keep you safe, network tiers, `.git` protection, and what devvm does about each attack.{{< /section-card >}}
{{< section-card path="backends" >}}What runs the VMs: Lima.{{< /section-card >}}
{{< section-card path="compared" >}}How devvm differs from Docker Sandboxes, other VM and OS sandboxes, and hosted ones.{{< /section-card >}}
{{< section-card path="cli" >}}Every command, with its arguments and flags.{{< /section-card >}}
{{< section-card path="internals" >}}How devvm builds images, forwards ports, confines VMs to their proxies and protects `.git`.{{< /section-card >}}
{{< section-card path="contributing" >}}Building, testing and writing docs, other hosts, and releases.{{< /section-card >}}
+2 -1
View File
@@ -1,5 +1,6 @@
---
title: Backends
explainer: The program that runs devvm's VMs
weight: 40
---
@@ -17,7 +18,7 @@ A backend is the program that runs devvm's VMs and builds their images. devvm de
| The nix layer | {{< yes >}} yes |
| Limits | paths with commas, and shrinking a disk ([limits](lima.md#limits)) |
`.git` protection uses your machine's file flags, so it doesn't depend on the backend.
On macOS, `.git` protection uses your machine's file flags, so it doesn't depend on the backend. On Linux it needs the backend to keep paths in the project folder read-only in the VM, which Lima does where the kernel lets devvm use a user namespace ([.git protection on Linux hosts](../safety/git-protection.md#linux-hosts)).
An image's key includes its backend, so a backend never uses an image another backend built.
+60 -4
View File
@@ -1,5 +1,6 @@
---
title: Lima
explainer: What Lima needs, and how devvm uses it
weight: 1
---
@@ -11,13 +12,13 @@ weight: 1
{{< os-tab name="macOS" >}}
- macOS 13 or newer, on arm64 or x86_64.
- Lima 2.0 or newer, with `limactl` on your `PATH`. Install it with Homebrew, `brew install lima`, or see [Lima's install guide](https://lima-vm.io/docs/installation/).
- Lima 2.2 or newer, with `limactl` on your `PATH`. Install it with Homebrew, `brew install lima`, or see [Lima's install guide](https://lima-vm.io/docs/installation/).
{{< /os-tab >}}
{{< os-tab name="Linux" >}}
- Linux on arm64 or x86_64.
- Lima 2.0 or newer, with `limactl` on your `PATH`. Install it with Homebrew, `brew install lima`, or see [Lima's install guide](https://lima-vm.io/docs/installation/).
- Lima 2.2 or newer, with `limactl` on your `PATH`. Install it with Homebrew, `brew install lima`, or see [Lima's install guide](https://lima-vm.io/docs/installation/).
- QEMU from your package manager: `qemu-system-aarch64` (or `qemu-system-x86_64`) and `qemu-img`.
- Read and write access to `/dev/kvm`. That means virtualization is turned on in the firmware (or nested virtualization, in a VM), and your user is in the `kvm` group.
@@ -62,14 +63,69 @@ To have a watcher see your edits, set it to poll the project folder, which costs
Set the variables in the VM's shell or in your project's scripts, before the tool starts. Leave Lima's own file event setting, `mountInotify`, off, because with it on, commands in the VM that write to the project folder, such as `git init`, fail at random ([details](../internals/lima.md#what-devvm-sets-on-a-vm)).
## The project folder's cache
On Linux, QEMU shares the project folder with the VM over 9p, and the VM's kernel can cache the folder's files as it reads and writes them. devvm gives every new VM the cache mode `none`, so the VM reads and writes straight through to the folder on this machine, and what you edit on either side is what the other side sees.
Lima's own default for a writable folder is `mmap`, which caches the files' contents in the VM, and Linux's 9p client loses data with it in two ways. When a program reads a file's size while another write is making the file longer, the VM can take the older size from this machine and drop the new data, even after `fsync` succeeded, so the file ends up empty or cut to 4096 bytes, and Claude Code's edits are one way to set it off. And when a program locks a file it has written, its next read of that file returns zeros. That stops SQLite at its second write with `file is not a database`, whatever its journal mode, and Gradle's second build with `Unexpected lock protocol found in lock file`.
A VM made before devvm chose `none` keeps `mmap`, and devvm doesn't change its mount on its own, so each launch of such a VM warns until you switch it. `devvm mount-cache` shows how this folder's VM caches its project folder, and `devvm mount-cache none` switches it from the VM's next start, so in a terminal devvm offers to restart a running VM now. `none` is the only mode devvm sets, so any other value is refused.
```sh
devvm mount-cache
devvm mount-cache none
```
A [`--clone` VM](../using/clone.md) mounts no project folder, so it has no cache mode until `devvm clone off` mounts the folder, which then gets `none`. On macOS, VMs share the project folder with virtiofs, which has no cache mode to choose, so there `devvm mount-cache` refuses. On Linux it refuses the same for a VM whose project folder isn't a 9p mount, such as one whose Lima config you gave another mount type.
### When the cache mode changes
The VM gets `none` at its next start, and that start mounts the project folder again once the VM runs, before devvm sets the VM up or opens its shell. The VM's first mount of the folder at boot still has the old mode, because the guest reads its new mount options only after it has mounted the folder. devvm then checks the folder:
- When the folder is mounted with `none`, the VM goes on as usual.
- When the folder is still mounted with the old mode, isn't mounted at all, or the VM doesn't answer the check, devvm restarts the VM once, before it sets it up or opens its shell. The folder can be left with the old mode when the VM couldn't unmount it, because something it started at boot, such as a container, was using it, or when the VM's start was degraded. It can be left unmounted when the VM unmounted it but couldn't mount it again, as happens on an Alpine VM. The restart's boot mounts the folder with `none`, and devvm checks it again.
After the restart, devvm checks the folder once more and doesn't restart the VM again:
- When the folder is mounted with `none`, the VM goes on as usual.
- When the folder is still mounted with the old mode, devvm warns and goes on, though the folder can lose writes under that mode.
- When the folder isn't mounted at all, or the VM doesn't answer the check, devvm stops the VM before it sets it up or opens its shell, because files written there would go to the VM's own disk and vanish once the folder is mounted over them.
In both cases a restart of your own repeats what failed, so look first at why the VM's boot didn't mount the folder with `none`. Its console log, which [A VM won't boot](../using/troubleshooting.md#a-vm-wont-boot) shows where to find, has what the boot said, and the run log has what the VM's `umount` and `mount` said and why devvm restarted the VM ([logs](../using/troubleshooting.md#a-command-fails)).
When devvm can't stop the VM for the restart, a folder still mounted with the old mode is warned of and the VM goes on as it runs. Otherwise the launch fails, saying the VM didn't stop, because it may still be running. Pressing Ctrl+C while devvm mounts or checks the folder, or stops the VM for the restart, stops the VM, without a restart. A launch into a running VM checks too that its project folder is mounted, and refuses to open a shell in one whose folder isn't, naming `devvm restart`.
### devvm mount-cache --json
`devvm mount-cache --json` prints the VM's mode, whether it was chosen, as the VM was made or with `devvm mount-cache none`, rather than kept from Lima, and the mode its next start gives it, when that differs:
```json
{
"version": 1,
"mode": "mmap",
"chosen": true,
"pending": "none"
}
```
### Programs that map files for writing
With `none`, a program in the VM can't map a file in the project folder for shared writing, or map one it opened for writing at all, and it fails at once with `Invalid argument`, so nothing is lost. LMDB, numpy's `memmap` in `r+` or `w+` mode, Java's read-write `MappedByteBuffer` and the mold linker do this, while git, npm, Vite, webpack, esbuild, jest, Go, cargo with Rust's own linker, GNU ld, lld, Gradle, DuckDB, ccache and Terraform work as they do on any disk. LMDB is what Parcel's `.parcel-cache` and Gatsby's cache use.
For a program that maps its files, keep them on the VM's own disk, such as in its home folder: for mold, a `CARGO_TARGET_DIR` there, or lld instead. Or use a [`--clone` VM](../using/clone.md), whose repo is on the VM's own disk. The VM's own disk is also far faster than the shared folder, so a `--clone` VM suits large repos and heavy builds: on a Fedora 43 host, `npm ci` of 369 packages took 4.8 s in the shared folder and 2.8 s on the VM's disk, a debug `cargo build` of ripgrep 8.5 s and 4.8 s, and a cold `git status` of an 18,000-file tree 23 s and 1 s.
### SQLite and the cache
SQLite's default journal works in the project folder. WAL mode doesn't, because SQLite maps its shared index and fails with `disk I/O error`, unless the connection sets `PRAGMA locking_mode=EXCLUSIVE` before `PRAGMA journal_mode=WAL`. That keeps the index in memory, and lets only that connection use the database. A project whose database is in WAL mode works in a `--clone` VM, or with the database outside the project folder, such as in the VM's home folder or `/tmp`.
## Cleaning up
`devvm gc` deletes devvm's stale and unfinished Lima images and the shared tools that no VM has and that aren't current, and it leaves your VMs as they are. `devvm images rm` deletes an image that's current, except on Linux hosts one whose disk VMs use ([cleaning up](../using/images.md#cleaning-up)). Lima also keeps a download cache of its own, which holds Ubuntu's cloud images that devvm's builds downloaded, and which your own Lima VMs share. `devvm gc --caches` deletes the cloud images that devvm downloads and that no image of devvm's names, after listing them and asking, and devvm never runs `limactl prune`, which empties the whole cache ([what devvm keeps](../using/space.md#lima)).
## Limits
- **Folder names in VM names are cut short.** Lima keeps each VM's ssh socket in the VM's folder in its home, and a socket path has at most 104 characters. A long Lima home leaves less room for the name, so set `DEVVM_LIMA_HOME` to a shorter folder if devvm says the home is too long, or that a VM's name leaves no room for the folder's name ([VM names](../internals/backends.md#vm-names)).
- **Folder names in VM names are cut short.** Lima keeps each VM's ssh socket in the VM's folder in its home, and a socket path has fewer than 104 characters. A long Lima home leaves less room for the name, so set `DEVVM_LIMA_HOME` to a shorter folder if devvm says the home is too long, or that a VM's name leaves no room for the folder's name ([VM names](../internals/backends.md#vm-names)).
- **Paths can't contain commas.** Lima and QEMU split mount options on commas, so devvm refuses to mount a project folder whose path has one, and it leaves out an agent's folder whose path has one, with a warning.
- **Disks can grow but not shrink.**
- **Mounts on Linux are 9p.** A 9p share mounts once per guest, and file watchers in the VM miss changes in its subfolders ([file watchers](#file-watchers)).
- **Mounts on Linux are 9p.** A 9p share mounts once per guest, file watchers in the VM miss changes in its subfolders ([file watchers](#file-watchers)), and SQLite's WAL mode doesn't work in the project folder, which a `--clone` VM avoids ([SQLite and the cache](#sqlite-and-the-cache)).
- **A VM that Lima reports as failed to start** still starts, with a warning, when it's running but degraded because one of Lima's boot scripts failed. A VM that doesn't answer over ssh within a minute is stopped instead, and its console log is in its Lima folder (`serial*.log`).
+6
View File
@@ -1,6 +1,7 @@
---
title: CLI reference
weight: 90
explainer: Every devvm command, with its arguments and flags
---
Every devvm command, with its arguments and flags. `devvm <command> --help` prints the same.
@@ -13,6 +14,8 @@ Every devvm command, with its arguments and flags. `devvm <command> --help` prin
- [devvm agent save](devvm_agent_save.md): Copy the agents' settings from this folder's VM into devvm's store
- [devvm build](devvm_build.md): Build an image and the images under it, unless they're built
- [devvm clone](devvm_clone.md): Show or change whether this folder's VM has its own clone of the repo
- [devvm clone add](devvm_clone_add.md): Copy one more repo into this folder's --clone VM
- [devvm clone fetch](devvm_clone_fetch.md): Fetch the work of this folder's --clone VM into each of its repos
- [devvm code](devvm_code.md): Open this folder's VM in VS Code over Remote-SSH
- [devvm completion](devvm_completion.md): Print the shell completion script for bash, zsh or fish
- [devvm desktop](devvm_desktop.md): Open this folder's VM's desktop in a VNC viewer
@@ -39,11 +42,14 @@ Every devvm command, with its arguments and flags. `devvm <command> --help` prin
- [devvm link rm](devvm_link_rm.md): Remove one of this folder's VM's links
- [devvm link unpublish](devvm_link_unpublish.md): Stop offering ports of this folder's VM to links
- [devvm ls](devvm_ls.md): List the project VMs
- [devvm mount-cache](devvm_mount-cache.md): Show or change how this folder's VM caches its project folder
- [devvm network](devvm_network.md): Show or change the network tier of this folder's VM
- [devvm network allow](devvm_network_allow.md): Allow hosts for this folder's VM
- [devvm network deny](devvm_network_deny.md): Deny hosts for this folder's VM
- [devvm network lock](devvm_network_lock.md): Lock this folder's VM to the hosts it learned, on the allowlist tier
- [devvm network log](devvm_network_log.md): Show what this folder's VM connected to and what its proxy blocked
- [devvm network rm](devvm_network_rm.md): Remove rules from this folder's VM
- [devvm network transparent](devvm_network_transparent.md): Show or change transparent mode for this folder's VM
- [devvm ports](devvm_ports.md): Show or change which ports this folder's VM forwards
- [devvm ports add](devvm_ports_add.md): Forward more ports from this folder's VM
- [devvm ports rm](devvm_ports_rm.md): Stop forwarding some ports from this folder's VM
+5 -3
View File
@@ -1,6 +1,6 @@
---
title: devvm
weight: 1
explainer: "Open a shell in this folder's VM, creating it first"
---
Open a shell in this folder's VM, creating it first
@@ -27,7 +27,7 @@ devvm [flags]
```text
--agents LIST the LIST of coding agents a new VM gets, such as claude,codex, or none (default: devvm setup's)
--clone create the VM with its own clone of this repo instead of mounting the folder
--clone create the VM with its own clone of this repo, or of each repo in this folder, instead of mounting the folder
--cpus N the N CPUs the VM gets (default: devvm size -g, else the image's)
--disk GiB the VM's disk in GiB, at least the image's (default: devvm size -g, else the image's)
--from IMAGE the container IMAGE base starts from, such as node:24, instead of Ubuntu's cloud image (default: $DEVVM_FROM)
@@ -35,12 +35,13 @@ devvm [flags]
--here use this folder's own VM, never that of a folder it's inside
--layers LIST the LIST of layers a new VM's image gets, bottom first, such as docker,mine, or none (default: devvm setup's)
--memory GiB the VM's memory in GiB, such as 16 or 16G (default: devvm size -g, else the image's)
--network TIER the network TIER a new VM gets: open, internet, allowlist or none (default: devvm network -g's, else allowlist)
--network TIER the network TIER a new VM gets: open, internet, allowlist or none, or learn for internet while it learns the hosts it needs (default: devvm network -g's, else allowlist)
--no-devcontainer create the VM without reading the folder's devcontainer.json
--no-git-protect create the VM without .git protection
--no-input never ask, and fail where devvm would ask, naming the flag that answers it
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
--ports PORTS the PORTS the VM forwards: all, none or a list like 5173,8000-8010 (default: devvm ports -g, else all)
--repos LIST the repos a --clone VM of a folder of repos gets: all, none or a LIST of their paths, such as frontend,backend (default: a picker in a terminal)
--ssh-agent create the VM with your SSH agent forwarded, so anything in it can use your keys while you're connected
--ssh-config add devvm's Include line to ~/.ssh/config without asking
--tools LIST the LIST of toolchains a new VM gets, such as node,python, or none (default: those the folder's files call for)
@@ -73,6 +74,7 @@ devvm [flags]
- [devvm limactl](devvm_limactl.md): Run Lima's limactl for debugging, which starts VMs unconfined, whatever their tier
- [devvm link](devvm_link.md): List this folder's VM's links to your other VMs
- [devvm ls](devvm_ls.md): List the project VMs
- [devvm mount-cache](devvm_mount-cache.md): Show or change how this folder's VM caches its project folder
- [devvm network](devvm_network.md): Show or change the network tier of this folder's VM
- [devvm ports](devvm_ports.md): Show or change which ports this folder's VM forwards
- [devvm rebuild](devvm_rebuild.md): Build an image again, and delete the old one
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm adopt
weight: 2
explainer: "Give this folder the VM made for an earlier folder or path"
---
Give this folder the VM made for an earlier folder or path
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm agent
weight: 3
explainer: "Fill devvm's store of the agents' settings and logins that every VM gets"
---
Fill devvm's store of the agents' settings and logins that every VM gets
+2 -2
View File
@@ -1,13 +1,13 @@
---
title: devvm agent import
weight: 4
explainer: "Copy the agents' settings and logins from this machine into devvm's store"
---
Copy the agents' settings and logins from this machine into devvm's store
## Synopsis
Copy the settings and logins of AGENT, claude, codex or opencode, or of every agent, from your home folder into devvm's store, never their history. It follows no link out of an agent's folder, and it asks before replacing what the store has.
Copy the settings and logins of AGENT, claude, codex, opencode or pi, or of every agent, from your home folder into devvm's store, never their history. It follows no link out of an agent's folder, and it asks before replacing what the store has.
```text
devvm agent import [AGENT...] [flags]
+4 -3
View File
@@ -1,13 +1,13 @@
---
title: devvm agent login
weight: 5
explainer: "Log an agent in, in this folder's VM, and save the login in devvm's store"
---
Log an agent in, in this folder's VM, and save the login in devvm's store
## Synopsis
Log AGENT in inside this folder's VM, and keep the login in devvm's store for every VM with the agent, which gets only placeholders. claude logs in to your Claude subscription in a browser on any machine, whose code you paste back, or gets a long-lived Claude Code token with --setup-token. codex and opencode log in to ChatGPT in a browser on this machine, or with a code with --device-code, or save an API key with --api-key.
Log AGENT in inside this folder's VM, and keep the login in devvm's store for every VM with the agent, which gets only placeholders. claude logs in to your Claude subscription in a browser on any machine, whose code you paste back, or gets a long-lived Claude Code token with --setup-token. codex and opencode log in to ChatGPT in a browser on this machine, or with a code with --device-code, or save an API key with --api-key, which is pi's only login.
```text
devvm agent login AGENT [flags]
@@ -21,6 +21,7 @@ devvm agent login AGENT [flags]
devvm agent login codex # log Codex in to ChatGPT in a browser on this machine
devvm agent login codex --device-code # log in with a code, in a browser on any machine
devvm agent login opencode --api-key --provider anthropic # save opencode's Anthropic API key, asking for it
devvm agent login pi --api-key --provider openai # save pi's OpenAI API key, asking for it
```
## Options
@@ -31,7 +32,7 @@ devvm agent login AGENT [flags]
-h, --help help for login
--here use this folder's own VM, never that of a folder it's inside
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
--provider PROVIDER with opencode's --api-key, the PROVIDER it's for: anthropic, openai or openrouter
--provider PROVIDER with opencode's or pi's --api-key, the PROVIDER it's for: anthropic, deepseek, google, groq, mistral, openai, openrouter or xai
--setup-token with claude, get a long-lived Claude Code token with claude setup-token instead
--stdin read the secret from a line of input, without asking
```
+2 -2
View File
@@ -1,13 +1,13 @@
---
title: devvm agent save
weight: 6
explainer: "Copy the agents' settings from this folder's VM into devvm's store"
---
Copy the agents' settings from this folder's VM into devvm's store
## Synopsis
Copy the settings of AGENT, claude, codex or opencode, or of every agent this folder's VM has, from the VM into devvm's store, so every VM with the agent gets them, never its logins or history. It shows what changed and asks first, so it runs only in a terminal without --no-input, and devvm starts a stopped VM for it.
Copy the settings of AGENT, claude, codex, opencode or pi, or of every agent this folder's VM has, from the VM into devvm's store, so every VM with the agent gets them, never its logins or history. It shows what changed and asks first, so it runs only in a terminal without --no-input, and devvm starts a stopped VM for it.
```text
devvm agent save [AGENT...] [flags]
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm build
weight: 7
explainer: "Build an image and the images under it, unless they're built"
---
Build an image and the images under it, unless they're built
+6 -2
View File
@@ -1,13 +1,13 @@
---
title: devvm clone
weight: 8
explainer: "Show or change whether this folder's VM has its own clone of the repo"
---
Show or change whether this folder's VM has its own clone of the repo
## Synopsis
Show whether this folder's VM has its own clone of the repo, on, or mounts this folder, off. devvm clone on and devvm clone off make the VM again from its image, after asking in a terminal without --no-input, then open a shell in it, and devvm keeps its home folder and its settings, while everything else on its disk is lost. On copies the repo's branches into the new clone, and off first offers to fetch the clone's work into this repo, unless you give --no-clone-check.
Show whether this folder's VM has its own clone of the repo, or of each repo in a folder of repos, on, or mounts this folder, off. devvm clone on and devvm clone off make the VM again from its image, after asking in a terminal without --no-input, then open a shell in it, and devvm keeps its home folder and its settings, while everything else on its disk is lost. On copies the repos' branches into the new clone, and off first offers to fetch the clone's work into this machine's repos, unless you give --no-clone-check.
```text
devvm clone [on|off] [flags]
@@ -20,6 +20,7 @@ devvm clone [on|off] [flags]
devvm clone on # make the VM again with its own clone of the repo, after asking
devvm clone off # fetch the clone's work, then make the VM again with this folder mounted
devvm clone on --force # make it again without asking, as a script must
devvm clone fetch # fetch the VM's branches into each repo on this machine
```
## Options
@@ -33,6 +34,7 @@ devvm clone [on|off] [flags]
--no-clone-check don't check a --clone VM's clone for unfetched commits and uncommitted changes first, which are lost
--no-export don't export the agents' history first
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
--repos LIST the repos a --clone VM of a folder of repos gets: all, none or a LIST of their paths, such as frontend,backend (default: a picker in a terminal)
```
## Options inherited from parent commands
@@ -49,3 +51,5 @@ devvm clone [on|off] [flags]
## See also
- [devvm](devvm.md): Open a shell in this folder's VM, creating it first
- [devvm clone add](devvm_clone_add.md): Copy one more repo into this folder's --clone VM
- [devvm clone fetch](devvm_clone_fetch.md): Fetch the work of this folder's --clone VM into each of its repos
+44
View File
@@ -0,0 +1,44 @@
---
title: devvm clone add
explainer: "Copy one more repo into this folder's --clone VM"
---
Copy one more repo into this folder's --clone VM
## Synopsis
Copy the repo at PATH, a folder in this folder's --clone VM's folder, into the VM at the same path, with its current and default branches, starting the VM if it's stopped. The repo gets a remote for the VM, as each of the VM's repos has.
```text
devvm clone add PATH [flags]
```
## Examples
```text
devvm clone add tools # copy the repo in ./tools into the VM
devvm clone add ../shared # copy a repo beside this one, in the same folder of repos
```
## Options
```text
-h, --help help for add
--here use this folder's own VM, never that of a folder it's inside
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
```
## Options inherited from parent commands
```text
--no-input never ask, and fail where devvm would ask, naming the flag that answers it
-v, --verbose show the output of the commands devvm runs instead of a status line
```
## Docs
[The docs page for devvm clone add](../using/clone.md#adding-a-repo) explains it in full.
## See also
- [devvm clone](devvm_clone.md): Show or change whether this folder's VM has its own clone of the repo
+45
View File
@@ -0,0 +1,45 @@
---
title: devvm clone fetch
explainer: "Fetch the work of this folder's --clone VM into each of its repos"
---
Fetch the work of this folder's --clone VM into each of its repos
## Synopsis
Fetch every branch of each repo in this folder's --clone VM into the repo on this machine, as remote-tracking branches of its remote for the VM, such as devvm/main, starting the VM if it's stopped. Then list the branches that are new or moved, each with the repos it's in.
```text
devvm clone fetch [flags]
```
## Examples
```text
devvm clone fetch # fetch every repo's branches, and list what's new
devvm clone fetch --json # list what's new for a script
```
## Options
```text
-h, --help help for fetch
--here use this folder's own VM, never that of a folder it's inside
--json print it as one JSON object, for scripts
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
```
## Options inherited from parent commands
```text
--no-input never ask, and fail where devvm would ask, naming the flag that answers it
-v, --verbose show the output of the commands devvm runs instead of a status line
```
## Docs
[The docs page for devvm clone fetch](../using/clone.md#fetching-the-vms-work) explains it in full.
## See also
- [devvm clone](devvm_clone.md): Show or change whether this folder's VM has its own clone of the repo
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm code
weight: 9
explainer: "Open this folder's VM in VS Code over Remote-SSH"
---
Open this folder's VM in VS Code over Remote-SSH
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm completion
weight: 10
explainer: "Print the shell completion script for bash, zsh or fish"
---
Print the shell completion script for bash, zsh or fish
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm desktop
weight: 11
explainer: "Open this folder's VM's desktop in a VNC viewer"
---
Open this folder's VM's desktop in a VNC viewer
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm doctor
weight: 12
explainer: "Check what devvm needs on this machine"
---
Check what devvm needs on this machine
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm gc
weight: 13
explainer: "Delete stale images, unused tools, old files and the Nix cache over its cap"
---
Delete stale images, unused tools, old files and the Nix cache over its cap
+3 -3
View File
@@ -1,16 +1,16 @@
---
title: devvm git-protect
weight: 14
explainer: "Show or change .git protection for this folder's VM"
---
Show or change .git protection for this folder's VM
## Synopsis
Show this folder's VM's .git protection, which locks the git hooks and config that run code on this machine, as on, strict, off, or clone for a --clone VM. devvm git-protect on, strict or off changes it at once on a stopped VM, and on a running one when it next stops, so in a terminal devvm offers to restart it now.
Show this folder's VM's .git protection, which locks the git hooks and config that run code on this machine, as on, off, or clone for a --clone VM. devvm git-protect on or off changes it at once on a stopped VM, and on a running one when it next stops, so in a terminal devvm offers to restart it now.
```text
devvm git-protect [on|strict|off] [flags]
devvm git-protect [on|off] [flags]
```
## Examples
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm group
weight: 15
explainer: "Show the group this folder's VM is in"
---
Show the group this folder's VM is in
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm group join
weight: 16
explainer: "Put this folder's VM in a group of VMs"
---
Put this folder's VM in a group of VMs
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm group leave
weight: 17
explainer: "Take this folder's VM out of its group"
---
Take this folder's VM out of its group
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm history
weight: 18
explainer: "List the saved exports of agents' history"
---
List the saved exports of agents' history
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm history export
weight: 19
explainer: "Save this folder's VM's agent history to a .tar.gz"
---
Save this folder's VM's agent history to a .tar.gz
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm history import
weight: 20
explainer: "Put an export of agent history into this folder's VM"
---
Put an export of agent history into this folder's VM
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm host
weight: 21
explainer: "Get this folder's VM ready for ssh and editors, and show its host name"
---
Get this folder's VM ready for ssh and editors, and show its host name
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm images
weight: 22
explainer: "List the images and the shared tools"
---
List the images and the shared tools
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm images rm
weight: 23
explainer: "Delete images, by name or by key"
---
Delete images, by name or by key
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm layer
weight: 24
explainer: "Make image layers of your own, or change this folder's VM's layers"
---
Make image layers of your own, or change this folder's VM's layers
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm layer add
weight: 25
explainer: "Make this folder's VM again with more layers, then open a shell in it"
---
Make this folder's VM again with more layers, then open a shell in it
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm layer new
weight: 26
explainer: "Start a layer of your own"
---
Start a layer of your own
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm layer rm
weight: 27
explainer: "Make this folder's VM again without some of its layers, then open a shell in it"
---
Make this folder's VM again without some of its layers, then open a shell in it
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm limactl
weight: 28
explainer: "Run Lima's limactl for debugging, which starts VMs unconfined, whatever their tier"
---
Run Lima's limactl for debugging, which starts VMs unconfined, whatever their tier
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm link
weight: 29
explainer: "List this folder's VM's links to your other VMs"
---
List this folder's VM's links to your other VMs
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm link add
weight: 30
explainer: "Link this folder's VM to a port of another VM"
---
Link this folder's VM to a port of another VM
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm link publish
weight: 31
explainer: "Show or add the ports this folder's VM offers to links"
---
Show or add the ports this folder's VM offers to links
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm link rm
weight: 32
explainer: "Remove one of this folder's VM's links"
---
Remove one of this folder's VM's links
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm link unpublish
weight: 33
explainer: "Stop offering ports of this folder's VM to links"
---
Stop offering ports of this folder's VM to links
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm ls
weight: 34
explainer: "List the project VMs"
---
List the project VMs
+45
View File
@@ -0,0 +1,45 @@
---
title: devvm mount-cache
explainer: "Show or change how this folder's VM caches its project folder"
---
Show or change how this folder's VM caches its project folder
## Synopsis
Show how this folder's VM caches its project folder on a Linux host: none, which new VMs get, or mmap for a VM made before devvm chose none, which can lose writes and breaks SQLite and Gradle there. devvm mount-cache none switches it from the VM's next start, so in a terminal devvm offers to restart a running VM now.
```text
devvm mount-cache [none] [flags]
```
## Examples
```text
devvm mount-cache # show the VM's cache mode
devvm mount-cache none # stop the VM losing writes, from its next start
```
## Options
```text
-h, --help help for mount-cache
--here use this folder's own VM, never that of a folder it's inside
--json print it as one JSON object, for scripts
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
```
## Options inherited from parent commands
```text
--no-input never ask, and fail where devvm would ask, naming the flag that answers it
-v, --verbose show the output of the commands devvm runs instead of a status line
```
## Docs
[The docs page for devvm mount-cache](../backends/lima.md#the-project-folders-cache) explains it in full.
## See also
- [devvm](devvm.md): Open a shell in this folder's VM, creating it first
+7 -4
View File
@@ -1,16 +1,16 @@
---
title: devvm network
weight: 35
explainer: "Show or change the network tier of this folder's VM"
---
Show or change the network tier of this folder's VM
## Synopsis
Show the network tier of this folder's VM, which is open, internet, allowlist, none or unenforced, and then its allowlist, policy by policy: devvm's built-in ones by name, then your files by path. With a tier, give the VM that tier: between the confined tiers at once, and into or out of open from the VM's next start, so in a terminal devvm offers to restart a running VM now. With -g, show or change the tier new VMs get, allowlist unless you change it.
Show the network tier of this folder's VM, which is open, internet, allowlist, none or unenforced, and then its allowlist, policy by policy: devvm's built-in ones by name, then your files by path. With a tier, give the VM that tier: between the confined tiers at once, and into or out of open from the VM's next start, so in a terminal devvm offers to restart a running VM now, and learn gives it the internet tier while it learns the hosts it reaches, until devvm network lock. With -g, show or change the tier new VMs get, allowlist unless you change it, which is never learn, because each VM learns on its own.
```text
devvm network [open|internet|allowlist|none] [flags]
devvm network [open|internet|learn|allowlist|none] [flags]
```
## Examples
@@ -19,7 +19,8 @@ devvm network [open|internet|allowlist|none] [flags]
devvm network # show the VM's network tier and allowlist
devvm network allow example.com # let the VM reach example.com
devvm network log --blocked # list what the VM's proxy blocked
devvm network internet # let the VM reach any public host
devvm network learn # let the VM reach any public host while it learns the ones it needs
devvm network lock # choose which of them it keeps, and put it on the allowlist tier
devvm network -g none # give every new VM the none tier
```
@@ -49,5 +50,7 @@ devvm network [open|internet|allowlist|none] [flags]
- [devvm](devvm.md): Open a shell in this folder's VM, creating it first
- [devvm network allow](devvm_network_allow.md): Allow hosts for this folder's VM
- [devvm network deny](devvm_network_deny.md): Deny hosts for this folder's VM
- [devvm network lock](devvm_network_lock.md): Lock this folder's VM to the hosts it learned, on the allowlist tier
- [devvm network log](devvm_network_log.md): Show what this folder's VM connected to and what its proxy blocked
- [devvm network rm](devvm_network_rm.md): Remove rules from this folder's VM
- [devvm network transparent](devvm_network_transparent.md): Show or change transparent mode for this folder's VM
+13 -10
View File
@@ -1,13 +1,13 @@
---
title: devvm network allow
weight: 36
explainer: "Allow hosts for this folder's VM"
---
Allow hosts for this folder's VM
## Synopsis
Add RULEs to the allowlist of this folder's VM, or with -g of every VM, from the next connection on. RULE is a host, *.host for its subdomains, ** for any host, or an address or CIDR, and with a port, such as example.com:8443, it matches only that port instead of 443 and 80.
Add RULEs to the allowlist of this folder's VM, or with -g of every VM, from the next connection on. RULE is a host, *.host for its subdomains, ** for any host, or an address or CIDR, and with a port, such as example.com:8443, it matches only that port instead of 443 and 80. --method and --path narrow a host's rule to some of its requests, which its proxy decrypts to check.
```text
devvm network allow RULE... [flags]
@@ -16,19 +16,22 @@ devvm network allow RULE... [flags]
## Examples
```text
devvm network allow example.com # let the VM reach example.com
devvm network allow '*.example.com' # and any of its subdomains
devvm network allow 10.0.0.5:5432 # one port of one address
devvm network allow -g pypi.org # let every VM reach pypi.org
devvm network allow example.com # let the VM reach example.com
devvm network allow '*.example.com' # and any of its subdomains
devvm network allow 10.0.0.5:5432 # one port of one address
devvm network allow api.example.com --method GET,HEAD # let it only read from api.example.com
devvm network allow -g pypi.org # let every VM reach pypi.org
```
## Options
```text
-g, --global change your rules for every VM instead
-h, --help help for allow
--here use this folder's own VM, never that of a folder it's inside
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
-g, --global change your rules for every VM instead
-h, --help help for allow
--here use this folder's own VM, never that of a folder it's inside
--method METHODS narrow each rule to these METHODS of a host's requests, such as GET,HEAD
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
--path PATH narrow each rule to the requests whose path matches PATH, such as /repos/ for everything below /repos/
```
## Options inherited from parent commands
+12 -8
View File
@@ -1,13 +1,13 @@
---
title: devvm network deny
weight: 37
explainer: "Deny hosts for this folder's VM"
---
Deny hosts for this folder's VM
## Synopsis
Add RULEs as denies to this folder's VM's rules, or with -g every VM's, from the next connection on, and a deny beats any allow. RULE is a host, *.host for its subdomains, ** for any host, or an address or CIDR, and with a port, such as example.com:8443, it matches only that port instead of 443 and 80.
Add RULEs as denies to this folder's VM's rules, or with -g every VM's, from the next connection on, and a deny beats any allow. RULE is a host, *.host for its subdomains, ** for any host, or an address or CIDR, and with a port, such as example.com:8443, it matches only that port instead of 443 and 80. --method and --path narrow a host's rule to some of its requests, which its proxy decrypts to check.
```text
devvm network deny RULE... [flags]
@@ -16,17 +16,21 @@ devvm network deny RULE... [flags]
## Examples
```text
devvm network deny example.com # keep the VM from reaching example.com
devvm network deny -g '*.example.com' # keep every VM from its subdomains
devvm network deny example.com # keep the VM from reaching example.com
devvm network deny api.github.com --method POST,PUT,PATCH,DELETE # keep it from changing anything through GitHub's API
devvm network deny github.com --path '/*/*/git-receive-pack' # keep it from pushing to GitHub over HTTPS
devvm network deny -g '*.example.com' # keep every VM from its subdomains
```
## Options
```text
-g, --global change your rules for every VM instead
-h, --help help for deny
--here use this folder's own VM, never that of a folder it's inside
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
-g, --global change your rules for every VM instead
-h, --help help for deny
--here use this folder's own VM, never that of a folder it's inside
--method METHODS narrow each rule to these METHODS of a host's requests, such as GET,HEAD
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
--path PATH narrow each rule to the requests whose path matches PATH, such as /repos/ for everything below /repos/
```
## Options inherited from parent commands
+48
View File
@@ -0,0 +1,48 @@
---
title: devvm network lock
explainer: "Lock this folder's VM to the hosts it learned, on the allowlist tier"
---
Lock this folder's VM to the hosts it learned, on the allowlist tier
## Synopsis
For this folder's VM, which learns the hosts it reaches, choose in a list which of the hosts it reached beyond its allowlist to add to its own rules, then give it the allowlist tier at once. Only a host on port 443 of a package registry or vendor that devvm knows, such as registry.npmjs.org, starts ticked, and risky ones are listed apart, so read the list before you confirm it. Without a terminal, --all adds every host and --none adds none, and --json lists the hosts and changes nothing.
```text
devvm network lock [flags]
```
## Examples
```text
devvm network lock # choose the hosts the VM keeps, then lock it to them
devvm network lock --json # list the hosts it learned, changing nothing
devvm network lock --all # keep every host it learned, without asking
```
## Options
```text
--all add every host the VM learned, without asking
-h, --help help for lock
--here use this folder's own VM, never that of a folder it's inside
--json print it as one JSON object, for scripts
--none add none of the hosts the VM learned, without asking
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
```
## Options inherited from parent commands
```text
--no-input never ask, and fail where devvm would ask, naming the flag that answers it
-v, --verbose show the output of the commands devvm runs instead of a status line
```
## Docs
[The docs page for devvm network lock](../safety/network.md#locking-it) explains it in full.
## See also
- [devvm network](devvm_network.md): Show or change the network tier of this folder's VM
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm network log
weight: 38
explainer: "Show what this folder's VM connected to and what its proxy blocked"
---
Show what this folder's VM connected to and what its proxy blocked
+11 -8
View File
@@ -1,13 +1,13 @@
---
title: devvm network rm
weight: 39
explainer: "Remove rules from this folder's VM"
---
Remove rules from this folder's VM
## Synopsis
Remove RULEs, as written with a deny's !, from this folder's VM's own rules, or with -g yours for every VM. The change applies at once.
Remove RULEs, as written with a deny's !, from this folder's VM's own rules, or with -g yours for every VM, with --method and --path for a rule that narrows. The change applies at once.
```text
devvm network rm RULE... [flags]
@@ -16,17 +16,20 @@ devvm network rm RULE... [flags]
## Examples
```text
devvm network rm example.com # remove an allow
devvm network rm '!example.com' # remove a deny
devvm network rm example.com # remove an allow
devvm network rm '!example.com' # remove a deny
devvm network rm api.example.com --method GET,HEAD # remove an allow that narrows
```
## Options
```text
-g, --global change your rules for every VM instead
-h, --help help for rm
--here use this folder's own VM, never that of a folder it's inside
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
-g, --global change your rules for every VM instead
-h, --help help for rm
--here use this folder's own VM, never that of a folder it's inside
--method METHODS narrow each rule to these METHODS of a host's requests, such as GET,HEAD
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
--path PATH narrow each rule to the requests whose path matches PATH, such as /repos/ for everything below /repos/
```
## Options inherited from parent commands
+46
View File
@@ -0,0 +1,46 @@
---
title: devvm network transparent
explainer: "Show or change transparent mode for this folder's VM"
---
Show or change transparent mode for this folder's VM
## Synopsis
Show whether this folder's VM sends tools that ignore the proxy settings to its proxy by the names they look up, on or off, and where that comes from: the VM's own setting, config.toml's transparent-proxy, or devvm's default, on. devvm network transparent on or off gives the VM its own setting, which applies from its next launch, while it's on a confined tier.
```text
devvm network transparent [on|off] [flags]
```
## Examples
```text
devvm network transparent # show the VM's transparent mode and where it comes from
devvm network transparent off # turn it off for this VM, from its next launch
devvm network transparent on # turn it on again, whatever config.toml says
```
## Options
```text
-h, --help help for transparent
--here use this folder's own VM, never that of a folder it's inside
--json print it as one JSON object, for scripts
--parent use the VM of the nearest folder this one is inside, even across a git repo of its own
```
## Options inherited from parent commands
```text
--no-input never ask, and fail where devvm would ask, naming the flag that answers it
-v, --verbose show the output of the commands devvm runs instead of a status line
```
## Docs
[The docs page for devvm network transparent](../safety/network.md#tools-that-ignore-the-proxy) explains it in full.
## See also
- [devvm network](devvm_network.md): Show or change the network tier of this folder's VM
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm ports
weight: 40
explainer: "Show or change which ports this folder's VM forwards"
---
Show or change which ports this folder's VM forwards
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm ports add
weight: 41
explainer: "Forward more ports from this folder's VM"
---
Forward more ports from this folder's VM
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm ports rm
weight: 42
explainer: "Stop forwarding some ports from this folder's VM"
---
Stop forwarding some ports from this folder's VM
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm rebuild
weight: 43
explainer: "Build an image again, and delete the old one"
---
Build an image again, and delete the old one
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm restart
weight: 44
explainer: "Restart this folder's VM and open a shell in it"
---
Restart this folder's VM and open a shell in it
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm retention
weight: 45
explainer: "Show or change what devvm deletes on its own"
---
Show or change what devvm deletes on its own
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm rm
weight: 46
explainer: "Delete this folder's VM, or a VM whose folder is gone"
---
Delete this folder's VM, or a VM whose folder is gone
+6 -5
View File
@@ -1,13 +1,13 @@
---
title: devvm secret
weight: 47
explainer: "List the secrets kept on this machine, for VMs to use"
---
List the secrets kept on this machine, for VMs to use
## Synopsis
List the secrets devvm keeps on this machine, claude for the Claude Code token, github for a GitHub token and proxy for the password of the company proxy that config.toml names, with whether each is saved and the VMs using it. A VM gets a placeholder, and its proxy puts the secret into requests for the secret's hosts. No VM gets proxy, which devvm's proxies send only to the company proxy.
List the secrets devvm keeps on this machine, claude for the Claude Code token, github for a GitHub token, proxy for the password of the company proxy that config.toml names, and your own, with each one's hosts, header and variable, whether it's saved and the VMs using it. A VM gets a placeholder, and its proxy puts the secret into requests for the secret's hosts. No VM gets proxy, which devvm's proxies send only to the company proxy.
```text
devvm secret [flags]
@@ -16,9 +16,10 @@ devvm secret [flags]
## Examples
```text
devvm secret # list the secrets and the VMs using each
devvm secret set github # save a GitHub token, asking for it
devvm secret use github # let this folder's VM use it
devvm secret # list the secrets and the VMs using each
devvm secret set github # save a GitHub token, asking for it
devvm secret set stripe --host api.stripe.com --env STRIPE_API_KEY --prefix sk_ # save a secret of your own for api.stripe.com
devvm secret use github # let this folder's VM use it
```
## Options
+2 -2
View File
@@ -1,13 +1,13 @@
---
title: devvm secret rm
weight: 48
explainer: "Delete a saved secret"
---
Delete a saved secret
## Synopsis
Delete a saved secret, after asking in a terminal without --no-input. Proxies that are running stop putting it in at once, but what a VM did with it stays done.
Delete a saved secret, after asking in a terminal without --no-input. A secret of your own goes with its hosts, header and variable, and the VMs using it stop using it. Proxies that are running stop putting it in at once, but what a VM did with it stays done.
```text
devvm secret rm NAME [flags]
+18 -7
View File
@@ -1,13 +1,13 @@
---
title: devvm secret set
weight: 49
explainer: "Save a secret on this machine"
---
Save a secret on this machine
## Synopsis
Save a secret on this machine, claude for the Claude Code token that claude setup-token prints, github for a GitHub token, or proxy for the password of the company proxy that config.toml names. devvm asks for it without showing it, and --stdin reads a line instead. Proxies that are running put a new token in at once, and a VM's proxy reads proxy as it starts.
Save a secret on this machine: claude for the Claude Code token that claude setup-token prints, github for a GitHub token, proxy for the password of the company proxy that config.toml names, or one of your own, which needs --host and --env the first time and keeps what it has of them after. devvm asks for it without showing it, and --stdin reads a line instead. Proxies that are running put a new value in at once, and a VM's proxy reads proxy as it starts.
```text
devvm secret set NAME [flags]
@@ -16,16 +16,27 @@ devvm secret set NAME [flags]
## Examples
```text
devvm secret set claude # save the Claude Code token, asking for it
gh auth token | devvm secret set github --stdin # save GitHub CLI's token without asking
devvm secret set proxy # save the company proxy's password, asking for it
devvm secret set claude # save the Claude Code token, asking for it
gh auth token | devvm secret set github --stdin # save GitHub CLI's token without asking
devvm secret set stripe --host api.stripe.com --env STRIPE_API_KEY --prefix sk_ # save a Stripe key, sent to api.stripe.com alone
devvm secret set openrouter --host openrouter.ai --env OPENROUTER_API_KEY # save an API key, sent as Authorization: Bearer
devvm secret set stripe # save a new value for a secret of yours, keeping its hosts
devvm secret set proxy # save the company proxy's password, asking for it
```
## Options
```text
-h, --help help for set
--stdin read the secret from a line of input, without asking
--basic-user let a secret of your own go in as the username of Basic credentials, as Stripe takes a key
--env VARIABLE the VARIABLE that holds the placeholder of a secret of your own in VMs, such as STRIPE_API_KEY
--header HEADER the HEADER that a secret of your own goes in, such as X-Api-Key (default: Authorization)
-h, --help help for set
--host HOST a HOST that a secret of your own goes to, such as api.example.com: repeat it, or join hosts with commas
--method METHODS the METHODS of the requests a secret of your own goes in, such as GET,HEAD, or none for every method
--path PATH the PATH of the requests a secret of your own goes in, such as /api/ for everything below /api/, or none for every path
--prefix PREFIX the PREFIX that the placeholder of a secret of your own starts with, such as sk_, for a client that checks how a key starts
--scheme SCHEME the SCHEME of a secret of your own in Authorization besides Bearer and Token, such as ApiKey, or none
--stdin read the secret from a line of input, without asking
```
## Options inherited from parent commands
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm secret unuse
weight: 50
explainer: "Stop this folder's VM using a secret"
---
Stop this folder's VM using a secret
+3 -2
View File
@@ -1,13 +1,13 @@
---
title: devvm secret use
weight: 51
explainer: "Let this folder's VM use a secret"
---
Let this folder's VM use a secret
## Synopsis
Let this folder's VM use a secret. Its proxy puts the secret in at once, and the VM gets its placeholder from its next launch.
Let this folder's VM use a secret, and reach its hosts on port 443. Its proxy puts the secret in at once, and the VM gets its placeholder from its next launch.
```text
devvm secret use NAME [flags]
@@ -17,6 +17,7 @@ devvm secret use NAME [flags]
```text
devvm secret use github # let the VM use your GitHub token
devvm secret use stripe # let the VM use a secret of yours
```
## Options
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm setup
weight: 52
explainer: "Choose base's features, and new VMs' size, network tier, coding agents and layers"
---
Choose base's features, and new VMs' size, network tier, coding agents and layers
+1 -1
View File
@@ -1,6 +1,6 @@
---
title: devvm size
weight: 53
explainer: "Show or change this folder's VM's size"
---
Show or change this folder's VM's size
Loaded 100 of 846 files, more files were not shown because too many files have changed in this diff. Show more