cli: rewrite help text for AI-driven discovery

Frontier models tend to discover a CLI by running --help, scanning
the Long description, and inferring the dominant workflow from the
examples. Today's banger help reads like a man page index — every
verb has a one-line Short and nothing else. This rewrites the
groups (banger, vm, vm workspace, image, kernel, system,
ssh-config) so each landing page answers "what is this for, what's
the 80% command, what comes next" in three to ten lines, with
runnable examples.

Also disambiguates the near-twin lifecycle commands so a model
reading the subcommand index can tell stop/kill/delete apart at a
glance:

  start    Start a stopped VM
  stop     Stop a running VM gracefully
  restart  Stop then start a VM
  kill     Force-kill a VM (use when 'vm stop' hangs)
  delete   Stop a VM and remove its disks (irreversible)

vm create / vm ssh / vm logs / vm show pick up Long descriptions
and examples for the same reason. No behaviour changes; help text
only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Thales Maciel 2026-04-26 15:02:08 -03:00
parent 41ced66a54
commit 35bfac3f13
No known key found for this signature in database
GPG key ID: 33112E6833C34679
6 changed files with 251 additions and 30 deletions

View file

@ -21,8 +21,31 @@ func NewBangerCommand() *cobra.Command {
func (d *deps) newRootCommand() *cobra.Command {
root := &cobra.Command{
Use: "banger",
Short: "Manage development VMs and images",
Use: "banger",
Short: "Run development sandboxes as Firecracker microVMs",
Long: strings.TrimSpace(`
banger runs disposable development sandboxes as Firecracker microVMs.
Each sandbox boots in a few seconds, gets its own root filesystem and
network, and exits on demand.
The most common workflow is one command:
banger vm run bare sandbox, drops into ssh
banger vm run ./repo ships a repo into /root/repo, drops into ssh
banger vm run ./repo -- make test ships a repo, runs the command, exits with its status
For a longer-lived VM, use 'banger vm create' to provision and
'banger vm ssh <name>' to attach. 'banger ps' lists running VMs;
'banger vm list --all' shows stopped ones too.
First-time setup, in order:
sudo banger system install install the systemd services
banger doctor confirm the host is ready
banger image pull debian-bookworm fetch a default image
Run 'banger <command> --help' for any subcommand. Run 'banger doctor'
to diagnose host readiness problems.
`),
SilenceUsage: true,
SilenceErrors: true,
RunE: helpNoArgs,
@ -46,7 +69,21 @@ func (d *deps) newDoctorCommand() *cobra.Command {
return &cobra.Command{
Use: "doctor",
Short: "Check host and runtime readiness",
Args: noArgsUsage("usage: banger doctor"),
Long: strings.TrimSpace(`
Check that the host has everything banger needs to boot guests:
required tools (mkfs.ext4, debugfs, dmsetup, ip, iptables, ...), KVM
access, daemon reachability, and per-feature preflight (NAT, DNS
routing, work-disk seeding).
Run 'banger doctor':
- after 'banger system install' to confirm the install took
- after upgrading the host kernel or banger itself
- when 'banger vm run' fails with an unclear error
Exit code is non-zero if any check fails. Warnings are reported but
do not fail the run.
`),
Args: noArgsUsage("usage: banger doctor"),
RunE: func(cmd *cobra.Command, args []string) error {
report, err := d.doctor(cmd.Context())
if err != nil {