Skip to content

fix(cli): each command group shows its help in the parent list #5456

Done

Description

@dan-petty

Problem Description

37 of 551 command-list entries in the devops help show no description. The help text exists, but the command list drops it.

Evidence (tree walk of release 0.129.1, 2026-11-13):

  • devops gh -h shows 9 of 14 entries with no text, for example gh label, gh milestones, gh project, gh issue, gh run and gh secret. Other empty entries: pr threads, argo cd, docs site.
  • Agents ran devops gh --help 698 times from 2026-10-16 to 2026-11-13 (Claude Code transcripts). An empty entry sends the agent to one more help request for the sub-group.
  • Cause: each sub-app gets its text in new_typer(help=HELP.gh.issue_app, ...), but app.add_typer(issue_app, name="issue") gives no help= (src/devops_cli/commands/gh.py, lines 133-142). Typer 0.28 then shows no text in the parent list. OTelTyper.add_typer (src/devops_cli/core/cli.py, line 236) is the one place that registers each sub-app.

Reproduction Steps

  1. Run uv run devops gh -h.
  2. See the entries issue, run, label and others with no description.

Expected vs Actual Behavior

Expected: each entry of each command list shows the first line of its help. Actual: 37 entries are empty.

Proposed Solution

  • Fix it in one place. OTelTyper.add_typer uses the help of the sub-app (typer_instance.info.help) when the caller gives no help=. First find why Typer 0.28 does not do this, and record it in the proposal ## Feasibility section.
  • Do not add help= at the 37 call sites, so that no text is written twice and the next add_typer call cannot drop it again.

Acceptance Criteria

  • A test (written first, fails on the base) walks the whole Typer tree and fails on an entry with an empty help line.
  • uv run devops ci fail-to-pass --base origin/main shows that the new test fails on the base.
  • Regenerate the command reference in the same pull request.
  • Measure in telemetry, 7 days after the release: help requests for a gh sub-group after a gh -h request go down (the help counter of the plain-help item, else the Claude Code transcripts).

Existing Tool Considered

Typer add_typer(help=...) and the sub-app's own info.help. No new tool. Cost to build (estimate): 0.08 M model input and output, and 1 hour. Cost to keep: near 0, with the tree test.

Related

#4833 (CLI usage tracker).

