Skip to content

docs: polish CLI help text; introduce Options + Global Options panels#346

Merged
blainekasten merged 7 commits intonextfrom
help-text-suggestions
Apr 30, 2026
Merged

docs: polish CLI help text; introduce Options + Global Options panels#346
blainekasten merged 7 commits intonextfrom
help-text-suggestions

Conversation

@muhsinking
Copy link
Copy Markdown
Contributor

@muhsinking muhsinking commented Apr 27, 2026

Summary

  • Options panel (per-command): renamed the cyclopts default Parameters panel to Options via group_parameters=Group("Options", sort_key=100) on the root App — propagates to every subcommand.
  • Global Options panel (CLI-wide): single panel that holds --non-interactive, --json, --help, --version and propagates to every subcommand and sub-subcommand level. Replaces the prior split between Common Parameters (which held --non-interactive/--json) and a separate Parameters panel (which only held --help/--version at the root).
  • [default: X] rendering: extended the human help formatter (utils/_help_formatter.py) to append [default: X] from entry.default (which cyclopts auto-populates when a parameter has a concrete default). Suppresses noisy False/None/"" defaults so opt-in boolean flags don't get cluttered. Lets us drop most inline (defaults to X) parentheticals.
  • Model group hoisted in tg fine-tuning create -h via sort_key=0 — it's the primary mutually-exclusive decision (--model xor --from-checkpoint).
  • Beta Commands panel: dropped the ⚠️ from the title — the variation-selector glyph was breaking rich's box-drawing math, so the panel rendered with no borders. Title is now plain Beta Commands.
  • Help-text polish: tightened command and parameter descriptions across files, fine-tuning, models, endpoints, evals, telemetry, beta clusters, and beta jig. Removed trailing periods (and one stray mid-sentence period in --from-checkpoint), replaced "API commands" boilerplate with action-oriented summaries (e.g. Files API commandsUpload and manage files for fine-tuning, evals, and inference), shortened verbose flag descriptions in evals create and fine-tuning create, standardized (e.g.,(e.g..

Why "Options" and "Global Options" (not "Parameters" / "Flags")?

CLI terminology hierarchy:

  • Argument — anything passed to the CLI after the program name. Includes everything below.
  • Parameter — generic/formal term that includes both positional arguments and options. Cyclopts uses this internally for any input slot, which is why the help panel was originally titled "Parameters" / "Common Parameters" — but for a user-facing label it's too broad.
  • Option — a named argument that begins with - or -- (e.g. --api-key VALUE, --json). May or may not take a value.
  • Flag — informal term for the boolean subset of options (no value; --verbose, --no-color).

Mainstream CLIs (kubectl, docker, git, aws, cargo, gh) all use "Options" for the named-flag panel. "Flags" would also be defensible (and more precise for the global panel where all four entries are currently boolean flags), but "Options" stays correct if a value-taking global is ever added (e.g. --config PATH), and is the broader convention.

Follow-ups for reviewers (deferred functional work, not in this PR)

These were noted during the convention sweep but kept out of scope to keep the PR text-only:

  • Standardize negative=() policy across boolean params — currently inconsistent: jig.py boolean flags use negative=() to suppress --no-foo pairs, others don't. Pick one policy and apply uniformly.
  • Replace (must be >= 0) with cyclopts numeric validators in endpoints/create.py (MinReplicasParameter, MaxReplicasParameter).
  • Replace (required for X type) and the new "mutually exclusive with…" prose with cyclopts cross-parameter validators in evals/create.py — better error messages and the help text can simplify further.
  • The _NOISY_DEFAULTS = {"False", "None", '""'} filter in the formatter is a heuristic — if there's appetite, switch to honoring only Parameter(show_default=True) explicit opt-in instead.

Test plan

  • tg -h shows a single Global Options panel with all 4 flags and a properly framed Beta Commands panel
  • tg endpoints -h and tg endpoints list -h both show the same Global Options panel and an Options panel above it
  • tg fine-tuning create -h shows panels in order: ModelOptionsGlobal Options
  • tg --version, tg endpoints --version, tg endpoints list --version all print the version
  • tg endpoints list --json still routes the flag through to output
  • Spot-check [default: X] annotations on tg fine-tuning create -h (e.g. --n-epochs [default: 1], --packing [default: True])
  • Spot-check rephrased help text on tg beta clusters get-credentials -h, tg fine-tuning download -h, tg evals create -h
  • Render every command path: bash dump-help.sh then skim all-help.txt

🤖 Generated with Claude Code

@muhsinking muhsinking changed the title CLI: rename Common Parameters → Global Parameters, polish help text CLI: polish help text; rename Common Parameters → Global Parameters, Apr 27, 2026
@muhsinking muhsinking requested review from blainekasten and removed request for blainekasten April 28, 2026 03:53
@muhsinking muhsinking changed the title CLI: polish help text; rename Common Parameters → Global Parameters, fix: polish help text; rename Common Parameters → Global Parameters, Apr 28, 2026
@muhsinking muhsinking changed the title fix: polish help text; rename Common Parameters → Global Parameters, chore: polish help text; rename Common Parameters → Global Parameters, Apr 28, 2026
@muhsinking muhsinking changed the title chore: polish help text; rename Common Parameters → Global Parameters, docs: polish help text; rename Common Parameters → Global Parameters, Apr 28, 2026
@muhsinking muhsinking changed the title docs: polish help text; rename Common Parameters → Global Parameters, CLI: introduce Global Options panel, polish help text Apr 28, 2026
@muhsinking muhsinking changed the title CLI: introduce Global Options panel, polish help text docs: polish help text; Common Parameters -> Global Options Apr 28, 2026
@muhsinking muhsinking changed the title docs: polish help text; Common Parameters -> Global Options docs: polish CLI help text; introduce Options + Global Options panels Apr 28, 2026
@muhsinking muhsinking requested a review from blainekasten April 28, 2026 16:19
@muhsinking muhsinking marked this pull request as ready for review April 28, 2026 16:19
muhsinking and others added 6 commits April 30, 2026 14:12
In CLI terminology, "options" is the established term for named --foo
arguments (kubectl, docker, git, aws, cargo); "parameters" is generic
and formally includes positional arguments. Switching to "Global
Options" matches convention and stays correct if a value-taking global
is added later.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Rename the per-command `Parameters` panel to `Options` (matches the
  `Global Options` rename and aligns with kubectl/docker/git/aws CLI
  conventions).
- Hoist the `Model` group to the top of `tg fine-tuning create -h` via
  `sort_key=0` — it's the primary mutually-exclusive decision.
- Render `[default: X]` in the help formatter when cyclopts populates
  `entry.default`. Suppress noisy False/None/"" defaults so opt-in bool
  flags don't get cluttered.
- Drop inline `(defaults to X)` parentheticals; rephrase as
  `; uses X if unset` clauses.
- Trim long descriptions and split into `\n\n` paragraphs where
  appropriate.
- Standardize `(e.g.,` → `(e.g.` (dominant form in this codebase).
- Fix a stray mid-sentence period in `--from-checkpoint` and the
  trailing period on `tg files upload`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Fixes mypy no-untyped-def error.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@blainekasten blainekasten force-pushed the help-text-suggestions branch from e4eed1d to 4cf53f5 Compare April 30, 2026 19:13
@blainekasten blainekasten changed the base branch from main to next April 30, 2026 19:15
@blainekasten blainekasten force-pushed the help-text-suggestions branch from f51cc62 to cf6556e Compare April 30, 2026 19:54
@blainekasten blainekasten force-pushed the help-text-suggestions branch from cf6556e to e9953ae Compare April 30, 2026 19:59
@blainekasten blainekasten merged commit 4905c1a into next Apr 30, 2026
9 checks passed
@stainless-app stainless-app Bot mentioned this pull request Apr 30, 2026
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