Skip to content

fix(patchy): help describes every argument and marks required flags - #681

Merged
allisonmahmood merged 1 commit into
mainfrom
fix/590-cli-help-metadata
Oct 15, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
fix/590-cli-help-metadata

Conversation

@allisonmahmood

Copy link
Copy Markdown
Owner

patchy --help left 26 arguments and flags across 13 commands with no description, or only Effect's generated (choices: …). It also never said a flag was required: patchy look publish --help showed --note string Why this revision, such as darker green with no sign the parser requires it. Effect's default formatter marks optional arguments but ignores FlagDoc.required. Agents are told to read --help, so they had to guess.

Fix

  • Descriptions. Every argument and flag on every listed command now has a one-line description, written from its handler and matching the README's "Command flags" wording. --force is one shared forceFlag across publish, delete, retire and restore, so its text can't drift between them. init --purpose and delete --yes say in prose that agent, --json and non-terminal calls need them; the parser still treats them as optional.
  • (required). The entrypoint's CliOutput formatter wraps the default formatHelpDoc and appends (required) to flags where FlagDoc.required is true. That mirrors Effect's (optional) on arguments. Command metadata isn't touched, and optional flags render as before.
  • README. The --tier line now reads 0|1|2.

Parse-error output is unchanged. Usage still prints on stdout, as ADR-0004 records, and stderr's one line is Missing required flag: --note with exit 1 (the JSON envelope under --json).

Tests

  • help.test.ts walks every command reachable from patchy --help in-process (Command.runWith(root) under a capturing CliOutput layer). It fails when an argument or flag (global flags included) is undescribed or only has choices text, or when a command's help isn't captured. It also checks that look publish --note is the only parser-required flag. Run against the old commands.ts, it fails listing exactly the 26 gaps from the issue.
  • One cli.test.ts case runs the built CLI. look publish --help shows the dir description and --note … (required). look publish ./x exits 1 with the one-line error on stderr, usage on stdout and the JSON envelope under --json.

By hand, against the built CLI

Before:

$ patchy look publish --help
ARGUMENTS
  dir string    

FLAGS
  --note string    Why this revision, such as darker green

$ patchy init --help
ARGUMENTS
  dir string     (optional)

FLAGS
  --tier choice       (choices: 0, 1, 2)
  --purpose string    

After:

$ patchy look publish --help
ARGUMENTS
  dir string    The look folder to publish

FLAGS
  --note string    Why this revision, such as darker green (required)

$ patchy init --help
ARGUMENTS
  dir string    Directory for the new repo; defaults to the current directory (optional)

FLAGS
  --tier choice       Runtime tier for the new repo; defaults to 1 (choices: 0, 1, 2)
  --purpose string    What this patch is for; required for agent, --json and non-terminal calls; otherwise prompted

$ patchy delete --help
FLAGS
  --patch string    Delete this patch by ID instead of by file
  --yes             Confirm deletion without prompting; required for agent, --json and non-terminal calls; does not imply --force
  --force           Accept the reported dependant or source breakage; ask the person first

$ patchy look preview --help
FLAGS
  --compare    Show the candidate beside the company's current look

$ patchy look publish ./x; echo "exit $?"
…usage on stdout…
Missing required flag: --note        # stderr
exit 1

$ patchy look publish ./x --json      # stderr
{"ok":false,"error":"Missing required flag: --note","kind":"local"}

I also read patchy --help, login, add, describe, share, rollback and dev --help; every row is described. None of these commands needs an instance, so I didn't start pnpm dev up.

Surfaces

  • CLI: help text and the README's --tier line. No exit code, flag or error shape changed, so ADR-0004 stands. The global and project skills don't quote help output.
  • Wire contract, dev loop, vocabulary, migrations, company resources, served pages, reverse states and repo layout: not touched.

Closes #590

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

@github-actions github-actions Bot added area:cli Touches the cli area area:docs Touches the docs area size:m 100-500 changed lines labels Oct 15, 2026
Every argument and flag on the listed commands now carries an authored
description, and the entrypoint's help formatter appends `(required)` to
flags the parser requires, as Effect marks optional arguments. The README
lists init's --tier as 0|1|2.

Closes #590

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood force-pushed the fix/590-cli-help-metadata branch from 03fe81a to c328d1e Compare October 15, 2026 16:59
@allisonmahmood
allisonmahmood merged commit 6ce3b9d into main Oct 15, 2026
13 checks passed
@allisonmahmood
allisonmahmood deleted the fix/590-cli-help-metadata branch October 15, 2026 17:10
allisonmahmood added a commit that referenced this pull request Oct 16, 2026
…u when they fail (#720)

Release 13's What's new entry, written from `c9b8fc4`, ahead of
deploying it. `patchy` and `CURRENT_RELEASE` move to `0.13.0`, so CLIs
and patch repos installed before this deploy are told to upgrade.

| Change | PRs |
| --- | --- |
| New: Home puts the patches you use first | #713, #716, #719 |
| New: Every patch in one list | #715 |
| Improved: Each patch's page leads with Open | #717 |
| New: See when your tools are failing | #718 |
| Fixed: Everyone has a name | #687 |
| Improved: Your company's look is easier to get right | #697, #696,
#703, #688 |
| Improved: Forms follow your look's error states | #691, #692 |
| Improved: Clearer answers when a publish goes wrong | #686, #685, #689
|
| Fixed: Your agent's Patchy commands are steadier | #695, #704, #680,
#681 |
| Behind the scenes: stricter checks on static pages and tools' database
requests; malformed requests are logged | #682, #693, #683 |
| Behind the scenes: usage numbers count every publish, sharing change
and restore | #698, #699, #700, #690 |
| Test and tooling only, no line | #705, #702, #701, #694, #684, #607 |

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:cli Touches the cli area area:docs Touches the docs area size:m 100-500 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(patchy): CLI help leaves arguments and flags undescribed and never marks required flags

1 participant