Alternatives check of 2026-11-23: in-use.
The repository already uses this tool.
Tool: fastapi/typer (https://github.com/fastapi/typer), MIT, last activity 2026-11-18, maintained.
Reason: Searches returned only unrelated pages, but the facts of fastapi/typer confirm the framework the CLI already uses. Typer renders the parent list and takes help= per add_typer, yet it does not fall back to the sub-app's info.help, so the one-place fix stays in the project wrapper.

Covers:

  • Renders each command group's entry in the parent help list
  • add_typer(help=...) sets the text of a registered sub-app
  • Sub-app help set once through new_typer(help=...)

Lacks:

  • No fallback from the sub-app's info.help to the parent entry
  • No single registration point: help= must repeat at each call
  • No check that every command-list entry has help text

Proposed design

Problem statement

37 of 551 command-list entries in the devops help show no description. The help text exists, but OTelTyper.add_typer registers each sub-app without its help. The change makes the wrapper use typer_instance.info.help when no help= is given, adds a tree-walking test, and regenerates the command reference. A follow-up issue measures the effect after release.

Acceptance criteria

Requirement: Sub-app help in parent list

Each command group that registers a sub-app without an explicit help SHALL show the sub-app's own help text in the parent command list.

Scenario: Register a sub-app with no help argument

  • WHEN a test builds an OTelTyper app, registers a sub-app whose help is set, and calls add_typer without help
  • THEN the parent help output lists the sub-app name with the sub-app's help text.

Requirement: Explicit help wins

An explicit help argument to add_typer MUST override the sub-app's own help text.

Scenario: Register a sub-app with an explicit help argument

  • WHEN a test calls add_typer with help text that differs from the sub-app's help
  • THEN the parent help output lists the explicit help text and not the sub-app's own text.

Requirement: Whole tree has help

Every entry in every command list of the devops CLI SHALL have a non-empty help line.

Scenario: Walk the full Typer tree

  • WHEN a test walks every group and command from the root app and inspects each command-list entry
  • THEN the test reports no entry with an empty help line.

Requirement: Fail on base

The new tree-walking test MUST fail on the base revision and pass on the change.

Scenario: Run the fail-to-pass check

  • WHEN the command uv run devops ci fail-to-pass --base origin/main runs the new test
  • THEN it shows that the new test fails on the base revision and passes on the change.

Requirement: Command reference regenerated

The generated command reference MUST include the help text of each command group.

Scenario: Run the docs check

  • WHEN the command uv run devops ci --check --only docs runs after the command reference is regenerated
  • THEN the check passes and the command reference shows a help line for each command group.

Existing Tool Considered

fastapi/typer has the verdict in-use. The alternatives check in the issue body gives what the tool covers and lacks. The proposal closes the gap in the project wrapper. OTelTyper.add_typer forwards typer_instance.info.help when no help= is given. A project-side tree test enforces the result. The wrapper and test cost about 0.08 M model tokens and 1 hour to build, and near zero to keep.

Key questions

  • Why does Typer 0.28 show no help for a sub-app in the parent command list?: Typer takes the parent-list text from the help= argument of add_typer. The project passes no help= at most call sites, so the registered group has no help. The sub-app text stays only in typer_instance.info.help. [sources: src/devops_cli/commands/gh.py:133, src/devops_cli/core/cli.py:236]
  • Where should the fix use the sub-app help?: Fix OTelTyper.add_typer in src/devops_cli/core/cli.py. When help is None, pass typer_instance.info.help to Typer. Do not edit the 37 call sites. (best practice) [sources: src/devops_cli/core/cli.py:236, src/devops_cli/commands/gh.py:133]
    • Chosen: Fix the OTelTyper.add_typer wrapper. It is the one registration path and it prevents a later add_typer call from dropping the text.
    • Rejected: Add help= at each call site. It writes the same text twice and a new call site can omit it again.
    • Rejected: Upgrade Typer. The alternatives check says Typer 0.28 lacks the fallback; the project wrapper closes the gap without a dependency change.
  • How should the change test that no command-list entry is empty?: Add one test that walks the full Typer tree from the root app. It fails on the first command-list entry whose help line is empty. Use uv run devops ci fail-to-pass --base origin/main to show it fails on the base. (best practice) [sources: src/devops_cli/core/cli.py:236, tests/core/test_telemetry_deduplication.py]
    • Chosen: One tree-walking test. It covers every current and future registration in one place.
    • Rejected: A test for each of the 37 entries. It repeats the same check and misses new entries.
    • Rejected: No new test. It cannot show that the base is broken or that the fix holds.
  • Must the command reference be regenerated in the same pull request?: Yes. docs/CLI_REFERENCE.md is a generated document. The pull request that changes its source regenerates it. The docs check refuses a stale copy. (best practice) [sources: CONTEXT.md, docs/CLI_REFERENCE.md]
    • Chosen: Regenerate in the same pull request. The project requires the generated document to match its source in the same change.
    • Rejected: Regenerate in a later pull request. The docs check would refuse the change while the reference is stale.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/cli
    status/new
    value/medium
    effort/low
    on Nov 13, 2026
  2. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 13, 2026
  4. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Alternatives check: in-use

    Reason: Typer, the CLI framework the issue already names, provides the whole mechanism: add_typer(help=...) puts text on each entry of the parent command list, and the sub-app's own help is readable as typer_instance.info.help. The gap is only in the project's OTelTyper.add_typer wrapper, which can pass that value in one place, so no new tool or library is needed.

    The repository already uses this tool.

    Tool: fastapi/typer (https://github.com/fastapi/typer)

    • License: MIT
    • Last activity: 2026-11-15
    • Maintained: yes

    Covers:

    • add_typer(help=...) displays a help line for each sub-app in the parent command list
    • The sub-app's help text is exposed as typer_instance.info.help, so one wrapper can supply it for all registrations
    • Already the project's CLI framework, so the fix needs no new dependency

    Lacks:

    • Typer 0.28 does not automatically fall back to the sub-app's info.help; the project wrapper must pass it
    • The tree-walking test that fails on an empty help entry is project-side work, not provided by the library

    Tools considered:

    Searches run:

    • typer add_typer sub-app help not shown in parent command list, results: 5
    • typer 0.28 add_typer help parameter info.help propagate, results: 5
    • "add_typer" "help" typer github issue subcommand description missing, results: 5
    • typer Typer.add_typer documentation help parameter, results: 5
    • fastapi typer github repository, results: 5
    • Typer CLI framework subcommands help text, results: 5
    • Typer python, results: 5
    • click python command group help description, results: 5
    • hishel HTTP cache, results: 5
    • cogapp python generated blocks, results: 5

    Sources:

    Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.

  5. added
    status/ready
    and removed
    status/new
    on Nov 18, 2026
  6. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at b466159 (see proposed design in issue body).

    Moved to new items: #6236.

  7. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 29, 2026
  8. removed
    status/in-review
    owner/agent
    on Nov 29, 2026
  9. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-29 16:50 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/clisource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions