Skip to content

Feat/cli ux overhaul - #12

Merged
KraHsu merged 3 commits into
mainfrom
feat/cli-ux-overhaul
May 14, 2026
Merged

KraHsu merged 3 commits into
mainfrom
feat/cli-ux-overhaul

Conversation

@KraHsu

@KraHsu KraHsu commented May 14, 2026

Copy link
Copy Markdown
Owner

No description provided.

KraHsu and others added 3 commits May 14, 2026 15:47
Bare `genelab` printed a single hint line, subcommand --help was sparse,
and extensions had no sanctioned channel to surface usage hints. This
reshapes the CLI surface without touching the play/train argv grammar.

- Replace the bare-invocation one-liner with a Rich landing page that
  shows Quickstart commands, grouped command list, and counts of
  registered robots, envs, and tasks.
- Add `genelab info NAME`: looks up a task/env/robot, renders
  description, env/robot/trainable meta, an overridable cfg-path table
  derived from the instantiated dataclass tree, and any examples the
  extension registered.
- Add an optional `examples: Sequence[str] = ()` kwarg on
  `register_robot` / `register_env` / `register_task`. Display-only
  strings; never executed or validated. Backwards compatible.
- Switch the Typer app to rich_markup_mode="rich" and group commands
  into Registry / Runtime / Project / Utilities panels. Document the
  full flag grammar (--vis/--gpu/--steps/--dt/--a.b.c VALUE, plus all
  RUNNER_KEYS) inside `play --help` and `train --help`.
- Project scaffold's generated `tasks.py` now ships an `examples=[...]`
  block so freshly created extensions get a populated `info` view.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Unitree G1 and inverted-pendulum tasks now register `examples=[...]`
so `genelab info TASK` shows ready-to-copy commands. Cover the typical
play / train shapes for each, including the required
`--env.commands.motion.motion_file` flag on G1 tracking.

Also drop `soft_wrap=True` on the Rich consoles: that flag actively
disables wrapping (allowing overflow), which truncated long example
lines inside the info panel at narrow terminal widths. With it off,
Rich wraps each example line at the panel inner width.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Typer's rich_markup_mode renders --flag tokens with ANSI escape codes
that split the leading dashes from the rest of the flag, e.g.
"\x1b[1;2;36m-\x1b[0m\x1b[1;2;36m-vis\x1b[0m". Locally pytest sees
no color, so "--vis" in out passes; in GitHub Actions FORCE_COLOR is
on and the literal substring is gone, breaking
test_play_help_documents_short_flag_grammar.

Strip CSI sequences before asserting, in both help-doc tests.
@KraHsu
KraHsu merged commit 4cefd91 into main May 14, 2026
3 checks passed
@KraHsu
KraHsu deleted the feat/cli-ux-overhaul branch May 14, 2026 08:51
KraHsu added a commit that referenced this pull request May 15, 2026
KraHsu added a commit that referenced this pull request Jun 5, 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.

1 participant