Skip to content

refactor(help): reorder by value, add per-command help, fit 80 columns - #28

Merged
colevels merged 1 commit into
mainfrom
help-ux-reorder
Jul 19, 2026
Merged

refactor(help): reorder by value, add per-command help, fit 80 columns#28
colevels merged 1 commit into
mainfrom
help-ux-reorder

Conversation

@colevels

Copy link
Copy Markdown
Owner

Why

tabbrew --help listed ACCOUNT → DOCS → TABS → SETUP — the product's purpose buried in third place, onboarding last, matching neither what do I do first nor what do I do most. Inside TABS the commands ran check → push → serve → list, but the workflow is serve → list → check → push.

Three other things were wrong once I looked:

  • No per-command help. src/index.ts:54 short-circuited on values.help before dispatch, so tabbrew tabs push --help dumped the entire global listing. The registry already held every command's summary and flags — the data was there, unused.
  • Rows past 80 columns. init's row was 89 chars, tabs check 86, one flag summary 82, six env rows over. They wrap on a standard terminal, which reads as broken output rather than a long sentence.
  • help --all had no hierarchydocs push: printed at the same indent as its own flags, so it didn't read as a heading.

What changed

Groups ordered by value, onboarding moved to a footer — the split gh/docker use. The top of the screen stays useful for the returning user who just wants a command name; the first-run path is still spelled out.

TABS  organize your Chrome tabs
  tabs serve   →  tabs list  →  tabs check  →  tabs push       (workflow order)
DOCS  send HTML into the sidepanel
ACCOUNT   login → whoami → logout
SETUP     init, update, help

GETTING STARTED
  tabbrew init        teach your AI agent that this CLI exists
  tabbrew login       sign in to your TabBrew account
  tabbrew tabs serve  run in a 2nd shell; the extension sends your tabs over

A third help view. --help now resolves through findCommand before dispatching, so tabbrew tabs push --help and tabbrew help tabs push print one command. A new optional details field on CommandSpec carries the caveat a one-line summary has no room for:

$ tabbrew tabs push --help
Send a script to the extension to preview & run

USAGE
  tabbrew tabs push <file> [options]

OPTIONS
      --port <n>  Port `tabs serve` is listening on (default 49227)

Requires `tabbrew tabs serve` to already be running. This does not run the
script: it lands in the extension's panel and you click Run there. Nothing the
CLI does can change your tabs.

Bare --help, help, help --all, and an unknown command all still fall through to the full listing.

80 columns, enforced. Summaries tightened, the budget encoded as SUMMARY_MAX, and the long form moved into details so nothing is lost. New src/registry.test.ts renders all three views and fails on any line over 80 — plus group integrity and findCommand's two-word precedence, which the dispatch change now depends on.

help --all — flags indent under a bold command name; CREDENTIALS becomes a FILES table that also names tabs.json.

Verification

  • bun run typecheck clean; bun test 20 pass / 0 fail
  • Every help view measured ≤ 80 cols with NO_COLOR=1 … | awk '{print length}'
  • tabbrew docs push --port 9 still errors (the assertFlagsAllowed gate is intact), tabs list --json still routes, --version unchanged
  • bun run build && ./dist/tabbrew tabs serve --help — verified through the compiled path, since help is bundled at compile time

No behavior change outside help rendering: no new flags, no route changes, registry.ts still the single source of truth for all three views.

🤖 Generated with Claude Code

The help screen listed ACCOUNT -> DOCS -> TABS -> SETUP, which buried the
product's purpose in third place and onboarding last, and it matched neither
"what do I do first" nor "what do I do most". Within TABS the commands ran
check -> push -> serve -> list, but the workflow is serve -> list -> check ->
push.

Reorder the groups by value (tabs lead) and move onboarding into a GETTING
STARTED block at the foot, the split gh/docker use: the top of the screen stays
useful for the returning user who just wants a command name, and the first-run
path is still spelled out.

Add a third help view. `values.help` short-circuited before dispatch, so
`tabbrew tabs push --help` printed the entire global listing; resolve through
findCommand first and render just that command. A new optional `details` field
carries the caveat a one-line summary has no room for -- that `tabs push`
cannot run anything, that `tabs serve` blocks, that `update` refuses in dev.

Three command rows, ten flag summaries and six env rows ran past 80 columns and
wrapped, which reads as broken output rather than a long sentence. Tighten them,
encode the budget as SUMMARY_MAX, and pin it: registry.test.ts renders all three
views and fails on any line over 80, alongside group integrity and
findCommand's two-word precedence, which the dispatch change now depends on.

In `help --all`, flags now indent under a bold command name instead of sitting
at the same level as it, and CREDENTIALS becomes a FILES table that also names
tabs.json.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@colevels
colevels merged commit 63fd336 into main Jul 19, 2026
1 check passed
@colevels
colevels deleted the help-ux-reorder branch July 19, 2026 20:04
@colevels colevels mentioned this pull request Jul 19, 2026
colevels added a commit that referenced this pull request Jul 19, 2026
VERSION is read from package.json at compile time (ui.ts), so this bump is what
makes `tabbrew update` see a newer build. Ships the reworked help (#28).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant