Skip to content

fix(cli): correct stale help text that contradicts actual behavior#418

Open
pstayets wants to merge 1 commit into
pilot-protocol:mainfrom
pstayets:fix/cli-help-text
Open

fix(cli): correct stale help text that contradicts actual behavior#418
pstayets wants to merge 1 commit into
pilot-protocol:mainfrom
pstayets:fix/cli-help-text

Conversation

@pstayets

Copy link
Copy Markdown
Contributor

The binary's embedded help text has drifted from the implementation in a number of places (the website docs already state the correct behavior — it is the CLI's own --help that is stale). This PR fixes the strings only; there is zero behavior change. Every item below was verified against the current code on main before editing, and each changed string was grepped across the repo (including tests) to confirm nothing depends on it.

  1. pilotctl quickstart --help claimed "it detects whether the daemon is already running and points you to the next action" → cmdQuickstart (cmd/pilotctl/main.go:1983) is a bare fmt.Print of a static banner. New text: prints a fixed 3-step cheat-sheet (DISCOVER, TRUST, TALK) and does not inspect daemon state. The pilotctl context catalog entry for quickstart repeated the same claim (plus a structured-returns shape the command never emits) and was corrected too.
  2. pilotctl updates --help: "--count <n> … (default: 5)" → cmd/pilotctl/updates.go:133 is flagInt(flags, "count", 10) (the doc comment above it already says 10). Help now says 10.
  3. pilotctl init --help: showed "--registry <addr> registry address (required)" → every flag in cmdInit (cmd/pilotctl/main.go:2010) is optional with a default (registry defaults to 34.71.57.205:9000), and the accepted --socket flag was undocumented. Help now marks flags optional with their defaults and documents --socket.
  4. pilotctl network --help: subcommand list omitted reject and role, both present in the dispatch (cmd/pilotctl/main.go:1835,1850). Added.
  5. network create: help showed positional create <name> → the command requires --name (cmd/pilotctl/main.go:7044: usage: pilotctl network create --name <name> …). Help aligned. The pilotctl context catalog entry additionally advertised nonexistent --managed / --policy <file> flags — replaced with the real flag set (--name, --join-rule, --token, --enterprise, --rules/--rules-file).
  6. pilotctl skills --help: listed only status|paths|check → the dispatch (cmd/pilotctl/skills.go:37-54) also handles set-mode|disable|enable. disable/enable require an argument and accept only all (skills.go explicitly rejects anything else: "only 'all' is supported; per-skill disable is not yet implemented") — now documented. The hardcoded toolchain list "(Claude Code, OpenClaw, PicoClaw)" was replaced with generic wording: the skillinject manifest is fetched at runtime from the pilot-skills repository, so the supported set is not fixed at compile time. Also fixed the skills disable success hint, which told users to run pilotctl skills enable — a form that errors out (skill id required).
  7. pilotctl trusted --help / top-level help showed bare trustedcmd/pilotctl/trusted.go:12 rejects everything except trusted list. Usage fixed to pilotctl trusted list (help text, top-level listing, and the context-catalog args).
  8. send-file help claimed a "256 MiB" frame cap → dataexchange.DefaultMaxFrameSize is 1 << 30 (1 GiB), overridable via PILOT_DATAEXCHANGE_MAX_FRAME within [64 KiB, 2 GiB). Help now says 1 GiB and mentions the accepted range.
  9. bench --help claimed timeout "default: 30s" → cmdBench (cmd/pilotctl/main.go) uses flagDuration(flags, "timeout", 120*time.Second). Help now says 120s. (traceroute's 30s claim was checked and is correct — untouched.)
  10. Gateway help: "requires root for ports <1024" → pilot-gateway shells out to ifconfig lo0 alias (darwin) / ip addr add (linux) to create loopback interface aliases (loopback_darwin.go / loopback_linux.go in pilot-protocol/gateway), which needs root regardless of port. New text: "requires root — creates loopback interface aliases". Daemon -dataexchange-b64 flag help said the base64 field is added "alongside data" → the dataexchange service's if/else (service.go:351) writes data_b64 in place of data. Fixed.
  11. Top-level pilotctl --help omitted dgram, which exists in the dispatch (cmd/pilotctl/main.go:1782) and has its own per-command help. Added to the Communication commands listing.

docs/cli-reference.md is regenerated via scripts/gen-cli-reference.sh (it is an auto-generated capture of pilotctl --help that CI checks for drift); its diff is exactly the top-level-help changes above.

Verification level: built locally with Go 1.26.3 — gofmt -l clean on touched files, go build ./cmd/... succeeds, go test ./cmd/pilotctl passes (12.9s, ok).

🤖 Generated with Claude Code

https://claude.ai/code/session_0142ryqVGEmJN66VZtCC7wFD

Every change is a string-only edit to embedded help/usage text (or the
machine-readable `pilotctl context` catalog) where the text contradicted
the implementation. Each was verified against the code before editing:

- quickstart: help claimed it "detects whether the daemon is already
  running" — cmdQuickstart is a bare fmt.Print of a static banner.
  Help (and the context-catalog entry) now describe the static
  3-step cheat-sheet.
- updates: help said --count default 5; cmdUpdates uses
  flagInt(flags, "count", 10).
- init: help marked --registry as required; every cmdInit flag is
  optional with a default (registry 34.71.57.205:9000), and --socket
  was undocumented.
- network: dispatch handles `reject` and `role` but help omitted both.
- network create: help showed positional `create <name>`; the command
  requires --name (also fixed the stale context-catalog args, which
  listed nonexistent --managed/--policy flags).
- skills: dispatch handles disable/enable/set-mode, which help omitted;
  disable/enable accept only `all` (per-skill is unimplemented); the
  fixed toolchain list was replaced with wording matching skillinject,
  whose manifest is fetched at runtime; the "To re-enable" hint printed
  a command form that errors out (missing `all`).
- trusted: cmdTrusted rejects everything except `trusted list`, but
  help/usage showed bare `trusted`.
- send-file: help claimed a 256 MiB frame cap; dataexchange
  DefaultMaxFrameSize is 1<<30 (1 GiB), env-overridable within
  [64 KiB, 2 GiB).
- bench: help said --timeout default 30s; cmdBench uses 120s.
- gateway: "requires root for ports <1024" — pilot-gateway shells out
  to `ifconfig lo0 alias` / `ip addr add` for loopback aliasing, which
  needs root regardless of port.
- daemon -dataexchange-b64: flag help said data_b64 is written
  "alongside" data; the dataexchange service's if/else writes data_b64
  in place of data.
- top-level help: `dgram` exists in the dispatch and had per-command
  help but was missing from the command listing.

docs/cli-reference.md regenerated via scripts/gen-cli-reference.sh
(it is an auto-generated capture of `pilotctl --help`; CI enforces it).

Verified: gofmt clean; go build ./cmd/... ok; go test ./cmd/pilotctl ok.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0142ryqVGEmJN66VZtCC7wFD
@pstayets
pstayets requested a review from TeoSlayer as a code owner July 23, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants