5 Commits
Author SHA1 Message Date
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 ee06f051ff refactor(msg): remaining messages in the docs voice
Rewrites the messages outside the prompt, network policy, secrets, project folder, .git, --clone, backend, host, image, build and shared tool groups (agent_, ssh_, ports_, size_, disk_, vm_, no_, devcontainer_ and the rest) as full sentences: what happened first, then one action as a command, without chained colons and semicolons. Status steps and short ==> result lines stay as they are, and every template keeps its fields.

Adds doc links for the actionable warnings and errors that had none: no_devcontainer_flag_ignored, no_ssh_agent, ssh_agent_empty, load_key_with, no_vm_ssh_agent, agent_key_not_found, agent_load_failed, agent_start_failed, mounts_next_start, no_feature, no_image_named, no_image_named_from, not_an_image, no_vm, no_vm_size, no_vm_ports, no_vm_git_protect, no_vm_policy, no_token, bad_secret_service, start_failed, stop_failed, delete_failed, vm_create_failed, sync_failed and pack_failed.

msg_unknown's wording is checked by TestValuesAsGiven and msg.txtar, which follow it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 10:26:23 -07:00
w3cjandClaude Opus 5.5 e182e3787a feat(ui): output helpers, spinner, run logs and cleanups
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]>
2026-10-24 02:27:59 -06:00
w3cjandClaude Opus 5.5 13b9afa59e feat(msg): generated typed messages with go-i18n
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]>
2026-10-24 01:42:46 -06:00