9 Commits
Author SHA1 Message Date
d349868c31 feat(agents): one definition per coding agent, and Cursor's CLI
Every list of the coding agents now derives from internal/agents'
registry, one Def each, and Cursor's CLI (cursor-agent) is a fifth
agent.

The registry:
- each agent's login command, login formats and capture on its Def;
  one message for every agent where each had its own
- the agents' table, the README's list and the docs' history lists are
  generated from the registry (cli.DocBlocks, TestDocBlocks); scripts
  and Go tests take their lists from it too
- each agent's own code lives in a file named for it; the structure
  test lets only an agent's own files choose by its name, following
  constants named after an agent
- a VM remade by clone on/off keeps no agent's login files
  (agents.LoginFiles from every Def.Logins; Claude Code's .claude.json
  stays, as it is also history)

Cursor's CLI:
- `devvm --agents cursor`, `devvm agent login cursor`, history import
  and export of ~/.cursor/chats
- the proxy captures its login at a GET endpoint, guards a shared host
  by path, and puts the login in only where the CLI sends it, bound to
  the CLI's 57 methods
- account changes and the agent store are refused in a VM; Cursor's
  headers and trailers are scanned for tokens
- e2e: Cursor's CLI in the network section, its poll behind the fake
  company proxy

Docs: the agents' pages lead with commands, with a How it works page
for the agents.

Co-authored-by: JB <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 11:49:48 -07:00
w3cjandClaude Opus 5.5 79b3ef94d4 refactor(cli): one backend: no --backend flag, no BACKEND column
devvm runs every VM on Lima, so the command line has no backend choice:

