devvm network prints the VM's network policy as ls shows it (on, off,
unenforced); devvm network on|off changes its state, applied when it next
starts (net_set_running/net_set_stopped, net_already when unchanged,
net_on_old_tokens on turning on). on needs the backend's egress proxy.
A running VM turned off stays on its proxy until it next starts
(net_off_next_start). Confined now means started with the proxy (Lima
reads the recorded network; the fake tracks Start's), so a VM turned on
while it ran direct is unenforced and its launch offers the confined
restart; net_unenforced* say it wasn't started confined.
net_flag_ignored, net_off_log and net_off_policy name devvm network.
Docs: network.md "Turning it on or off", commands.md, security.md,
contributing.md, CLI reference. Tests: TestNetwork,
TestNetworkRequiresEgressProxy, Lima's Confined after a direct start,
network.txtar (what it prints), e2e network (off, on while running,
off while confined).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
devvm policy shows the policy files of this folder's VM that have rules,
in order, comments left out. devvm policy allow|deny|rm RULE... edit the
VM's own file, or with -g/--global the user's file for every VM; the
VM's proxy re-reads a changed file, so changes apply at once.
- proxy.ValidRule: the rules devvm policy takes (host, *.host, **, an
address or CIDR, optional port and !); AllowRule's suggestions are
valid (FuzzRequest checks it), and FuzzParseRule checks valid rules
parse.
- netpolicy: Rule, AddRule, RemoveRule, WriteRules; files rewritten
whole through a link; duplicates and rm match in any case, comments
aside.
- vm: Env.Policy and Env.PolicyChange; net_off_policy for a VM without
network policy.
- state.VMNames skips <vm>.policy files.
- Messages: net_off_policy, no_vm_policy, not_a_rule, rule_added,
rule_added_global, rule_present, rule_removed, rule_removed_global,
rule_missing, policy_failed.
- testdata/script/policy.txtar: allow/deny/rm, -g, IPv6 rules, refused
rules, the rules shown per file, a VM without network policy, and a
new VM not inheriting rules of one deleted outside devvm.
- e2e network: the allow command devvm log --blocked suggests applies
at once on the running proxy; rm blocks again.
- Docs: network.md (Changing rules), commands.md, CLI reference.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
devvm log [-f] [-n N] [--blocked] shows what this folder's VM's proxy
allowed and blocked, the last 50 events unless -n, following new ones
with -f, or the blocks grouped by host and port with the devvm policy
allow command that allows each (--blocked). Control characters from the
VM are dropped.
- internal/netpolicy/log.go: WriteLog (tail and follow, a partial last
line and an emptied log handled), FormatEvent, WriteBlocked.
- internal/proxy: event is exported as Event; AllowRule.
- internal/ui: OneLine, for VM-made values on one line of data.
- internal/vm: Env.Log; internal/cli/log.go.
- Messages: net_off_log, log_empty, log_failed.
- Tests: testdata/script/log.txtar (the three network.bats log cases),
netpolicy and proxy table tests; e2e network checks devvm log and
--blocked.
- Docs: network.md (Logs), commands.md (Network policy), CLI reference.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- backend.Backend gains Problems(ctx) []Problem (Key, Fix, Msg): all
that a backend needs and the host lacks. Check is the first of them,
so every command that needs the backend stops at the first one.
- Lima's Problems (check.go): host OS, arm64/amd64 (arch), macOS 13+
(macos, via sysctl kern.osproductversion: platform.MacOSVersion),
Lima missing/broken/older than 2.0 (lima; brew install/reinstall/
upgrade lima when Homebrew is there), on Linux qemu-system-<arch> and
qemu-img (qemu; apt-get, dnf, pacman or zypper's command), /dev/kvm
missing (kvm) or not openable (kvm-access; sudo usermod -aG kvm
USER), Lima's global configs (lima-config). DEVVM_KVM swaps /dev/kvm
for tests.
- devvm doctor [--backend NAME] [--fixes]: a features table (FEATURE,
one column per backend: native, emulated, unreviewed, none; Support
gains String), Docker found or not, then doctor_ok or each problem
(the last one fails). --fixes prints KEY<tab>FIX<tab>MESSAGE lines
and succeeds either way.
- Messages: lima_missing_fix, lima_broken_fix, lima_old_fix,
qemu_missing_fix, lima_arch_unsupported, macos_old, no_kvm,
kvm_access, docker_found, docker_missing, doctor_ok, doctor_failed;
kvm and ok are initialisms in the generator.
- Tests: TestProblems (23 cases), TestWriteFeatures, TestWriteFixes,
TestMacOSVersion, Support's String in TestSupport; doctor.txtar;
the script sandbox sets DEVVM_KVM; e2e images checks doctor.
- Converted: cli.bats preflight (arm64 and x86_64), doctor (macOS
without Lima, Linux without QEMU, x86_64 Linux, limactl that doesn't
run), the doctor half of "all there", doctor's half of the Lima
global configs case.
- Docs: new install.md (requirements, checking them, --fixes keys),
lima.md requirements, backends.md, commands.md, contributing.md,
README; CLI reference regenerated.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
devvm ls lists the project VMs on every backend, sorted by name: NAME,
STATUS, IMAGE (base (from node:24) for a --from base), GIT (on, off, or
clone for a --clone VM), NET (on, off, or unenforced: a failed
self-check, or running but not confined by devvm), BACKEND and FOLDER.
Images and build VMs aren't listed; a project VM named like an image is.
What a VM's state lacks is -. A backend that can't list fails ls only
when a VM's state names it.
- vm.List, netpolicy.Listed, state.VMNames
- messages: image_from, ls_failed
- bats cases converted: delete.bats "ls and the ssh config include a
project VM named like an image" (ls half), network.bats "ls shows
network policy: off, on, unenforced" and the ls check of the direct
route case (testdata/script/ls.txtar, Go table tests)
- e2e: ls checks in project and network
- docs: commands.md (Listing VMs), network.md, lima.md, CLI reference
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- devvm --version (and a hidden devvm version) prints the version alone:
the one release builds set with -ldflags -X .../internal/cli.version,
else Go's build info without the v, else (devel). No -v shorthand.
- devvm help [COMMAND], --help and -h stay Cobra's.
- devvm completion bash|zsh|fish prints Cobra's script (no powershell).
Completion offers image names after the +-joined parts given (base,
the toolchains, the user's layers, the agents), shared tools for
remove, backend names for --backend, all/none for --ports, and never
file names.
- Tests: version.txtar, completion.txtar, help cases in root.txtar;
TestJoined, TestVersionFromRelease, TestVersionFlagHasNoShorthand;
more exit codes in TestExecuteExitCodes; docgen tests know the
completion page and keep version and __complete out.
- Docs: commands.md "devvm itself" and "Shell completion"; the CLI
reference regenerated (devvm_completion.md, --version on devvm.md).
- Converted: cli.bats "doctor: all there; --version prints VERSION"
(its --version half; doctor waits for doctor). No messages added.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Full e2e (default and --from) on macOS and --from on a nested Linux
host, plus deadcode.
Fixes:
- ui: a logged command a signal ended (or exited 128+) waits up to 1 s
for devvm's own interrupt, so Ctrl+C that ends the command first no
longer prints its failure (seen on Linux in from.txtar's Ctrl+C case;
TestACommandEndedByTheSameSignalPrintsNothing, TestKilled).
- mise.toml: minisign only where it has builds (no linux/arm64), so
mise run works on arm64 Linux.
- up.txtar: the .git protection warning is checked in devvm's stderr,
not after stub_calls (it never matched on Linux, and macOS's negative
check was vacuous).
- up_size.txtar: a default memory of 5 GiB, not 16, which a 16 GiB host
reports as 15.
- qemu.txtar: "no real QEMU" no longer has /usr/bin on PATH, where Linux
hosts have QEMU.
- TestUp: its protector is macOS's, as its Env.
- e2e: pgrep patterns are [_]proxy (Linux's pgrep -f matched the check's
own shell: the proxy-gone check failed, the proxy-runs check passed
vacuously); a cached base's key comes from the fixture's chain, not
the newest record (another selection's base); base's features check is
counted as SKIP when base is cached, so runs compare their counts.
Deadcode removed: ui.Logged (callers use LoggedCmd; tests get a helper),
paths.rootOf (its tests now test resolve), tools.Lock.Tools (moved into
the tests). Kept for their commands: backend.Emulated,
state.WriteSize/WritePorts/WriteBackend/writeValue/ReadAgentKeys/
WriteAgentKeys, tools.Lock.Version, Tools.All, Tools.Garbage,
backendtest. New mise task: deadcode (x/tools v0.52.0).
Docs: testing.md (platform table, Linux host setup as verified, x86_64,
the manual check for an image only Docker has); contributing links it
and lists deadcode and SKIP.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
base runs its chosen features after layers/base.sh, in the order chosen:
devvm's own (features/<name>.sh next to the binary) and the user's
(~/.config/devvm/features/<name>.sh). The choice is in base-features and
in base's key; until there's a file, every feature counts.
The first build of anything asks which features base gets, every one
chosen to start with: an arrow-key (or j/k) picker in a terminal, showing
each script's second line; without a terminal, every feature. The choice
is saved and printed.
- build: Features (devvm's, sorted, then the user's; a user feature named
like a built-in one is ignored), FeatureScript, chosenFeatures
(selected_features), chooseFeatures (pick_features) run by Build and
Rebuild before any key; Inputs hashes the chosen features and the
user's folder; base's spec gets each feature's script, one without a
script skipped with a warning.
- image: FeatureName. ui: Pick and Choice (raw mode, hidden cursor,
control characters dropped from descriptions, Ctrl+C ends the run with
130).
- Messages: features_help, base_features, base_features_none,
feature_shadowed, unknown_feature; doc links to customizing.md.
- Copied: features/ (cli-tools.sh, fzf.sh, omb.sh), unchanged.
- Converted: images.bats user features (listing, shadowed, in base's key)
and build.bats step counts (two features and one skipped) as
features.txtar and Go tests (TestFeatures, TestDescription,
TestChooseFeatures, TestBuildRunsFeatures, TestPickKeys,
TestPickWithoutTerminal, TestPickCtrlC). Script tests start with an
empty base-features file.
- e2e: with from selected, base-features holds every feature; images
checks base ran base.sh and every feature, and takes base's key from
its build or the newest Ubuntu base (no longer a cached --from base);
from checks every feature in the node:24 and alpine:3 VMs.
- Docs: customizing.md (base image features); images.md, index.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
--from IMAGE (default $DEVVM_FROM) starts base from a Debian-, Ubuntu-
or Alpine-based container image instead of Ubuntu's cloud image, for new
VMs, build and rebuild. base is keyed by the image's digest, looked up
once per build and recorded per reference; existing VMs keep their own
(from_ignored).
- internal/from: ParseRef (registry_ref, with a fuzz target), Valid/
Check (bad_from), Pinned, Name, Recorded (from_digest), Registry.Digest
(manifest HEAD, anonymous Bearer token from an https realm only,
timeouts, size caps, retries; ErrUnreachable/ErrNotFound), Lookup.Refresh
(refresh_from_digest: registry, else Docker's ID, else the recorded
digest with a warning), DockerID, DockerRunning.
- build.Builder: From and Lookup; Inputs/Key/Chain with the recorded
digest; spec.From for base; records keep from and digest on every image
above a --from base; rebuild counters per from; building_image_from.
- lima: convert (oci_base): devvm-oci-build from Ubuntu's image with only
<tmp>/vm (rw) and oci/ (ro) mounted, confined to the internet, runs
oci/build.sh; docker save plus exportIs for images only Docker has;
checkConverted (regular files, gnu/musl, cmdline charset, raw ext4);
base created with --set .images (disk, kernel, cmdline, initrd); the
temp folder, build VM and the OCI build lock (lockOCI, pid, stale
takeover, oci_waiting) go however the run ends.
- cli/vm: global --from flag, state from=, builders with the VM's from in
open, update, remove.
- Messages: building_image_from, bad_from, from_ignored, from_unreachable,
from_not_found, from_cached_unreachable, from_cached_not_found,
no_digest, docker_only, exporting_docker, docker_export_failed,
docker_image_changed, oci_waiting, converting_in_vm, converting,
convert_failed, convert_bad_output; doc links to from.md.
- Copied: oci/ (build.sh and README edited: comment, docs link),
testdata/stubs/docker; limactl stub gains oci/build.sh outputs and
interrupt-on.
- Converted: from.bats (registry_ref, registry_digest token, 1/2,
https realm, refresh per tag, Docker-only, offline, no Docker, pinned,
moved tag, cached keys, build flow, docker save, Ctrl+C, steps, failures,
bad outputs, record, export check, lock) as Go tests and from.txtar;
oci.bats (libc_for, missing architecture, crane pins) as oci.txtar;
cli.bats --from parse_args and project.bats --from input checks.
- e2e: from section (--from tier, or --only from): node:24 Debian 12
node+python+claude, alpine:3 musl tools and Docker on OpenRC, base from
ubuntu:26.04, no Docker needed. Left out: features, an image only Docker
has.
- Docs: from.md; images, commands, lima, contributing, index; CLI
reference.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
rm on a clone VM now fetches the VM's unfetched branches into new local
branches, saved/<remote>/<branch>, and removes the remote fully with git
remote remove (its remote-tracking branches and upstream settings too).
Before removing it, any of the remote's remote-tracking branches with
commits no other ref has (fetched by hand, or with rm -f) are kept the
same way, in one update-ref transaction that never overwrites.
The prefix is saved/<remote>, else saved/<remote>-2 up to -99: the first
that no local branch is, is in or holds. Remote names devvm picks start
with devvm, so these never shadow a later VM's remote-tracking branches.
No free prefix: rm refuses before fetching (saved_names_taken), and at
deletion the remote stays (remote_kept). Branch names from the VM are
checked with git check-ref-format, passed only as argv, and shown
quoted; invalid ones are skipped (branch_names_invalid). The fetch uses
--no-tags. A branch counts as fetched only when a ref reaches its
commit, not merely when the object exists.
Inventory:
- vm: fetchUnfetched, validBranch, savedPrefix, quoted, saveFetched;
unfetchedRefs reads full refnames and checks reachability; removeRemote
saves, then git remote remove
- messages: branch_names_invalid, saved_names_taken, saved_branches,
remote_kept; fetch_before_delete and fetching take prefix;
removed_remote and unfetched_commits reworded. Doc links:
saved_names_taken, remote_kept
- tests: TestCloneRm (saved/devvm/main, no remote-tracking refs left,
a dangling commit unfetched), TestFetchUnfetchedInvalid,
TestSavedPrefix, TestRemoveRemote (unique branches saved under
saved/devvm-2, upstream gone, no free names keeps the remote);
clone.txtar: rm -f keeps fetched-only work as saved/devvm/main
- e2e: clone's rm -f check wants saved/devvm/main and no remote-tracking
branches
- docs: clone.md, commands.md
Co-Authored-By: Claude Opus 5.5 <[email protected]>
devvm --clone makes a VM that mounts nothing of the folder's: only the
shared tools and its agents' config folders. Once it runs, devvm makes a
repo at the folder's path in the VM (receive.denyCurrentBranch
updateInstead, HEAD on the host's branch), pushes every local branch
into it with host git over devvm's own ssh config (pinned host keys),
and adds a remote to the host repo (devvm, else devvm-<folder>, else the
VM's name), URL <vm>:<dir>. It offers the ~/.ssh/config Include line
(EnsureInclude's first caller), else says how to fetch until then, warns
about uncommitted changes, which aren't copied, and opens the shell in
the clone. No .git protection, set-id check or ssh remote hint for clone
VMs. A copy that fails is retried on the next launch. --clone on a VM
that mounts its folder is refused.
rm on a clone VM (not -f) starts it if stopped, lists branches whose
commits the host repo lacks (VM answers looked up only when they're
object names) and offers to fetch them into <remote>/*, then shows the
clone's uncommitted changes and asks before deleting; without a
terminal either refuses and keeps the VM. Deleting removes the remote's
config if it still points at the VM, keeping fetched branches.
Inventory:
- vm: clone.go (isClone, checkCloneRepo, seedClone, freeRemote,
remoteURL, cloneRmCheck, cloneGit, unfetchedRefs, removeRemote,
gitSSH, hostGit, capped); state keys mode, clone_remote, seeded;
Options.Clone; create skips the unsafe-folder check, the mount, .git
protection; setUp seeds unseeded clone VMs; open refuses
clone_needs_new_vm and skips Check/setid for clones; ensureRunning
(from export); Rm runs the clone check; delete removes the remote; the
interrupt cleanup removes it too
- cli: --clone on up; rm and root Long, rm -f's help
- messages: clone_needs_git, clone_not_top, clone_no_commits,
clone_detached, clone_needs_new_vm, copying_branches,
clone_seed_failed, remotes_taken, remote_add_failed, fetch_until,
uncommitted_not_copied, clone_ready, unfetched_commits,
no_terminal_fetch, fetch_before_delete, fetching, fetch_failed,
clone_check_failed, clone_dirty, no_terminal_delete, delete_anyway,
kept, removed_remote; unsafe_folder and git_protect_needs_macos_new
name --clone. Doc links: clone_not_top, clone_no_commits,
clone_detached, clone_needs_new_vm, remotes_taken, fetch_until,
no_terminal_fetch, no_terminal_delete
- tests: testscript clone.txtar (refusals, the new VM's mounts, state,
push, remote and clone; no reseed; rm clean, unfetched, dirty, -f, a
remote pointed elsewhere; a failed copy retried; clone_needs_new_vm);
Go TestUpClone, TestCloneRm (fetch yes/no, delete anyway, a stopped VM
started, VM answers that aren't object names), TestCheckCloneRepo,
TestFreeRemote, TestRemoveRemote. Stubs: limactl runs a clone's git
on $STUB_DIR/vmfs; new ssh stub pushes and fetches there
- converted: the bats suite has no clone cases besides cli.bats
parse_args, which waits for --from
- e2e: clone section (own HOME and git config, throwaway repo): clone
with every branch and only the tools mounted, shell in it, remote,
nothing locked, rm refusing unfetched commits and uncommitted
changes, fetch over devvm's ssh config, rm -f removing the remote and
keeping fetched branches
- docs: clone.md; commands, security, git-protection, ssh,
contributing, index; CLI reference
Co-Authored-By: Claude Opus 5.5 <[email protected]>
devvm opens a VM that exists instead of refusing it: unfinished VMs
(no state or no network choice) are refused before anything; --backend,
--network-policy, --no-git-protect, --cpus/--memory/--disk and --ports
are ignored with a warning each; an IMAGE naming what the VM lacks adds
it in place after asking (tools built and listed, a layer's script run
in the VM, new agents' folders mounted with a stop first); outdated
images and newer tools are warned about, the daily tools check runs,
agent folder mounts follow the host's, .git is checked per run, set-id
files are named on Linux, a stopped VM gets the size and ports its state
asks for (a running one is told they apply at its next start); then it
is started if stopped (a running VM with network policy keeps its
proxy), the self-check runs (a failure stops the VM), and it is set up
and its shell opened.
Commands: restart (stop, then open), update (newest shared tools, built
from base, then open), remove TOOLS (out of the image and tool list,
then open), adopt (a VM made for an earlier folder at this path, after
asking; .git protection restarts as appeared), rm [-f] (exports the
agents' history first unless -f, a failed export keeps the VM; a VM of
an earlier folder only after asking, without export; deletes the VM,
state, proxy, rules, run files, logs, .git locks, host keys and ssh
config entry, also when the delete failed but left no VM).
Inventory:
- vm: find/findExisting/existing, sameFolder, open, run, setUp,
warnIgnored, checkSetID, applySize, applyPorts, addLayers,
wantedImage, runScript, buildTools; Restart, Remove, Update, Adopt,
Rm, export, delete; start refuses vm_unfinished and stops a leftover
proxy for VMs without network policy
- gitprotect: Protector.Check (replaced, appeared, new submodules in
the tree and .git/modules, unlocked hooks, commondir, delegations on
change; locks only while stopped; unset protection set up as new),
Locked field; platform.Immutable
- tools.Update takes a build func; build.Builder.LayerScript exported
- cli: restart, remove, update, adopt, rm; withEnv; root Long
- messages: vm_other_folder (reworded), vm_other_folder_rm/_adopt,
delete_other_folder_vm, adopt_vm, vm_adopted, vm_already_here, no_vm,
vm_unfinished, backend/net/git_protect/ports_flag_ignored,
size_flags_ignored, size_next_start, ports_next_start, add_in_place,
restart_for_mounts, no_terminal_confirm, keeping, adding,
add_layer_failed, vm_is_now, exported, export_failed, deleted,
rm_failed, adopt_failed, git_replaced, git_appeared,
git_embedded_new, git_hooks_unlocked; net_unenforced_stop says devvm
starts it again confined; vm_exists removed
- tests: testscript existing.txtar, existing_agents.txtar; Go tests for
Check (five per-run reports, replaced/appeared, off/unset), open with
network policy, addLayers, Rm, Adopt, remove/update/restart; limactl
stub: delete-fails, Exec-fed scripts
- converted bats: delete (vm_unfinished, rm cleans up after a failed
delete, rm deletes only this VM), project (folder made again, update
twice, remove twice, five .git per-run reports), ports (applied once,
restart warning), size (restart warning), cli (rm forgets host keys)
- e2e: project (stop and relaunch, running relaunch, restart with host
keys, swapped .git, new submodule locked, rm unlocks; agent folder
added/removed on restart, rm exports history without logins), tools
(update, remove), network (relaunch confined, unenforced relaunch
stops it, rm -f)
- docs: commands.md (existing VM, adding, deleting, a folder made
again), coding-agents.md (mounts on launch, history), git-protection
(on each launch), images, network, security; CLI reference
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each running project VM can be reached as devvm-<folder> (or by its full
name when two folders share a name) through ~/.config/devvm/ssh_config,
which up rewrites after the VM's setup. Every entry checks the VM's own
host keys, kept in ~/.config/devvm/known_hosts and read from the VM
through its backend, and sets StrictHostKeyChecking yes, ForwardAgent no
(unless the VM forwards), and its own connection. Only Lima's login
options are copied. Host keys are dropped before each start, and when an
interrupted new VM is deleted, so they're read again.
Ported: write_ssh_config (sshconfig.Write), record_host_keys,
forget_host_keys (ForgetHostKeys, in vm start and the interrupt cleanup),
ensure_ssh_include (EnsureInclude: asks with [Y/n] on a terminal, else
says to add the line; no caller yet: --clone and devvm ssh/code),
ssh_alias (Alias), is_project_vm (project.IsVM), check_ssh_agent (vm
checkAgent, run when a new VM forwards the agent). Backend.SSH's
SSHTarget gains Options (Lima: identityfile, identitiesonly,
preferredauthentications, batchmode, compression, gssapiauthentication,
ciphers). Registry.All, state.WriteFile.
Messages: ssh_include_needed, ssh_include_yourself, add_it_now,
ssh_include_added, no_ssh_agent, ssh_agent_empty, load_key, key_loaded,
key_loaded_keychain, load_key_with. Doc links: ssh_remote_hint,
ssh_include_yourself.
Converted bats cases: cli.bats "ssh config: only running VMs, each with
its own host key checked; Lima's unchecked settings left out" (ssh.txtar,
lima TestSSH, sshconfig TestWrite; the rm half waits for rm),
delete.bats "ls and the ssh config include a project VM named like an
image" (ssh config half: ssh.txtar, TestWrite), project.bats "ssh_alias:
short name unless two folders share it" (TestAlias, ssh.txtar). New:
TestWriteUnchecked, TestParseHostKeys, TestEnsureInclude, TestCheckAgent,
TestIsVM. Stub limactl: Lima-like ssh.config at start, host keys from
shell, sshLocalPort/sshConfigFile in list.
e2e: project checks the hostname, the entry, pinned host keys, ssh
devvm-web through an ~/.ssh/config of the run's own (Include plus Host *
ForwardAgent yes), no agent forwarded (a throwaway agent), a changed host
key refused; network checks ssh devvm-net. Nothing touches the real
~/.ssh.
Docs: ssh.md (from the ssh page), linked from the index, commands,
security, images and contributing.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A new VM's setup now sends the whole of guest/sync.sh and its host
side, staged in memory: the hostname, timezone, UTF-8 locale and git
identity; the agents' config files (never their history), with their
folders mounted read-only at their host paths (one with a comma is left
out, with a warning); and the VM's tokens, as they are without network
policy (naming MCP servers whose secrets go too) or as its own
placeholders with it. With network policy it also sends devvm's CA, the
proxy's address (Backend.ProxyURL), the logins' copies with placeholders
and the agents' settings files with secret-looking values redacted (one
that can't be read that way isn't sent). UpdateAgentDirs keeps an
existing VM's agent mounts current through Backend.SetAgentDirs; its
caller comes with up for an existing VM. New docs page: coding agents.
Ported: sync_vm, agent_dirs, agent_files, agent_mounts,
update_agent_mounts, host_tz, claude_mcp_warn, the settings redaction;
guest/sync.sh copied whole (one comment edited).
Bats cases converted:
- project.bats: agent_mounts (one per line, names with spaces); the
four update_agent_mounts cases (Go table tests, plus a running VM
restarted once the user agrees)
- build.bats: sync_vm staging removed on failure, settings redacted
with network policy (testscript sync.txtar)
- guest.bats: the prompt, blocked since the last prompt, MCP servers'
merge (testscript guest.txtar)
- network.bats: claude_mcp_warn (sync.txtar, secrets Go test)
Deferred: guest.bats VS Code settings (ssh/code).
e2e: project gains agent folders and the VM's setup (mount read-only,
settings copied, history never, git identity, timezone, hostname, the
token without network policy); network becomes claude+codex and checks
the CA installed, the VM's own placeholder, the logins' copies and the
host's login files unchanged, with curl verifying TLS (no -k). Agent
folders on relaunch and restart wait for those commands.
Messages: agent_dir_comma, agent_dirs_added, agent_dirs_removed,
update_mounts, mounts_next_start, mounts_updated, no_claude_token,
claude_token_invalid, no_github_token, login_copy_failed,
config_redacted, config_not_copied, claude_mcp_secrets_copied;
sync_failed reworded.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A new VM can get network policy: --network-policy, else a question in a
terminal (no by default), else off. devvm makes its CA, writes the VM's
secret bindings, starts the VM's proxy (devvm _proxy, its password in a
file) and starts the VM confined to it, then runs the self-check before
the setup and the shell: a VM that isn't held to its proxy is stopped.
Tokens stay on the host; the hidden devvm secret get reads them for the
proxy, from the Keychain or a file. e2e gets a network section.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The network policy proxy moves into the binary as internal/proxy
(standard library only), run by the hidden devvm _proxy with its own
flags. Main returns errors instead of exiting, writes only to the
streams devvm hands it (the event log and data on stdout, its log
lines on stderr), and returns when the VM's hostagent is gone. The
connect mode is gone: devvm _qemu connect does that. Logins copied
as they are are warned about through ui.
Its tests come along, with a short run, fuzz targets for policy rules,
request targets and ClientHellos, a testscript, and the network page
of the docs for the proxy.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The toolchains and agents an image name holds (node, python, rust, go,
claude, codex, opencode) are shared tools: resolved per user into the
tools lock by devvm's pinned, checksummed mise, built once into
read-only EROFS images in a throwaway VM from base, and mounted into
every VM that names them. The lock is checked again daily, in the
background through devvm _refresh-tools, and before a new VM when due.
Copies tools/ and guest/tools.sh, and the shared tools part of
guest/sync.sh, which a new VM runs once it starts. e2e gains a tools
section.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
devvm [IMAGE] in a folder creates its VM: the folder checked (its path,
unsafe folders, a folder made again), its size and ports, the image
named or detected and built, cloned with only the folder mounted, its
state, .git hooks and config locked (macOS), started, then the backend's
shell in place of devvm. Network policy isn't there yet, so a VM is
created only with --no-network-policy; an existing VM is refused for
now. Ctrl+C before the first shell deletes the VM and unlocks .git.
Global flags: --backend, --network-policy/--no-network-policy, --cpus,
--memory, --disk, --ports; up's own --unsafe-folder, --no-git-protect.
tests/e2e.sh gains a project section, with Lima's Exec quoting checked
on a real VM. New docs: commands, security model, .git protection.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Once the image's VM exists, a failed start, script, sync or stop leaves
it stopped and without a record; the error says how to open a shell in
it with devvm's Lima home, and the next build deletes it. Ctrl+C, and a
failed create or clone, still delete it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
devvm build and devvm rebuild build base and the user's layers through
Backend.BuildImage. On Lima an image is a stopped instance: base from
Ubuntu's cloud image with base.yaml, a layer a clone of its parent, each
started confined with no host mounts, its script run, then stopped. Records
are written last; an interrupted or failed build deletes its instance
through the cleanup stack. Rebuild bumps the rebuild counter and deletes
stale images no VM uses.
tests/e2e.sh starts here, with its framework and an images section.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Lima backend behind backend.Backend: limactl on devvm's own Lima
home, run from devvm's data folder, refusing Lima's global configs and
networks devvm didn't set. Start confines VMs with a Seatbelt profile
(macOS) or the QEMU wrapper, devvm _qemu, with restrict=on and a
guestfwd to the proxy (Linux), tolerates degraded starts, and records
the hostagent for Confined. Clones with qcow2 overlays on Linux, size,
ports, mounts, agent forwarding and the ssh target. BuildImage comes
with the image build.
Adds NameMax and LoggedError to the backend package, a limactl stub,
the registry with lima as the default, and the Lima docs page.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
internal/ui is now the only package that prints: the message helpers,
prompts, tty detection, the status line, the run log (Logged, step
counts, proxy keys redacted) and ui.Main, which recovers Die, runs the
cleanup stack and handles INT/TERM/HUP (exit 130). main runs devvm
through it, and Cobra's errors print as one-line devvm errors.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
locales/en.toml holds every message; go generate ./internal/msg writes
one typed function per message. internal/msg renders them through a
go-i18n bundle in the user's language (LC_ALL, LC_MESSAGES, LANG), with
names mode (DEVVM_MESSAGES=names) and doc links. devvm _msg prints a
message's text. Tests check the generated file is current, every
message renders and is called, and every doc link exists; lint runs
the doc link check.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run testdata/script/*.txtar against a freshly built devvm, with HOME,
the XDG folders, the Lima home and the stub state in a sandbox under
/tmp, and testdata/stubs first on PATH. Add the stub_calls command,
uname and sw_vers stubs driven by env vars, scripts for the root
command and the sandbox, and README sections on writing CLI tests.
Co-Authored-By: Claude Opus 5.5 <[email protected]>