Repository navigation
Description
Problem or Motivation
Agents read devops help very often, and the Rich help boxes make each reply 2 to 4 times larger than the text in it.
Evidence:
- Claude Code transcripts, 2026-10-16 to 2026-11-13: 6,169 help requests (
-h,--help) from 1,881 of 3,911 agents in 131 sessions. They returned 15.0 M characters. The most-read pages:pr create --help748,gh --help698,openspec --help446,ci --help392,ci fail-to-pass --help361. - 447 of 1,258 usage errors had a help request in the next 3 calls.
- Measured on 2026-11-13, release 0.129.1, same words in both forms (leaf commands):
| Command | Rich bytes | Plain bytes | Words |
|---|---|---|---|
pr create -h |
3,915 | 1,796 | 290 |
roadmap intake -h |
5,448 | 2,985 | 351 |
pr describe -h |
2,856 | 946 | 137 |
ci fail-to-pass -h |
1,793 | 706 | 106 |
- A group page loses facts in plain Click form. Click cuts each command description to the first sentence and to the formatter width (80 columns), and adds
....devops roadmap -hshows 1,189 words in Rich form and 476 words in plain form, with 17 cut entries.devops ci -hhas 18 cut entries. A widermax_content_widthremoves the...cuts, but Click still keeps only the first sentence. With the full first paragraph kept, a group page is about 1.6 times smaller than the Rich page, not 6 times. src/devops_cli/core/caller.py(is_agent_caller()andagent_tool()) already finds an agent caller.src/devops_cli/entry.pyruns before Typer is imported, so it can setTYPER_USE_RICH.
Proposed Solution & Architectural Design
entry.pysetsTYPER_USE_RICH=0before the Typer import whenis_agent_caller()finds an agent caller and the user did not set the variable. Help and usage-error text then come out as plain Click text. Person output does not change.UsageTaggedGroup, the base class of each group insrc/devops_cli/core/cli.py, writes the command list of a group with the full first paragraph of each command help, and with no width cut. So the plain page holds every word of the Rich page.- The root group class
UsageRecordingGroupcounts each help request in a new counterdevops_cli_help_requests_totalwith the labelscommand_path(the closed command tree) andcaller(the caller kinds of feat(telemetry): record each CLI usage error by name and kind #4839). Today help requests are counted only from local transcripts. - Find and fix each parser of the Rich usage-error box in the same pull request (tests,
docs/generator.py).
Target Subsystem
SDLC, Git & PR Governance (the CLI root: entry.py, core/cli.py, core/caller.py).
Acceptance Criteria
- A test (written first, fails on the base) runs
devops roadmap -hwith an agent marker and proves that the output holds no box character and that each command line holds the full first paragraph of its help, with no...cut. - A test proves that a person caller (no agent marker) still gets the Rich help.
- A test proves that
TYPER_USE_RICH=1set by the user wins over the agent default. - A test proves that a help request adds 1 to
devops_cli_help_requests_totalwith its command path and caller. -
uv run devops ci fail-to-pass --base origin/mainshows that the new tests fail on the base. - Measure in telemetry, 7 days after the release:
devops_cli_help_requests_totalfor agent callers, per 1,000 commands. The median help bytes of agent callers in the transcripts go down by 1.5 times or more.
Existing Tool Considered
Typer's TYPER_USE_RICH switch (Typer 0.28) and Click's plain help formatter. Click cuts group descriptions, so the project overrides one Click method (format_commands) in its existing group class. The detect_agent package that agent_tool() uses is already a dependency. Cost to build (estimate): 0.3 M model input and output, and 3 to 4 hours. Cost to keep: one override and one switch.
Related
#4833 (CLI usage tracker), #4860 (usage-error hints).
Alternatives check of 2026-11-29: in-use.
The repository already uses this tool.
Tool: fastapi/typer (https://github.com/fastapi/typer), MIT, last activity 2026-11-26, maintained.
Reason: Searches found no dedicated tool; Typer, which the CLI already uses, has the TYPER_USE_RICH switch that gives agent callers plain Click help, but it neither keeps full group command descriptions nor counts help requests.
Covers:
- Plain Click help text for agent callers through TYPER_USE_RICH=0
- User-set TYPER_USE_RICH value still wins over the agent default
- Person callers keep the Rich help form unchanged
- Switch applies before the Typer import, so it reaches every page
Lacks:
- Group pages cut command help to the first sentence and 80 columns
- No help-request counter with command path and caller labels
- No caller detection; the project must supply its own agent check
Proposed design
Problem statement
Agents read devops help often, and the Rich help boxes make each reply 2 to 4 times larger than the text in it. Plain Click help cuts group descriptions to the first sentence and to 80 columns. The change gives agent callers plain help with the full first paragraph of each command and counts each help request.
Acceptance criteria
Requirement: Agent group help is plain and complete
An agent caller SHALL get plain help from a group command with the full first paragraph of each command description and no width cut.
Scenario: Roadmap group help for an agent
- WHEN A test runs
devops roadmap -hwith an agent marker and no user-setTYPER_USE_RICH. - THEN The output holds no Rich box character and no command entry ends with
...; each command entry holds the full first paragraph of its help.
Requirement: Person help stays Rich
A person caller SHALL get the Rich help form.
Scenario: Roadmap group help for a person
- WHEN A test runs
devops roadmap -hwith no agent marker and no user-setTYPER_USE_RICH. - THEN The output holds a Rich box character and matches the current Rich help form.
Requirement: User Rich setting wins
A user-set TYPER_USE_RICH value MUST override the agent default.
Scenario: Agent caller sets Rich on
- WHEN A test runs
devops roadmap -hwith an agent marker andTYPER_USE_RICH=1. - THEN The output holds a Rich box character.
Requirement: Help requests are counted
A help request SHALL add one to devops_cli_help_requests_total with its command path and caller.
Scenario: Leaf help request from an agent
- WHEN A test runs
devops pr create -hwith an agent marker and reads the metric. - THEN The counter increases by one with command path
pr createand calleragent.
Requirement: Plain usage-error parsers accept plain text
Each parser of the Rich usage-error box SHALL accept the plain Click text and return the command path.
Scenario: Docs generator parses a plain usage error
- WHEN A test gives
docs/generator.pya plain Click usage error from an agent caller. - THEN The parser returns the command path and raises no exception.
Requirement: New tests fail on the base
The new help tests MUST fail on the base revision.
Scenario: Fail-to-pass check on the base
- WHEN A developer runs
uv run devops ci fail-to-pass --base origin/main. - THEN The command reports each new help test as failing on the base.
Existing Tool Considered
The alternatives check of 2026-11-17 in the issue body gives Typer the verdict in-use. The check lists what Typer covers and lacks. The proposal uses Typer's TYPER_USE_RICH=0 and adds the format_commands override and the help-request counter that the check says the tool lacks. The issue estimates 0.3 M tokens and 3 to 4 hours for the override and switch.
Key questions
- How does an agent caller get plain help without changing person output?: Set
TYPER_USE_RICH=0at the start ofentry.main()before any import ofdevops_cli.mainwhenis_agent_caller()is true and the user did not set the variable. (best practice) [sources: src/devops_cli/entry.py, src/devops_cli/core/caller.py]- Chosen: Set
TYPER_USE_RICH=0inentry.pyfor agent callers. It runs before Typer import, leaves person output Rich, and keeps a user-set value. - Rejected: Force plain help for all callers. It changes person output.
- Rejected: Render a custom plain formatter for each help page. It duplicates Typer's switch and adds code.
- Chosen: Set
- How does a group help page keep the full first paragraph of each command?: Override
format_commandsonUsageTaggedGroupto write the full first paragraph of each command help and to apply no width cut. (best practice) [sources: src/devops_cli/core/cli.py]- Chosen: Override
format_commandsonUsageTaggedGroup. The group class is shared by the command tree and can keep the full paragraph with no cut. - Rejected: Set only a wider
max_content_width. Click still keeps only the first sentence. - Rejected: Use Rich help for group pages. It adds the box characters that the change removes.
- Chosen: Override
- Where should the help-request counter record each request?: Record
devops_cli_help_requests_totalinUsageRecordingGroupwith thecommand_pathandcallerlabels. (best practice) [sources: src/devops_cli/core/cli.py, src/devops_cli/telemetry/usage_errors.py, docs/TELEMETRY.md]- Chosen: Count in
UsageRecordingGroupwith the existing caller labels. The root group sees each help request, and the labels match the usage-error metric. - Rejected: Count from local transcripts. It is not live and misses MCP and cluster callers.
- Rejected: Count in each command. It duplicates code and misses group help.
- Chosen: Count in
- Which caller values does the help-request counter use?: The caller label uses
person,agent,ciandmcp, as the usage-error metric does. [sources: docs/TELEMETRY.md, src/devops_cli/telemetry/usage_errors.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 13, 2026
Both change CLI output for agents, but #4860 adds hints to usage errors while this candidate changes the help format and fixes the usage-error box parsers.devops-cli-service commentedon Nov 17, 2026
Alternatives check: in-use
Reason: The web searches returned only unrelated pages, so nothing new turned up; the issue itself names the existing tools: Typer's
TYPER_USE_RICHswitch and Click's plain help formatter, and Typer is already the CLI framework the project builds on. Typer covers the plain-text help/usage output for leaf commands (about half the bytes), but Click's plain group formatter still cuts each command description to its first sentence and to the formatter width, and no help-request counter exists, so it covers only part of the need.The repository already uses this tool.
Tool: fastapi/typer (https://github.com/fastapi/typer)
Covers:
TYPER_USE_RICH=0is set before the Typer importTYPER_USE_RICH=1can still winpr create -h3,915 to 1,796 bytes) with the same wordsLacks:
...(17 cut entries inroadmap -h, 18 inci -h)command_pathandcallerlabelsformat_commandson the group class to keep the full first paragraph of every commandTools considered:
Searches run:
Sources:
Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 18, 2026
Status set to Ready at b466159 (see proposed design in issue body).
Moved to new items: #6233.
devops-cli-service commentedon Nov 23, 2026
The result in the alternatives block of the issue body changed. Before this check:
in-use, tool https://github.com/fastapi/typer. A person decides what the new result means for the item.Searches (3)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 29, 2026
The result in the alternatives block of the issue body changed. Before this check:
in-use, tool https://pypi.org/project/typer. A person decides what the new result means for the item.Searches (7)
Tools considered:
Searches run:
Sources:
fix(cli): keep group help startup telemetry-free and drop test ignores (
feat(cli): serve agents plain help with full descriptions (#5450)
fix(cli): keep group help startup telemetry-free and drop test ignores (
chore(main): release 0.249.0 (#7769)
devops-cli-service commentedon Nov 29, 2026
Released in v0.249.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.249.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 16:50 UTC