Repository navigation
Description
Problem or Motivation
Some names fail with no Click suggestion, and agents try again and again. devops pr merge and devops gh pr merge failed 53 times in 23 sessions; only a person merges (AGENTS.md), so no such command will come. devops roadmap show|list|view|status|get failed 49 times in 45 sessions; the commands are roadmap explain <n> and roadmap inbox. devops openspec validate|list failed 37 times; these are commands of the upstream openspec CLI. devops pr show|info failed 14 times (pr view). Gate row names typed as devops ci <row> failed 25 times (the form is devops ci --only <row>). devops ai cost-report failed 8 times; the MCP tool ai_cost_report is the command devops ai cost report.
Tracker #4833, child 10. The owner asked on 2026-11-11 to fix the devops gh issue name and to record such errors for a later analysis of missing flags, features and aliases. The counts come from a study of Claude Code, Kilo, Antigravity and Loki records from 2026-09-23 to 2026-11-11.
Proposed Solution & Architectural Design
Add a data table usage_hints.yaml (command path, typed name, hint text, reason by_design, other_tool or other_name) and one rule for devops ci: a typed name that is a gate row gets the --only form from the gate registry. The group class of item usage-error-capture prints the hint as one line after Click's error, keeps exit code 2, and records hinted=true in the ledger. A hint runs no command and is not an alias. The old plural names of the rename get no hint, because Click already suggests the new name. Open tool: Click has only difflib suggestions and no hint table, so this is built; cost about 100 lines and the table, about 0.30 USD on the DeepSeek implement path and 1 day elapsed.
Target Subsystem
SDLC, Git & PR Governance (CLI usage errors: the root group class).
Existing Tool Considered
Click has only difflib suggestions and no hint table, so this is built. Cost: about 100 lines and the table, about 0.30 USD on the DeepSeek implement path, and 1 day elapsed.
Acceptance Criteria
devops pr merge 1 exits 2 and prints Click's error and one hint line that says only a person merges. devops roadmap show 1 names devops roadmap explain. devops openspec validate names openspec validate and devops openspec check. For each gate row, devops ci <row> names devops ci --only <row>. devops ai cost-report names devops ai cost report. A test fails when a hint names a command that does not resolve through core/command_resolver.py, and when the table holds a name that Click already suggests.
Dependencies
Merge first: #4839.
Source: #4833
Alternatives check of 2026-11-21: none.
Tool: none found.
Reason: Searches found only click-didyoumean, which re-adds Click's difflib subcommand suggestion, and thefuck, which corrects typed shell lines; neither offers a hint table, cross-group lookup, by-design or other-tool hints, or control of Click's option list.
Lacks:
- No configurable hint table keyed by typed command word
- No cross-group whole-word lookup across command tree
- No by-design, other-tool or gate-row hint reasons
- No control over Click's Possible options or help-flag filtering
- click-didyoumean only repeats Click's existing difflib suggestion
Proposed design
Problem statement
Agents type command names that do not exist, and Click gives no suggestion for most of them: the study found 1,258 usage errors, and 838 had no suggestion line. A person merges pull requests, so devops pr merge will never exist, and the roadmap, openspec, ci, gh and ai names differ from what agents type. This item adds a hint table at src/devops_cli/core/usage_hints.yaml and a computed cross-group lookup. They print one hint line after Click's usage error, keep exit code 2, and record hinted in the usage-error ledger. #5451 already made each gate row a devops ci command, so this item keeps only the ci list and ci --list hints and changes no ci help.
Acceptance criteria
Requirement: Hint after a usage error
The root group SHALL print one hint line after Click's usage error when the typed command word or option has a row in the hint table.
Scenario: A by-design name gets a hint
- WHEN A user runs
devops pr merge 1. - THEN The process exits 2, prints Click's usage error, and prints one hint line that says only a person merges a pull request.
Requirement: Synonym rows for roadmap
The CLI SHALL name devops roadmap explain <n> or devops roadmap inbox when the typed name is one of roadmap show, list, view, status or get.
Scenario: roadmap show names roadmap explain
- WHEN A user runs
devops roadmap show 1. - THEN The hint line names
devops roadmap explain <n>.
Requirement: Synonym rows for pr
The CLI SHALL name devops pr view <n> when the typed name is pr show or pr info.
Scenario: pr show names pr view
- WHEN A user runs
devops pr show 1. - THEN The hint line names
devops pr view <n>.
Requirement: Other-tool row
The CLI SHALL name the other tool's command and the devops command that does the same work when the reason of a row is other_tool.
Scenario: openspec validate names both commands
- WHEN A user runs
devops openspec validate. - THEN The hint line names
openspec validateanddevops openspec check.
Requirement: Cross-group lookup
The CLI SHALL print Did you mean: <path> when the typed command word exactly matches a command in another group, or matches it after a split at - or _.
Scenario: ai cost-report resolves to ai cost report
- WHEN A user runs
devops ai cost-report. - THEN The hint line prints
Did you mean: devops ai cost report.
Requirement: Whole-word match only
The CLI MUST print no cross-group hint when the typed word is only part of a command name.
Scenario: A prefix gets no computed hint
- WHEN A user runs a command word that is a prefix of a real command name and matches no whole word.
- THEN The output holds Click's error and no
Did you meanline from the cross-group lookup.
Requirement: No help flag in possible options
The CLI MUST leave --help and -h out of the Possible options list of an unknown option error.
Scenario: An unknown option error hides the help flags
- WHEN A user runs a command with an unknown option.
- THEN The
Possible optionslist holds no--helpand no-h.
Requirement: Short option list
The CLI SHALL print every option of the command on the error line when an unknown option has no close match and the command has 6 options or fewer.
Scenario: gh issue view lists its options
- WHEN A user runs
devops gh issue view 1 --bogusand the command has 6 options or fewer. - THEN The error line lists every option of the command,
--repoincluded.
Requirement: Missing option help
The CLI SHALL add the help line of the missing option to a Missing option error.
Scenario: A missing option prints its help
- WHEN A user runs a command that requires an option and gives none.
- THEN The error prints the help text of that option.
Requirement: ci list prints the rows
The CLI SHALL print the gate row names in one line when a user types devops ci list or devops ci --list.
Scenario: ci --list names each row
- WHEN A user runs
devops ci --list. - THEN The process exits 2 and prints the name of each row of the gate registry in one line.
Requirement: Interim rows for the gh flags
The CLI SHALL name the devops gh api endpoint that returns the same data for --json, --jq, --comments and --search typed on gh issue view|list and gh pr view|list.
Scenario: --json names the gh api endpoint
- WHEN A user runs
devops gh issue view 1 --json number. - THEN The hint line names
devops gh api repos/{owner}/{repo}/issues/<n>.
Requirement: Interim row for comment
The CLI SHALL name the devops gh api comment command for comment typed in the pr and gh pr groups.
Scenario: pr comment names the gh api command
- WHEN A user runs
devops pr comment 1 --body hi. - THEN The hint line names
devops gh api repos/{owner}/{repo}/issues/<n>/comments -X POST -F body=@<file>.
Requirement: Hint runs no command
A hint MUST run no command of the CLI and MUST NOT act as an alias.
Scenario: A hinted error runs nothing
- WHEN A user runs a hinted wrong command.
- THEN No command of the CLI runs and the process exits 2.
Requirement: Ledger records the hint
The usage-error ledger MUST record hinted: true for an error that got a hint.
Scenario: A hinted error is in the ledger
- WHEN A hinted usage error occurs.
- THEN The ledger record for the error holds
hinted: true.
Requirement: Hint target resolves
A test MUST fail when a hint names a devops command that does not resolve through core/command_resolver.py.
Scenario: The table test resolves each target
- WHEN The test suite runs over the hint table.
- THEN Each hint target that names a devops command resolves, and the test fails on one that does not.
Requirement: No duplicate of Click's suggestion
A test MUST fail when a hint row names the same target that Click already suggests for the typed name.
Scenario: A row that repeats Click's suggestion fails
- WHEN The test suite runs over the hint table.
- THEN A row whose Click suggestion target equals the hint target fails, and a row with a different target passes.
Requirement: Spec states the hint line and the hinted field
The command-telemetry spec SHALL state that one hint line follows the error box when the typed name has a hint and that the record holds hinted.
Scenario: The spec holds the hint line and the field
- WHEN The change adds the hint line and the
hintedfield. - THEN
openspec/specs/command-telemetry/spec.mdstates the hint line after the error box, the exit code 2 and thehintedfield, and theopenspecrow passes.
Requirement: Generated telemetry doc names the hinted field
The pull request SHALL regenerate docs/TELEMETRY.md from the generator text that names the hinted field.
Scenario: The docs check passes
- WHEN The generator text of the usage-error record names
hinted. - THEN
docs/TELEMETRY.mdholdshintedand thedocsrow ofStatic Analysispasses.
Existing Tool Considered
No open, maintained tool covers the need. Typer 0.28 and Click 8.5.1 already print difflib near-miss suggestions and Possible options, but they have no hint table, cross-group word lookup, gate-row rule or control of the option list. click-didyoumean (MIT, last activity 2024-03-24) only re-adds the difflib subcommand suggestion, and thefuck (MIT, last activity 2022-01-02) corrects a shell line, not a Click usage error. Build the hint table and the group-class hooks: about 6k tokens to build, about 1k tokens each month to keep and fix, about 0.30 USD on the DeepSeek implement path, and 1 day of elapsed time.
Key questions
- Where does the hint data live?: A YAML table
src/devops_cli/core/usage_hints.yamlholds each row with the command path, the typed name, the hint text and the reason (by_design, other_tool or other_name). The package reads it withimportlib.resources.files("devops_cli.core"), as it reads its other data files, and a computed lookup runs beside the table. (best practice) [sources: src/devops_cli/roadmap/duplicate_eval.py:42, pyproject.toml:22]- Chosen: YAML table plus a computed lookup. The table names hints that no lookup finds, such as another tool's command or a by-design rule. The lookup covers names that the table does not list.
- Rejected: Computed lookup only. It cannot name
openspec validateor state a by-design reason. - Rejected: One hand row for each name. The set grows with each command and each MCP tool name, so the table goes stale.
- Which hint does
devops pr mergegive?: A by_design hint. Only a person merges a pull request, so the agent opens the pull request and asks a person to merge it. (best practice) [sources: AGENTS.md:21]- Chosen: by_design hint. AGENTS.md gives the merge to a person only, so no such command will come.
- Rejected: alias to
devops pr ready. Readiness is not a merge, and a hint is not an alias. - Rejected: add a
pr mergecommand. AGENTS.md forbids an agent merge, so the command would break the rule.
- How does the CLI find a command in another group?: It walks the command tree for an exact match of the typed word, or of the word split at
-or_, and printsDid you mean: <path>. Only whole-word matches count. (best practice) [sources: src/devops_cli/core/command_resolver.py:95]- Chosen: whole-word tree lookup. It finds
ai cost reportforcost-reportwith no wrong hint. - Rejected: difflib near-miss. Click already runs it and gave
lintforci list, a command with another effect. - Rejected: hand rows for other paths. It misses each new command and each MCP tool name.
- Chosen: whole-word tree lookup. It finds
- What does the item do with Click's own suggestions?: It keeps them and filters them. It removes
--helpand-hfrom thePossible optionslist, prints the full option list when an unknown option has no close match and the command has 6 options or fewer, and adds the help line of a missing option. A hint row whose target equals Click's suggestion is refused, and a row whose target differs stays, soci listkeeps its row even though difflib suggestslint. (best practice) [sources: src/devops_cli/telemetry/usage_errors.py:181, docs/TELEMETRY.md:238, tests/telemetry/snapshots/test_usage_errors.ambr:9]- Chosen: keep and filter Click's suggestions. Only 420 of 1,258 errors showed a line, and the small groups have few options to list.
- Rejected: replace Click's suggestion machinery. It works for most names, and a replacement adds risk for no gain.
- Rejected: drop Click's suggestions. The suggestion names the new command after a rename, and the ledger records it.
- Does this item keep the
ci <row>rule?: No. feat(ci): each check row is a devops ci command #5451 is merged:CHECK_ROW_NAMESholds every row and_register_row_commandsregisters onedevops ci <row>command for each row that has no hand-written command, so a typed row name works. This item keeps only theci listandci --listhints. [sources: src/devops_cli/commands/ci.py:120, src/devops_cli/commands/ci.py:2983, src/devops_cli/commands/ci.py:1685] - Does the item add the gate row names to the
devops ci --onlyhelp?: No. feat(ci): each check row is a devops ci command #5451 already sets the help fromCHECK_ROW_NAMES, sodocs/commands/ci.mdanddocs/MCP_TOOLS.mdhold every row. This item changes no help text and regenerates no CLI reference for it. [sources: src/devops_cli/commands/ci.py:1685, docs/commands/ci.md:17, docs/MCP_TOOLS.md:693] - Which command does the MCP tool
ai_cost_reportmap to?:devops ai cost report. [sources: docs/commands/ai.md:2063, src/devops_cli/commands/ai_cost.py:495] - Which command does a gh flag hint name?: The
devops gh apiendpoint that returns the same data.devops gh apiforwards-X,-fand-Fto gh throughallow_extra_args, so the comment hintdevops gh api repos/{owner}/{repo}/issues/<n>/comments -X POST -F body=@<file>is a real command. [sources: src/devops_cli/commands/gh.py:1443, src/devops_cli/commands/gh.py:1506, src/devops_cli/github/request_classifier.py:188] - Which open, maintained tool covers the need?: None. Typer 0.28 and Click 8.5.1 already print difflib near-miss suggestions and
Possible options, but they have no hint table, cross-group word lookup, gate-row rule or control of the option list.click-didyoumean(MIT, last activity 2024-03-24) only re-adds the difflib subcommand suggestion, andthefuck(MIT, last activity 2022-01-02) corrects a shell line, not a Click usage error. The hint table and the group-class hooks are built for about 6k tokens, about 1k tokens each month to keep and fix, about 0.30 USD on the DeepSeek implement path, and 1 day of elapsed time. (best practice) [sources: pyproject.toml:12, pyproject.toml:13]- Rejected: click-didyoumean. It has no table, no cross-group lookup, no gate-row rule and no option control.
- Rejected: thefuck. It runs in the shell and last changed on 2022-01-02.
- Chosen: build the table and the group hooks. No tool covers the need. Cost: about 6k tokens and 1 day.
- Does the item add a hint for
gh status?: No.devops gh statusis already a command that prints GitHub's operational status, and feat(gh): gh status, label list and secret list run gh #5228 will make it a pass-through togh status; a hint to Statuspage health would name a different meaning. A hint is only for an unknown name. (best practice) [sources: docs/commands/gh.md:52, docs/CLI_REFERENCE.md:346]- Chosen: no hint. The command exists, and the pass-through gives
gh statusone meaning indevops gh. - Rejected: hint to the health command. It would name a different meaning after feat(gh): gh status, label list and secret list run gh #5228.
- Chosen: no hint. The command exists, and the pass-through gives
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(cli)scope of the title gives the scope.It reduces 186 recorded failed attempts but does not block any workflow.It saves agent and human time by pointing to the correct command after a wrong one is typed.The body states about 100 lines plus a data table, roughly 1 day of work.Both ensure correct command names reach the user, but #920 fixes the knowledge base text while this adds a new hint line to CLI error output.dan-petty commentedon Nov 12, 2026
Re-scope (owner direction of 2026-11-12). The title stays.
New scope
This item can start now. Its one dependency, #4839, is closed. It does not wait for the pass-through items of tracker #4833: 149 of its 192 failures in the study are hints that no other item changes (
pr merge53,roadmap show|list|view|status|get49,ci <row>25,pr show|info14,ai cost-report8).Changes to the hint table:
ci listandci --list. Loki holds 3 such errors in the 7 days to 2026-11-12. The hint prints the names of the gate rows from the gate registry in one line. The help ofdevops ci --onlyalso lists the row names.['lint']forlistamong thedevops cicommands, anddevops ci lintapplies fixes by default. Premise check: record the suggestion that Typer 0.28 prints fordevops ci list. The test that refuses a row which Click already suggests compares the suggested target with the hint target, not only the name.pr merge,roadmap show|list|view|status|get,pr show|info,ci <row>,openspec validate|listandai cost-report.gh status. feat(gh): gh status, label list and secret list run gh #5228 makes it a pass-through togh status, so a hint to Statuspage health would send agents to a command with another meaning.openspec validate|listand addsopenspec regenerate; feat(gh): gh status, label list and secret list run gh #5228 addscloudflare service-status; feat(cli): tool commands pass unknown arguments to the tool #5223 makes sure that no hint covers a token after a pass-through path.No
ci listcommand comes with this item: 3 errors in 7 days is below the proposal threshold of #4840 (5 errors on 3 days).Acceptance Criteria (changes)
devops ci --listanddevops ci listexit 2 and print the gate row names in one line.devops ci --helplists the row names under--only.core/command_resolver.pypasses.Dependencies
None. Start now. It changes the help of
devops ci --onlyin the generated command reference, so it is the first pull request of the one-at-a-time list of #4833.dan-petty commentedon Nov 13, 2026
New evidence of 2026-11-13 (review of failing CLI calls), and five scope points. This item comes before the interim hints that #4855 and #5227 need.
Counts
--headgave--help3 times,ci listgavelint.benchmark(ai benchmark) 2,ai mcp(mcp),roadmap step implement(roadmap implement).ai cost-report9,ai ast-graph,version2 (28 errors, 8 sessions).roadmap show23,roadmap view5,roadmap issue3,roadmap list2,pr show10,pr status3,pr info2 (48 errors, 40 sessions, mostly once per session).Scope points
-or_(cost-reporttoai cost report), and printDid you mean: devops ai benchmark?. Only whole-word matches, so no wrong hint. This replaces most hand rows for other paths and MCP names.--helpor-hin "Possible options". Remove them from Click's list.gh issue viewhas only--repo.Missing optionerror adds the help line of that option.--json,--jq,--commentsand--searchongh issue view|listandgh pr view|list: name the exactdevops gh apifallback (see the comment on feat(cli): tool commands pass unknown arguments to the tool #5223).commentin theprandgh prgroups: namedevops gh api repos/{owner}/{repo}/issues/<n>/comments -X POST -F body=@<file>(see feat(pr): pr comment and gh issue comment run gh #4855).openspec validatealready maps todevops openspec checkin this item.Change of one rule: the
ci <row>row moves to #5451, which makes each check row adevops cicommand. Then a typed row name works, and no hint is necessary. Theci listandci --listrows stay here.Measure: the share of
unknown_commandrecords with a correct hint goes up (thesuggestionfield of the ledger). Repeats of the same wrong word in one session go to 0. Wrong--helphints go to 0.devops-cli-service commentedon Nov 14, 2026
Alternatives check: none
Reason: The searches found only difflib-based did-you-mean helpers for Click, chiefly
click-didyoumean(aDYMGroupthat adds near-miss subcommand suggestions with acutoffandmax_suggestions), which is exactly the suggestion Click already prints and which the issue puts out of scope. No tool provides a data-driven hint table with hint text and reasons, a cross-group word lookup (cost-report→ai cost report), a gate-row rule, or control over option suggestions, so the hint table and root group class have to be built.Tool: none found
Lacks:
ai cost-report,ai ast-graphorversioncannot resolve to their real pathsdevops ci <row>into the--onlyform from the gate registryopenspec validate) or a synonym (pr show->pr view)--help/-hor printing the short option list on an unknown optionhintedfield in the usage-error ledgerTools considered:
Searches run:
Sources:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Status set to Ready at ca62d6a (see proposed design in issue body).
devops-cli-service commentedon Nov 25, 2026
Released in v0.216.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.216.0
devops-cli-service commentedon Nov 25, 2026
Live since 2026-11-25 06:00 UTC