Repository navigation
Description
Problem Description
Some wrappers give a short flag to one option, but the wrapped tool uses the same short flag for another option. An agent that knows the tool gets no usage error, only a wrong result, so the usage-error records cannot find these cases. ADR 0026 (#5223) says that a devops command takes the names of its tool.
| devops command | devops short flag | Meaning in the tool |
|---|---|---|
devops scan trivy |
-t is --type, -f is the devops render |
trivy: -t is --template, -f is the report format |
devops test run |
-c is --changed |
pytest: -c is the config file |
devops test load |
-s is --summary-export |
k6: -s is --stage |
devops k8s stream-logs |
-t is --tail |
stern: -t is --timestamps |
devops gh pages builds, devops gh metrics |
-l is --limit |
gh: -l is --label, -L is --limit |
Reproduction Steps
- Run
uv run devops k8s stream-logs --help. The output shows--tail -t. - Read the flag table of stern (github.com/stern/stern). It shows
-t, --timestamps. devops k8s stream-logs <query> -t 50shows 50 lines of history.stern <query> -tadds timestamps.
Expected vs Actual Behavior
Expected: a short flag of a wrapper has the meaning that the wrapped tool gives it, or the wrapper has no such short flag. Actual: the six commands of the table give the short flag another meaning.
Environment Diagnostics
- DevOps CLI Version: 0.122.0 (origin/main fe6b88f)
- Python Version: 3.14
- OS & Architecture: Linux x86_64
- Execution Environment: DevContainer
Logs, Traces, or Terminal Output
$ uv run devops scan trivy --help # --type -t, --format -f
$ uv run devops test run --help # --changed -c
$ uv run devops test load --help # --summary-export -s
$ uv run devops k8s stream-logs --help # --tail -t
$ uv run devops gh pages builds --help # --limit -lProposed Fix
Remove each short flag of the table. The long names stay. Record the short flags of trivy, pytest, k6 and stern at the versions that the project installs, in the form of the recorded flags of #5223. Extend the check of #5223 to the composites that wrap one of these tools: a short flag of the command must not be a short flag of the tool with another meaning. Correct each document that uses a removed short flag.
Existing Tool Considered
Click options and the recorded flags of #5223. Nothing new is built.
Acceptance Criteria
- The
--helpof the six commands shows no short form for these options. - The extended check fails on a test command that maps
-tto an option other than the stern option. devops docs checkpasses.
Dependencies
Merge first: #6597. Open the pull request after the pull request of #4840 merges, and not while another open pull request changes commands/gh.py.
Source: #4833
Alternatives check of 2026-11-29: none.
Tool: none found.
Reason: Searches found no open tool that records a wrapped tool's short flags or compares a wrapper command's short flags with the wrapped tool's meanings. Click and Typer only declare a command's own options, so the versioned record and collision check must be built.
Lacks:
- No record of trivy, pytest, k6, stern or gh short flags
- No cross-tool comparison of a wrapper short flag with the tool's meaning
- No check over the declared options of a Typer command tree
Proposed design
Problem statement
Remove the conflicting short flags from five wrapper commands and add a collision check. Some wrappers give a short flag to an option that the wrapped tool uses for another option, so an agent that knows the tool gets a wrong result and no usage error. devops gh pages builds no longer exists, so the change covers devops gh metrics only. Merge #4840 first. Do not open the pull request while another open pull request changes src/devops_cli/commands/gh.py.
Acceptance criteria
Requirement: Wrapper help omits the conflicting short flags
Each wrapper command of the change SHALL declare no short form for its conflicting options.
Scenario: Help of the five wrapper commands
- WHEN A test runs the help of
scan trivy,test run,test load,k8s stream-logsandgh metricsthrough the Typer CLI runner. - THEN
scan trivyshows--typeand--formatwith no short form,test runshows--changedwith no-c,test loadshows--summary-exportwith no-s,k8s stream-logsshows--tailwith no-t, andgh metricsshows--limitwith no-l.
Requirement: The record holds the tool versions, the tool flags and the command tools
The record in src/devops_cli/core/tool_short_flags.py SHALL name the version of each wrapped tool, hold the short flags that the tool defines with their long options, and name the tool that each wrapper command wraps.
Scenario: Recorded flags of trivy, pytest, k6, stern and gh
- WHEN A test imports the record.
- THEN The record names the five tools with a version for each, maps
-tto trivy--template,-fto trivy--format,-cto pytest--config-file,-sto k6--stage,-tto stern--timestamps,-nto stern--namespace,-lto gh--labeland-Lto gh--limit, and names the tool of each of the five commands.
Requirement: A short flag with a different tool option fails the check
The collision check MUST report a collision when the record maps a wrapper short flag to a long option other than the one that the tool gives that short flag.
Scenario: Fixture maps -t to --tail
- WHEN A test runs the check on a fixture command that maps
-tto--tailfor stern, while the record maps stern-tto--timestamps. - THEN The check reports one collision for
-ton that command.
Requirement: A short flag with the tool's meaning passes the check
The collision check SHALL report no collision when the record maps the command's short flag to the long option that the tool gives that short flag.
Scenario: Fixture maps -n to --namespace
- WHEN A test runs the check on a fixture command that maps
-nto--namespacefor stern. - THEN The check reports no collision for that command.
Requirement: A short flag with the tool's long name but another meaning fails
The collision check MUST report a collision when a wrapper command declares a short flag that the tool defines and the record maps that short flag to no tool option.
Scenario: Fixture maps -f to the devops render format
- WHEN A test runs the check on a fixture command that declares
--formatwith-ffor the devops render format, while trivy defines-fas--format. - THEN The check reports one collision for
-fon that command.
Requirement: The current wrapper commands pass the check
The collision check SHALL report no collision for the five wrapper commands after the conflicting short flags are removed.
Scenario: The five commands pass
- WHEN A test runs the check on
scan trivy,test run,test load,k8s stream-logsandgh metrics. - THEN The check reports no collision for any of the five commands.
Requirement: The generated command reference shows the long options
The generated command reference SHALL show the long options of the five commands without the removed short forms.
Scenario: The docs check passes after generation
- WHEN
uv run devops docs generateruns, and thenuv run devops docs checkruns. - THEN
uv run devops docs checkexits 0.
Existing Tool Considered
No open, maintained tool or library covers the need. The alternatives check of 2026-11-19 in the issue body gives the verdict none: Typer and Click declare a command's options and short flags, but neither keeps a record of a wrapped tool's flags nor runs a cross-tool collision check. The change keeps Typer for the command tree and adds a versioned flag record and a collision check on top of it. Written cost: about 120 lines of check code and about 180 lines of tests, about 6,000 tokens and about 3 hours to build, keep and fix.
Key questions
- Which ADR governs the short flags of a wrapper command?: ADR 0037, 'Tool commands mirror and pass through options'. The body cites ADR 0026, which is 'GitHub settings are OpenTofu code the owner applies'. [sources: docs/adr/0037-tool-commands-mirror-and-pass-through-options.md]
- Should a wrapper remove a conflicting short flag or remap it to the tool's meaning?: Remove the conflicting short flag and keep the long option. ADR 0037 requires a tool command to take the options of the tool. (best practice) [sources: docs/adr/0037-tool-commands-mirror-and-pass-through-options.md, openspec/changes/archive/2026-11-25-5318-tf-passthrough-flags/proposal.md, openspec/specs/tf-passthrough/spec.md]
- Chosen: Remove the short flag and keep the long option. ADR 0037 keeps the wrapper aligned with the tool. The feat(tf): pass flags to tofu; add import, state, show, force-unlock #5318 change removed colliding aliases from
devops tfand kept its long options. - Rejected: Remap the short flag to the tool's meaning. It adds an option that the issue does not request and that devops does not own.
- Rejected: Keep the short flag with a warning. A warning still lets an agent get a wrong result with no usage error.
- Chosen: Remove the short flag and keep the long option. ADR 0037 keeps the wrapper aligned with the tool. The feat(tf): pass flags to tofu; add import, state, show, force-unlock #5318 change removed colliding aliases from
- How should the check learn the short flags of trivy, pytest, k6, stern and gh?: Record them in one versioned table in
src/devops_cli/core/tool_short_flags.py, beside the check. The table names the version that the project installs. A comment says to record again when a pin changes. (best practice) [sources: src/devops_cli/core/passthrough.py, tests/support/openspec_recording.py]- Chosen: One versioned record beside the check. One table holds the versions, the tool short flags and the tool of each command. The check reads it and no test reads a manifest.
- Rejected: Parse each tool
--helpat test time. The test would depend on network and upstream output, and CI may not have the k6 or stern binary. - Rejected: Hard-code the flags in each command module. It scatters one fact across modules and lets the record drift.
- Should the check allow a wrapper short flag that means the same option as the tool's short flag?: Yes. The record lists the short flags that a command keeps with the tool's meaning. A declared short flag that the tool defines and that the record does not list fails.
scan trivy -fgoes, because the devops render format is not trivy's--format. (best practice) [sources: src/devops_cli/commands/scan.py, src/devops_cli/commands/test_cmd.py]- Chosen: List each kept short flag with the tool's long option. The check passes a short flag only when the record gives the same long option that the tool gives that short flag.
- Rejected: Allow a short flag when the long option names are equal.
scan trivy --formatand trivy--formathave the same name but different meanings. This rule would keep-f. - Rejected: Reject every short flag that the tool defines. It would remove a safe alias that means the tool's own option, such as stern
-n.
- Should the record include the gh short flags?: Yes.
devops gh metricshas-lfor--limit, but gh gives-lto--labeland-Lto--limit. The check cannot rejectgh metrics -lwithout the gh record. (best practice) [sources: src/devops_cli/commands/gh.py]- Chosen: Include gh in the record. The check can then compare
gh metrics -lwith gh-l --labeland report the collision. - Rejected: Exclude gh from the record. The check cannot prove that
gh metrics -lis wrong.
- Chosen: Include gh in the record. The check can then compare
- Does
devops gh pages buildsstill exist?: No. Thedevops gh pagesgroup holdsstatusandverify. The command with the-lcollision isdevops gh metrics. [sources: src/devops_cli/commands/gh.py] - How should the check walk the commands and compare short flags?: Walk the Typer command tree and read each command's declared short flags. Do not parse help text. Do not hard-code the options. (best practice) [sources: src/devops_cli/commands/init.py, src/devops_cli/commands/gh.py, src/devops_cli/commands/test_cmd.py, src/devops_cli/commands/scan.py]
- Chosen: Walk the Typer command tree. Typer holds each command's options and short flags. The check reads them from the commands themselves.
- Rejected: Parse each command's
--helptext. The text changes with formatting and misses a command that a test does not call. - Rejected: Hard-code each command's options in the check. The check would drift from the command definitions.
- Does the tree hold the feat(cli): tool commands pass unknown arguments to the tool #5223 tool flag record or collision check?: No. The tree holds ADR 0037 and the pass-through registry, but no record of a wrapped tool's short flags and no collision check. This change adds both rather than extending an existing one. [sources: src/devops_cli/core/passthrough.py, docs/adr/0037-tool-commands-mirror-and-pass-through-options.md, src/devops_cli/commands/scan.py, src/devops_cli/commands/test_cmd.py]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 12, 2026
Both fix CLI option correctness, but #4943 fixes a format name in help text while the candidate removes short flags that map to a different option in the wrapped tool.devops-cli-service commentedon Nov 17, 2026
Refine cannot set this item to Ready at 90a3d2a while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
src/devops_cli/commands/gh.py.devops-cli-service commentedon Nov 19, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (10)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 21, 2026
Owner question: See Suspected block in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 21, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.
devops-cli-service commentedon Nov 26, 2026
Owner question: See Suspected block and Watched files in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 28, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.
devops-cli-service commentedon Nov 28, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
chore(main): release 0.247.0 (#7752)
devops-cli-service commentedon Nov 29, 2026
Released in v0.247.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.247.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 16:17 UTC