- --backend is gone from devvm, build, rebuild, images, images rm, gc,
  space, doctor and setup (addBackendFlag, addBackendFilterFlag, setup's
  own, checkFlagValue's case, its completion); a removed flag now fails
  as an unknown flag (exit 2).
- devvm setup no longer asks for or saves a default backend; config.toml
  and settings.json have no backend key (settings.KeyBackend, Values and
  Defaults' Backend, checkBackend, Value.With, Source.File, FromFlag).
- Tables lose BACKEND: ls, images (both tables), space (both tables);
  doctor's FEATURE table is FEATURE and SUPPORT for Lima. space's images
  row is freed by images rm.
- --json keeps every backend field (ls, images, tool records, space,
  doctor's backend, backend_source "built-in" and every backend's
  features).
- The registry keeps Lookup, For and Default: For(d, vm) gives a VM its
  recorded backend and a new VM NewVMs, else Default; tests set NewVMs.
  vm.Env's lookups lose the flag parameter, found.flagIgnored and
  Options.Backend.
- Messages removed: backend_unknown, backend_unknown_default,
  default_backend, backend_help, doctor_backend_from,
  backend_flag_ignored; backend_unknown_vm stays (a VM's recorded
  backend), linked to backends#a-vms-backend.
- Docs: Backends' choosing section becomes "A VM's backend"; settings,
  setup, images, gc, space, doctor, commands and install pages lose
  --backend and BACKEND; Contributing gains "How a backend plugs in".
- Tests: unit tests for For, settings, setup, doctor's table, the
  tables; CLI scripts check --backend as an unknown flag on devvm,
  build, restart, images, gc, space, doctor and setup, and a config.toml
  backend key as unknown; e2e's table checks lose the column.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 12:46:28 -07:00
w3cjandClaude Opus 5.5 a134e0d8a6 feat(cli): choose a new VM's toolchains, agents and layers in a picker or with --tools, --agents and --layers
devvm takes no IMAGE word any more than any other: in a terminal a new VM's
toolchains, coding agents and layers are checked in one picker, under three
headings, before the network-policy question; --tools, --agents and
--layers (each an exact list, or none) skip it, and a part left out takes
its default: the detected toolchains, devvm setup's agents, no layers (a
devcontainer.json's features still count). Without a terminal, or with
--no-input, the VM gets the defaults and new_vm_gets says so in one line.
devvm setup --agents (and its first-run question) chooses new VMs' agents.
devvm tools in a terminal opens the same picker for the VM, its layers
fixed, and turns the changes into tools add and rm.

An image is base and layers only: tools are the VM's tool_names state key.
build, rebuild and images rm refuse a shared tool (tool_not_layer), and
devvm build builds no tool images. devvm ls gains a TOOLS column and
--json tools. gc's --tools is --tool-images, so --tools has one meaning.

Gone: image.Reserved, checkWord's image half (devvm WORD is no_command or
no_command_like, did-you-mean over commands, msg.Closest), the lacks path
in internal/vm/existing.go, and the messages vm_lacks_tools,
vm_lacks_layer, layer_is_command, layer_name_command, no_image_for,
no_command_or_image*, tools_not_images, tools_not_images_rm, detected,
vm_is_now (vm_tools_now), secret_with_image (secret_with_claude).
New: ui.Pick takes headed sections with fixed rows, ui.CanPick,
vm.PickPart/PickRow/AgentsChoice/CheckPart (internal/vm/parts.go),
state.KeyToolNames, state.ReadAgents/WriteAgents, paths.Dirs.Agents,
project.DetectFiles. Image keys are unchanged in form: images never held
tools; docker.sh's and nix.sh's comments changed, so those layers rebuild.

Docs: the home page's quick start steps, diagram (sandbox.svg), cards and
FAQ; README; getting started; using (images' What a new VM gets, coding
agents' Running an agent, settings' agents); internals; contributing;
the cli skill; AGENTS.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 00:45:09 -07:00
w3cjandClaude Opus 5.5 ddbc377f8f test: testscript commands for the scripts' setup, and a coverage baseline per package
script_test.go's sandbox sets DEVVM_MESSAGES=names and DATA, VMS, RUN
and CFG by default, and adds stub_reset, catg (the one file a glob
matches), vm_name VAR NAME (the folder's VM) and project NAME [git];
script_cmds.txtar checks each. Every script is rewritten onto them, its
assertions kept; TestCommandLines leaves the scripts' own commands out.

mise run test runs scripts/test.sh: the tests as before, with the CLI
tests' devvm built with -cover for every package (CLI_GOCOVERDIR),
merged with the Go tests' counters by go tool covdata, then
scripts/coverage.sh holds each package to testdata/coverage/<os>.txt.
mise run coverage raises the baselines; coverage.txtar checks the
comparison. The macOS baseline is recorded from this tree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-02 14:25:09 -07:00
w3cjandClaude Opus 5.5 f9e14e9b37 feat(cli): usage errors as devvm messages, checked before anything runs, exit code 2
Every argument and flag error is a devvm message naming what the command
expected, followed by usage_help naming that command's own --help, and
exits with 2. Arguments and flag values are checked in Args, before the
root's PersistentPreRun and any VM lookup.

- internal/cli/args.go: noArgs, exactArgs, maxArgs, minArgs (argsN, with
  ValidArgs), argsOf (the arguments in Use), checkCommands (wraps every
  command's Args with checkFlags and marks RunE's errors as ranError),
  checkFlagValue (--cpus, --memory, --disk, --ports, --lifetime,
  --older-than), exclusive (flag groups checked first, then Cobra's own
  required flags and groups), flagError (SetFlagErrorFunc: pflag's
  NotExist, ValueRequired, InvalidValue, InvalidSyntax errors).
- Execute: 0, 1 for a failure (RunE's error: a message, or
  output_failed), 2 for a usage error; usage_error is only the fallback.
- Checked early: ports LIST and add/rm LIST (vm.ParsePortList), network
  allow/deny RULEs, network on/off(/ask with -g), layer new NAME
  (build.CheckLayerName), retention KEY=VALUE (state.CheckRetention),
  setup --features '', secret NAME, completion SHELL, git-protect and
  ssh-agent values.
- ui.UI.Error prints an error without ending the run (UI's method limit
  44).
- Messages: usage_help, arg_missing, args_too_many, args_none,
  arg_not_choice, no_subcommand, flag_unknown, flag_needs_value,
  flag_bad_value, flag_bad_switch, flags_exclusive, output_failed;
  usage_error reworded; doc links to troubleshooting.
- Tests: TestUsageErrorsEveryCommand, TestRanErrorIsAFailure, TestArgsOf,
  TestFlagErrors; txtars check message names; e2e checks a bad port list
  exits 2.
- Docs: troubleshooting (a command refused before it runs, exit codes),
  contributing (command arguments), AGENTS.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 02:27:57 -08:00
w3cjandClaude Opus 5.5 07ca65c098 feat(cli): devvm host, the tools noun and devvm history
devvm ssh is devvm host. devvm tools shows this folder's VM's shared
tools (TOOL VERSION NEWER BUILT, from the lock as it is, never online);
devvm tools add/rm TOOL... add and take out shared tools, each a word of
its own (joined with + refused: tools_joined; add takes only shared
tools: unknown_tool), and devvm tools update moves the VM to the newest.
devvm IMAGE on a VM that exists adds nothing and asks nothing: it fails
with vm_lacks_tools, naming the devvm tools add command, or
vm_lacks_layer, as only a new VM gets a layer. devvm export is devvm
history export [FILE]; devvm history lists the exports in the exports
folder (FILE VM FOLDER DATE SIZE), the folder from a <export>.folder
file written beside devvm's own exports and deleted with them. gc
--exports is gc --history, retention's exports.age/count are
history.age/count, and devvm space's row is history.

The in-place layer machinery goes: Launch.addLayers and runLayers,
dockerLayers' inPlace/set/unset, backend.DockerLayerVM.SetDockerLayer
and the Docker backend's SetDockerLayer, with the add_in_place,
restart_for_mounts, no_terminal_confirm, keeping, adding and
add_layer_failed messages. vm.Tools (tools.go) holds Add, Remove,
Update and List; tools.VMs.Show lists a VM's tools; tools.Remove takes
names as a list; VMs.Update compares a VM's files as a set.

New messages: vm_lacks_tools, vm_lacks_layer, has_tools, tools_joined,
history_failed, tools_failed; renamed: unknown_tool, gc_history,
gc_history_export, deleted_history, gc_older_than_needs_history.
Command files: host.go, tools.go, history.go, refreshtools.go
(_refresh-tools); ssh.go, remove.go, update.go, export.go and
gc_exports.go gone. Tests: TestImageLacks, TestToolsAdd, TestShow,
TestCompleteToolNames; history.txtar, gc_history.txtar, host_code.txtar
and the e2e tools, docker layer and host checks updated. Docs, the CLI
reference, AGENTS.md and the e2e header follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 01:27:24 -08:00
w3cjandClaude Opus 5.5 d3948f0933 test: CLI scripts expect the docs-voice wording of usage errors and qemu_refused
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 10:33:53 -07:00
w3cjandClaude Opus 5.5 b03293b7d7 feat(setup): devvm setup chooses base's features and the default backend
devvm setup asks which features base gets, starting from the current
choice (every feature until there's one; kept without a terminal), or
takes them from --features LIST without asking ('' for none), saved in
the features' run order. A name that isn't a feature is no_feature and
saves nothing. --backend NAME saves the default backend new VMs get
(~/.config/devvm/backend, read by the registry), checked against the
backends devvm has; alone, it leaves the features as they are.

A changed choice prints base_will_rebuild, and gc_old_hint once any
image record exists. base_features and base_features_none name devvm
setup. --features completes feature names, setup's --backend backend
names.

- build: PickFeatures, SetFeatures (the first build's choice goes
  through PickFeatures)
- state: AnyImage
- messages: no_feature, base_will_rebuild, gc_old_hint,
  default_backend, setup_failed
- tests: setup.txtar, completion.txtar; TestPickFeatures,
  TestSetFeatures, TestAnyImage
- docs: customizing.md (choosing features), backends.md (choosing a
  backend), the CLI reference

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 21:21:07 -06:00
w3cjandClaude Opus 5.5 6dd2bd730f feat(cli): version, help and shell completion
- 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]>
2026-10-24 15:52:27 -06:00