claudebox help is a sed of its own header, and the flags it advertises are not real
#8
Labels
No labels
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-triage
ready
release
scope:cli
scope:drill
scope:host
scope:installer
scope:templates
scope:tiers
stale
state:addressing
state:bots-reviewing
state:building
state:needs-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: heavy-duty/box#8
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
claudebox helpis eight lines of comment scraped out of the script's ownheader, and the CLI around it doesn't honor the conventions every other
command-line tool does. A first-time user (my co-founder, this week) can't find
out what the tool does, and — worse — several things the CLI appears to offer
don't exist.
The help itself
It is a
sedof its own source.bin/claudebox:89:Hard-coded line numbers against the header comment. Add a line to the top of the
file and the help silently truncates or starts printing
set -euo pipefail.It has no structure. No
NAME/SYNOPSIS/COMMANDS/OPTIONS/EXAMPLESsections. Commands are smashed together asshell|down|start|status|rm <box>, so nothing says whatdowndoes (stop, keeping state) or how it differsfrom
rm(irreversible). The flags are the worst of it:--remote,--vm,--containerand--forceappear only inside a synopsis line, and are neverexplained anywhere — not in the help, not in the README.
There is no
-h/--help.claudebox --helpworks only by accident (itfalls through the catch-all). Per-command help doesn't exist at all:
--helpgets swallowed as a positional arg and you get an error, not help.There is no
--version. The installer says "re-run any time to upgrade" andgives you no way to tell what you're on.
The CLI contract around it
These are the things that actually cost my co-founder time — the help is only
half the problem, because parts of the interface it would be documenting
aren't real.
Typos exit 0. Any unknown command hits
help|*), prints help, and returnssuccess.
claudebox lst,claudebox delete work,claudebox list— all"succeed". A script can't detect it and a human reads a wall of help as though it
were output.
Unknown flags are swallowed as positional args. The parser's
*)arm pushesanything it doesn't recognize into
args, so a typo'd flag becomes data:No "unknown flag" error anywhere.
--forceis dead — andrmforce-deletes regardless. The flag is parsed andnever read; shellcheck flags it (
SC2034: force appears unused):So
claudebox rm workimmediately destroys a running box, with noconfirmation — while offering a
--forceflag that implies the bare form isthe careful one. The README calls
rm"irreversible; snapshot first". This isthe one that loses work.
Proposal
Rewrite the help to the standard shape, and make the interface it describes true.
usage()function (no self-sed):NAME,SYNOPSIS,COMMANDS(one line each, describing behavior),OPTIONS(everyflag, explained),
EXAMPLES(the fresh-box and snapshot→clone flows),EXIT STATUS, and a pointer to the isolation/creds-free model.claudebox help <cmd>andclaudebox <cmd> --helpprint a focused page — description, flags that apply, examples.
-h/--helpaccepted anywhere;--version/-Vprints the version.near-miss command. Unknown flags are rejected instead of silently becoming
arguments (
--still passes everything through forexec).--forcereal — ⚠️ behavior change:rmconfirms before deleting(
y/N) when attached to a TTY;--force/-fskips the prompt; with no TTYand no
--forceit refuses and exits 2 rather than destroying a box in ascript. Also fixes per-command usage strings (e.g.
execcurrently reportsusage: claudebox exec <box>, omitting-- <cmd...>).SC2034,SC2015) so thescript lints clean.