Repository navigation
Description
Problem or Motivation
devops gh issues view has only --repo, and devops gh issues list has no search. Agents typed gh's flags: --search on issues list and devops gh search 44 times (Claude 19, other tools 25 in 23 sessions), --comments on issues view and gh issues comments 30 times, --json on issues view and list 15 times, and --body-file on issues create 3 times. The fallback is large: in the Claude logs alone, devops gh api sent 2,197 GET issues/:n/comments in 27 sessions and 1,984 GET search/issues in 32 sessions.
Tracker #4833, child 7. 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
After the rename, give devops gh issue view --comments/-c (reads issues/:n/comments through the paced REST session, all pages), --json <fields> with gh's field names (number, title, body, state, stateReason, labels, assignees, milestone, author, comments, createdAt, updatedAt, closedAt, url) and --jq/-q. Give devops gh issue list --search/-S (GitHub search syntax through search/issues, with the repository and is:issue added), --json and --jq. Give devops gh issue create --body-file/-F with the helper of item pr-body-file. These commands read through the REST session, not gh, so --jq needs a jq engine: use the maintained jq package on PyPI (BSD-2-Clause bindings to libjq) after a premise check of its wheels and license; write no filter code. Every flag goes into the dry-run request plan.
Target Subsystem
SDLC, Git & PR Governance (devops gh issue).
Existing Tool Considered
gh's flag names and the GitHub REST search API. For --jq on commands that read through the REST session: the maintained jq package on PyPI (BSD-2-Clause bindings to libjq), after a premise check of its wheels and license. No filter code is written.
Acceptance Criteria
devops gh issue view <n> --comments prints each comment with author and date. devops gh issue view <n> --json title,labels prints JSON with only those keys, and --jq .title prints the title. An unknown field exits 2 and names the valid fields. devops gh issue list --search 'label:type/bug' --json number prints a JSON array of open issues of this repository only. devops gh issue create --body-file f.md --dry-run lists the request with the file text. --dry-run sends 0 requests for each flag.
Dependencies
Merge first: #4835, child 8 of #4833.
Source: #4833
Alternatives check of 2026-11-21: in-use.
The repository already uses this tool.
Tool: cli/cli (https://github.com/cli/cli), MIT, last activity 2026-11-20, maintained.
Reason: Searches found no alternative tool: gh itself carries --comments, --json/--jq, --search/-S and --body-file/-F, so passing each flag through covers the whole need, and the repository already runs gh for GitHub reads.
Covers:
- --comments reads every comment page on issue view
- --json and --jq with gh's field names on view and list
- --search/-S runs search/issues scoped to the repository
- --body-file/-F on issue create, read by gh itself
- gh issue status lists the viewer's issues
Lacks:
- No devops dry-run argv plan or exit-code mapping
- Each call is a process whose errors arrive as text
- No MCP read-only allowlist or -L cap of 100
- No label counts; those move to devops gh issue triage
Proposed design
Problem statement
Agents type gh's flags on devops gh issue view, list, status and create, and the commands refuse them. The fallback sends many REST requests. This change passes each argument to gh, prints gh's output and exit code, and keeps the label counts in devops gh issue triage.
Acceptance criteria
Requirement: View delegates to gh
devops gh issue view SHALL pass its number, --comments/-c, --json, --jq/-q, and --repo arguments to gh issue view and SHALL print gh's stdout, stderr, and exit code unchanged.
Scenario: View with comments
- WHEN A stub
ghrecords its argv, printsalice: looks good, and exits 0 fordevops gh issue view 42 --comments. - THEN The command prints
alice: looks good, exits 0, and the recorded argv holdsgh issue view 42 --comments.
Requirement: JSON and jq go to gh
devops gh issue view MUST give --json, --jq/-q, and --template to gh issue view with no local JSON parsing or filter.
Scenario: JSON title with jq
- WHEN A stub
ghrecords its argv and printsxfordevops gh issue view 42 --json title --jq .title. - THEN The command prints
x, exits 0, and the recorded argv holds--json title --jq .title.
Requirement: Unknown JSON field
devops gh issue view SHALL exit with the exit code that gh issue view returns and SHALL print gh's error text unchanged when gh refuses an unknown --json field.
Scenario: Unknown field
- WHEN The stub
ghexits 1 withUnknown JSON field: "nosuchfield"and the valid field list. - THEN The command exits 1 and prints that text with the field list.
Requirement: List search
devops gh issue list SHALL pass --search/-S, --state, --json, --jq/-q, -L/--limit, and --repo to gh issue list and SHALL print gh's stdout, stderr, and exit code unchanged.
Scenario: Search with JSON
- WHEN A stub
ghprints[{"number":7}]fordevops gh issue list --search 'label:type/bug' --json number. - THEN The command prints the array, exits 0, and the recorded argv holds the same search text.
Requirement: Create body file
devops gh issue create SHALL pass --body-file/-F and its other arguments to gh issue create and SHALL print gh's stdout, stderr, and exit code unchanged.
Scenario: Create with body file
- WHEN A stub
ghrecords the argv and prints a URL fordevops gh issue create --title T --body-file f.md. - THEN The command prints the URL, exits 0, and the recorded argv holds
--body-filefollowed byf.md.
Requirement: Status pass-through
devops gh issue status SHALL run gh issue status with its arguments and SHALL print gh's stdout, stderr, and exit code unchanged.
Scenario: Status pass-through
- WHEN A stub
ghprints the viewer's issue list fordevops gh issue status. - THEN The command prints that text, exits 0, and the recorded argv holds
gh issue status.
Requirement: Triage keeps the counts
devops gh issue triage SHALL print the open-issue counts by priority, type, and milestone, and the taxonomy audit.
Scenario: Counts by label
- WHEN The stubbed store holds three open issues with
type/bugand one withpriority/p1. - THEN The output holds the count 3 for
type/bugand 1 forpriority/p1, with the audit lines.
Requirement: MCP triage resource and tool
The MCP resource resource://gh/issue/triage and the job-role tool gh_issue_triage MUST return the label counts.
Scenario: Job roles list the triage tool
- WHEN A test lists the tools of each job role and reads the resource
resource://gh/issue/triage. - THEN Each role holds
gh_issue_triageand nogh_issue_status, and the resource returns the counts.
Requirement: Registry names triage
The roadmap tool registry MUST name gh_issue_triage in place of gh_issue_status.
Scenario: Registry lookup
- WHEN A test calls
tool_namesfor each job role. - THEN Each tuple holds
gh_issue_triageand nogh_issue_status.
Requirement: MCP tools read only
The MCP tools gh_issue_view and gh_issue_list MUST publish read flags only, MUST refuse -w/--web, and gh_issue_list MUST refuse a limit above 100.
Scenario: Web flag and oversized limit refused
- WHEN A caller asks
gh_issue_viewfor--web, orgh_issue_listfor-L 200. - THEN The tool refuses the call, names the allowed flags, and runs no gh process.
Requirement: Dry run prints argv
--dry-run MUST print the gh argv of each new view, list, status, and create form and MUST run no process.
Scenario: Dry run of list and create
- WHEN The user runs
devops gh issue list --search 'x' --dry-runanddevops gh issue create --body-file f.md --dry-run. - THEN The first prints a
gh issue listargv with--search x, the second prints agh issue createargv with--body-file f.md, and no process starts.
Requirement: REST helpers leave the commands
The devops gh issue view, list, and status commands MUST invoke gh and MUST not call get_repository_issue, get_repository_issues, issues_list_requests, or issues_status_requests.
Scenario: No REST helper call
- WHEN A test replaces the four helpers with functions that raise, runs each command with a stub
gh, and the stub exits 0. - THEN Each command exits 0 and prints the stub output.
Requirement: Spec delta holds the pass-through
The change's gh-issues-view spec delta SHALL add the gh pass-through requirement and SHALL remove the pull-request refusal requirement.
Scenario: Delta validates
- WHEN
uv run devops openspec checkvalidates the change. - THEN The command exits 0 and reports the
gh-issues-viewdelta as valid.
Existing Tool Considered
cli/cli (gh) - alternatives verdict in-use; the repository already uses this tool. The alternatives check in the issue body records what gh covers and lacks. This change passes each argument to gh, prints the gh argv on --dry-run, adds the MCP read-only allowlist and -L cap of 100, passes gh's errors and exit codes, and keeps the label counts in devops gh issue triage.
Key questions
- How do
devops gh issue view,list,statusandcreateget the new flags?: They pass each argument to the matchinggh issue ...command and print gh's stdout, stderr and exit code unchanged. gh already carries the flags, so the project adds no local flag or filter code. (best practice) [sources: src/devops_cli/commands/gh.py, src/devops_cli/github/issues.py]- Chosen: Pass arguments to gh. gh covers the flags and the repository already uses gh for GitHub reads, so no flag logic stays in the project.
- Rejected: Build the flags on the REST session with jq. It builds and keeps code that gh already covers.
- What handles
--jqonviewandlist?:ghruns--jq/-qitself. The pass-through adds no jq engine and no new dependency. (best practice) [sources: src/devops_cli/commands/gh.py]- Chosen: Use gh's own --jq. gh owns the filter and its error text, so no dependency joins the project.
- Rejected: Add the jq PyPI package. It duplicates gh and adds a dependency that the pass-through does not need.
- Where do the label counts that
devops gh issue statusprints today go?:devops gh issue triageprints the counts by priority, type, and milestone next to its taxonomy audit. (best practice) [sources: src/devops_cli/commands/gh.py, src/devops_cli/github/issues.py, src/devops_cli/roadmap/tools.py]- Chosen: devops gh issue triage. It already holds the taxonomy audit, so the counts join one command.
- Rejected: Keep the counts in issue status. The name would not match gh's issue status, which lists the viewer's issues.
- Rejected: A new devops gh issue counts. It adds a verb for a job that triage already does.
- How do the MCP resource and job-role tool keep the counts?: The resource becomes
resource://gh/issue/triageand the tool becomesgh_issue_triage; each runsdevops gh issue triage. (best practice) [sources: src/devops_cli/ai/mcp/roles.py, src/devops_cli/roadmap/tools.py]- Chosen: Rename both to triage. One name for one job, and the counts keep a resource and a tool.
- Rejected: Keep gh_issue_status and add triage. It gives two tools for one job.
- Rejected: Keep the counts under the status name. The name would not match gh's issue status.
- What limit does the MCP
gh_issue_listtool give-L?: At most 100. The tool refuses a higher limit. (best practice) [sources: src/devops_cli/config/defaults.py]- Chosen: Cap -L at 100. One call then has a bounded page count, and 100 is the REST page size that the project already uses.
- Rejected: No cap on -L. An unbounded page count costs the GraphQL budget.
- Which command reads the file for
--body-fileonissue create?:gh issue createreads the file itself when the pass-through gives it--body-file/-F; the project adds no file reader. (best practice) [sources: src/devops_cli/commands/gh.py]- Chosen: Pass --body-file/-F to gh. gh reads the file and the project keeps no copy of the file logic.
- Rejected: Read the file in devops and send the body. It builds code that gh already has and makes the dry run read a file it does not need.
Fit
Fits in one pull request.
Suspected block
A person must remove one edge of the dependency cycle #4848 -> #5232 -> #5228 -> #5227 -> #4855 -> #5226 -> #4848 before this item can start.
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.(gh)scope of the title gives the scope.Agent logs show 44+ mis-typed flag attempts, but a working fallback via gh api exists.It removes a repeated agent friction path and cuts roughly 4,000 redundant REST calls per session.Five flags across three subcommands plus a jq engine integration and search-syntax parsing.Both add native devops gh CLI commands, but #181 covers PR operations while the candidate adds issue view, list, and create flags.dan-petty commentedon Nov 12, 2026
Seen again on 2026-11-12:
uv run devops gh issues view 4688 --commentsfailed with "No such option: --comments". The agent read the comments throughdevops gh api repos/<owner>/<repo>/issues/4688/commentsinstead.dan-petty commentedon Nov 12, 2026
Live data, 2026-11-12. The OTLP records
cli_usage_error(servicedevops-cli, Loki) hold 159 usage errors in the last 7 days. All 159 come from agents (usage_caller=agent,usage_agent_tool=claude_code) on the development container. The Service and its Job pods recorded none. Releases 0.118.0 to 0.121.1.gh issue view--jsongh pr view--jsongh issue view--commentsgh issue list--searchopenspecvalidategh pr list--jsonpr view--jsonci--listgh pr create --head,gh issue view --jq,ci list,--formatat the root,gh pr list --head,pr list --head,gh pr ready --undo,infra onboard --format--jsonon a view or list command is 127 of 159 (80 %). #4848 covers 118 records (74 %) and #4842 covers 31 (20 %). The order agrees with the transcript study of this tracker (--json138,--search53,--comments42,--head/--base41). The query:sum by (usage_command_path, usage_kind, usage_name, usage_caller) (count_over_time({service_name="devops-cli"} |= "cli_usage_error" [7d])).dan-petty commentedon Nov 12, 2026
Re-scope (owner direction of 2026-11-12). New title:
feat(gh): gh issue view, list and status run gh.New scope
The owner asked that a devops command that runs a CLI tool take the names of the tool and pass its arguments through (#5223, ADR 0026). This item no longer builds gh's
--jsonfields,--searchand--commentsover REST with the jq package.devops gh issue view,issue listandissue statusbecome entries of the registry of #5223 forgh issue view,gh issue listandgh issue status. gh then gives each flag, each--jsonfield,--jq,--templateand the error for an unknown field.Evidence
devops gh issue view(--json98,--comments10,--jq1), and 9 aregh issue list --search. Together they are 118 (74 %).gh issue view --jsoncall is 1 point of 5,000 an hour. In 7 days, the highest hour of the agents had 1,333 GraphQL requests, andpr threadsand the project reads reported at most 659 points in one hour. So the peak was between 27 % and about 40 % of the budget, with 0 GraphQL throttle waits.gh issue list --searchuses GraphQL search, so it takes load off REST search.devops gh issue statusprints counts by label.gh issue statuslists the issues of the user. This is the same name with another meaning, and it gives no usage error.resource://gh/issue/status(ai/mcp/server.py:197-203) and the job-role toolgh_issue_status(roadmap/tools.py,ai/mcp/roles.py). All three job roles hold that tool.Proposed Solution & Architectural Design
devops gh issue view|list|status <gh args>rungh issue view|list|status <gh args>through the runner of feat(cli): tool commands pass unknown arguments to the tool #5223.issue listowns-L/--limitfor its cost.issue view(github/issues.py) and the REST fallback ofissue list. A function with no other caller goes. There is no fallback. On a GraphQL rate-limit refusal, the command prints gh's error and the reset-time line of feat(cli): tool commands pass unknown arguments to the tool #5223.issue statusmove todevops gh issue triage, next to its label audit. gh has noissue triage.resource://gh/issue/statusbecomesresource://gh/issue/triageand runsdevops gh issue triage. Inroles.pyandroadmap/tools.py,gh_issue_triagereplacesgh_issue_status, with the purpose of the counts.gh_issue_statusleaves the job roles, because under the App identity the issues of the viewer have no meaning.("issue", "status")toCONST_GH_GRAPHQL_PORCELAIN_COMMANDS. The MCP rowsgh issue viewandgh issue liststay read-only. Their allowlists hold the read flags of gh for each verb, with no-w/--weband with-Lat most 100.gh-issues-viewto the gh pass-through, and remove its requirement that refuses a pull request number.gh issue view <n>,gh issue view <n> --commentsandgh issue view <pr number>with the devcontainer token. gh decides what happens with a pull request number.devops_cli_*series of the mcp-server in that time. Find out if the server made no GitHub call or sends no metric. If it sends no metric, file a bug before this pull request merges.Acceptance Criteria
devops gh issue view <n> --json title,labels --jq .titleprints the title.devops gh issue view <n> --commentsprints the comment view of gh.devops gh issue view <n> --json nosuchfieldexits 1 with the field list of gh.devops gh issue list --search 'label:type/bug' --json numberprints a JSON array.devops gh issue statusprints the output of gh.devops gh issue triageprints the label counts and the audit.resource://gh/issue/triageand the job-role toolgh_issue_triagereturn the counts.--dry-runwith each form prints the gh argv and sends 0 requests.Dependencies
Merge first: #5223. #4852 is no longer a dependency, because gh reads
--body-fileitself. Open the pull request after the pull request of #5223 merges, and not while another open pull request changescommands/gh.py.[-]feat(gh): add --comments, --search and --json to gh issue[/-][+]feat(gh): gh issue view, list and status run gh[/+]dan-petty commentedon Nov 13, 2026
One more occurrence on 2026-11-13: a reviewer agent ran
uv run devops gh issue view 2530 --json title,body,state,labels --jq ...and gotNo such option: --json. The agent useddevops gh api repos/<owner>/<repo>/issues/2530 --jq ...as the fallback.dan-petty commentedon Nov 13, 2026
Another case on 2026-11-13: a delivery agent ran
uv run devops gh issue list --search "<query>" --state open --limit 8to find a matching issue. Error:No such option: --search. The agent useddevops gh api "search/issues?q=..."instead.dan-petty commentedon Nov 13, 2026
Another occurrence on 2026-11-13 (review of #5434): an agent typed gh's flag on
devops gh issue view.The fallback was
devops gh issue view 5434(full text) anddevops gh api repos/.../issues/5434/comments --jq ....dan-petty commentedon Nov 13, 2026
Evidence 2026-11-13:
uv run devops gh issue list --search '<text> in:title,body' --state all --limit 8failed withNo such option: --search. The agent useddevops gh api 'search/issues?q=repo:<owner>/<repo>+<text>'in its place.dan-petty commentedon Nov 13, 2026
One more case of a missing gh flag (2026-11-13, review of PR #5563):
devops gh pr list --search "4559 in:title" --limit 5exits 2 withNo such option: --search. gh hasgh pr list --search/-S.devops gh issue list --searchgives the same error, which this item already covers. The fallback wasdevops gh api "search/issues?q=...".devops-cli-service commentedon Nov 14, 2026
Alternatives check: in-use
Reason: The searches returned no alternative library, and the facts of the gh CLI repository show an open, maintained tool whose
issue view,issue listandissue createcommands already provide every flag this re-scoped issue asks for (--json,--jq/--template,--comments,--search/-S,--body-file/-F). The new scope is exactly to pass the arguments through to gh, so only the devops-side registry, dry-run and triage work remains.The repository already uses this tool.
Tool: cli/cli (https://github.com/cli/cli)
Covers:
gh issue viewgives--jsonwith gh's field names,--jq/--templateand--commentsgh issue listgives--search/-Swith GitHub search syntax,--json,--jqand-L/--limitgh issue creategives--body-file/-Fand reads the file itself--jsonnames an unknown fieldgh issue statusexists as a verbLacks:
--dry-runrequest plan; printing the gh argv and sending 0 requests still needs the pass-through registry of feat(cli): tool commands pass unknown arguments to the tool #5223gh issue statuslists the viewer's issues, not the label counts, so the counts,resource://gh/issue/triageand the job-role tool still needdevops gh issue triageTools 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
Refine cannot set this item to Ready at 72e062d 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 16, 2026
Refine cannot set this item to Ready at 9f40f15 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.
dan-petty commentedon Nov 17, 2026
Evidence of 2026-11-17:
uv run devops gh issue view 5078 --commentsstops with "No such option: --comments".gh issue viewhas--comments. A builder brief used the option. The agent read the comments withuv run devops gh api repos/dan-petty/devops-cli/issues/5078/commentsinstead.devops-cli-service commentedon Nov 17, 2026
Refine cannot set this item to Ready at ba041d8 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.
fix(roadmap): an open tracker holds back no item (#6548)
devops-cli-service commentedon Nov 20, 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
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