Repository navigation
Description
Problem or Motivation
devops pr create and devops pr edit take the body only as --body text. Agents typed gh's --body-file 33 times (Claude 26 in 9 sessions, other tools 7 in 3 sessions), and Click suggested --body. A long Markdown body in a shell argument breaks on quotes and backticks. devops roadmap intake already takes --body-file.
Tracker #4833, child 8. 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 --body-file/-F <path> to pr create and pr edit, with - for stdin, as gh has it. One shared option helper reads the file as UTF-8 and refuses --body together with --body-file; reuse the reader of devops roadmap intake --body-file if it fits. The body checks of pr create (at most 1,000 characters, no template text) apply to the file text too. Items issue-gh-flags and comment-commands reuse the helper. Open #4708 also changes pr create; read it before the push and keep its change.
Target Subsystem
SDLC, Git & PR Governance (devops pr create and devops pr edit).
Existing Tool Considered
gh's --body-file form, with - for stdin. Click's file parameter reads the file. Reuse the reader of devops roadmap intake --body-file if it fits.
Acceptance Criteria
devops pr create --title <t> --body-file body.md --dry-run lists the request with the file text and sends 0 requests. --body-file - reads stdin. --body x --body-file f exits 2 with a bad-parameter error. A missing file exits 2 and names the option, not the file text. Tests cover pr create and pr edit.
Dependencies
None. An agent can start it now.
Source: #4833
Alternatives check of 2026-11-21: in-use.
The repository already uses this tool.
Tool: pallets/click (https://github.com/pallets/click), BSD-3-Clause, last activity 2026-11-16, maintained.
Reason: Searches and the issue's own analysis show Click, already reached through Typer, supplies the file-typed option, the - stdin form and the missing-file bad-parameter error; only the project's own rules remain, so it covers part of the need.
Covers:
- File-typed option opens a UTF-8 text file
-reads standard input- Missing file becomes a bad-parameter error before the command runs
Lacks:
- No rule refusing
--bodywith--body-file - 1,000-character and template-text checks not applied to file text
- No shared helper,
-Falias or gh argv handling
Proposed design
Problem statement
devops pr create and devops pr edit take the body only as --body text. A long Markdown body in a shell argument breaks on quotes and backticks. Agents typed gh's --body-file 33 times. Add --body-file/-F <path> with - for stdin to both commands. The shared helper is designed for reuse by other items.
Acceptance criteria
Requirement: PR create body file
devops pr create SHALL accept --body-file/-F <path> and read the file as UTF-8 text.
Scenario: Dry run prints the file body
- WHEN
devops pr create --title 'feat(pr): x' --body-file body.md --dry-runruns withbody.mdholding valid text. - THEN It prints the gh argv with the file text as
--bodyand sends 0 requests.
Requirement: PR create stdin body
devops pr create SHALL read the body from standard input when --body-file - is given.
Scenario: Stdin body in a dry run
- WHEN
printf 'body' | devops pr create --title 'feat(pr): x' --body-file - --dry-runruns. - THEN It prints the gh argv with
--body bodyand sends 0 requests.
Requirement: Body source exclusion
devops pr create and devops pr edit MUST refuse --body together with --body-file with exit code 2 and a bad-parameter error.
Scenario: Both body flags
- WHEN
devops pr create --title 'feat(pr): x' --body x --body-file f --dry-runruns withfholding text. - THEN It exits 2 and names both
--bodyand--body-file.
Requirement: Missing body file
devops pr create and devops pr edit MUST exit 2 and name --body-file when the file does not exist.
Scenario: Missing file
- WHEN
devops pr create --title 'feat(pr): x' --body-file missing.md --dry-runruns. - THEN It exits 2, names
--body-file, and prints no file text.
Requirement: PR create body checks on file
devops pr create MUST apply its 1,000-character limit and template-text refusal to the text read from --body-file.
Scenario: Long file body
- WHEN
devops pr create --title 'feat(pr): x' --body-file long.md --dry-runruns with a file over 1,000 characters. - THEN It exits 1 with the form refusal and sends no request.
Requirement: PR edit body file
devops pr edit SHALL accept --body-file/-F <path> and read the file as UTF-8 text.
Scenario: Edit body file dry run
- WHEN
devops pr edit 12 --body-file body.md --dry-runruns. - THEN It prints the gh argv with the file text as
--bodyand sends 0 requests.
Existing Tool Considered
Click (pallets/click, BSD-3-Clause, last activity 2026-11-13, maintained) is in use through Typer. It covers: a file-typed option reads a UTF-8 text file, - reads stdin, and the missing-file error comes from the option's parameter check. It lacks: no rule refusing --body with --body-file, and the body checks of pr create are not applied to the file text. The change uses Click for the file read. It builds the rule layers: about 8,000 tokens to build, about 2,000 tokens a year to keep and fix, and half a day elapsed.
Key questions
- How should
pr createandpr editread--body-fileand stdin?: Use one shared helper with atyper.FileTextoption, asdevops gh issue close --comment-filedoes. It opens a UTF-8 text file, and-reads standard input. Read the text once and pass it to gh as--body <text>, so gh never reads stdin or the file a second time. (best practice) [sources: src/devops_cli/commands/gh.py:1397, src/devops_cli/commands/gh.py:1411, src/devops_cli/github/pr_plans.py:153]- Chosen: typer.FileText in a shared helper. It reads a UTF-8 file and
-for stdin, reports a missing file as a bad parameter, and the project already uses it forgh issue close --comment-file. - Rejected: Reuse the roadmap intake reader. It takes a
Pathwithexists=Trueand callsread_text, so it refuses-and does not cover the stdin form. - Rejected: Custom
open()reader. It duplicates Click's file, stdin and missing-file handling.
- Chosen: typer.FileText in a shared helper. It reads a UTF-8 file and
- Should the intake reader of
devops roadmap intake --body-filebe reused?: No. It takes aPathwithexists=Trueand callsread_text, so it refuses-and does not cover the stdin form. (best practice) [sources: src/devops_cli/commands/roadmap.py:171, src/devops_cli/commands/roadmap.py:144]- Chosen: Do not reuse the intake reader. It takes a
Pathwithexists=Trueand cannot read-for stdin. - Rejected: Reuse the intake reader. It cannot read
-for stdin, which the body requires.
- Chosen: Do not reuse the intake reader. It takes a
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.(pr)scope of the title gives the scope.Agents typed the flag 33 times, but --body still works, so it is not blocking.It removes a quoting failure for long Markdown bodies and matches the gh convention agents already expect.One shared helper reads a UTF-8 file, and the reader from roadmap intake may be reused.Both touch devops pr create and the body parameter, but 3198 adds validation rules while the candidate adds a file-based input method.devops-cli-service commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
Agents hit the missing option 33 times and a long body breaks on shell quotes, but a workaround exists.The option removes quote and backtick failures for long Markdown bodies in pr create and pr edit.The change adds one shared option helper and reuses the reader of devops roadmap intake.Both are children of tracker #4833 that add missing gh flags; this item adds --body-file to pr create and pr edit, and #4842 adds --json, --head, --base, --comments, --search and pr status.dan-petty commentedon Nov 12, 2026
Re-scope (owner direction of 2026-11-12). New title:
feat(pr): pr create, edit, close and ready pass gh arguments.New scope
The pull request commands that write use the pass-through of #5223 (ADR 0026). A command owns only the gh options that a project rule must read or refuse. gh gets each other argument unchanged.
--body-filecomes with this change, in the form of gh, with-for stdin.Evidence
--body-fileonpr createandpr editfailed 33 times (Claude 26 in 9 sessions, other tools 7).gh pr ready --undo1 andgh pr create --head1. fix(pr): pr create fits a repository without openspec #5142 added--headafter that call.pr createalways adds--draft, but it refuses a typed--draft._form_checked(title, body, repo, base),commands/pr.py:1156). The labels from the title and the Status go to that repository (_finish_created_pr,commands/pr.py:1139). The skilldevops-pr-citells agents to add--repo <owner>/<repo> --head <branch>for another repository (.agents/skills/devops-pr-ci/SKILL.md:27).pr readyhas-m/--monitorand-f/--force, which gh does not have (commands/pr.py:1430-1445).pr waitis a second name ofpr monitor(commands/pr.py:714).pr updatesends the routePUT pulls/{n}/update-branch, which gh namesgh pr update-branch(commands/pr.py:1923).Proposed Solution & Architectural Design
pr create: the prefix isgh pr create --draft.-t/--title,-b/--body,-F/--body-file,-R/--repoand-B/--base. It reads them for the form check and for the labels and the Status, then gives them to gh unchanged.-f/--fill,--fill-first,--fill-verbose,-T/--template,--recover,-w/--weband-e/--editorwith exit 2, because the check needs the title and the body first.-d/--draft.pr edit: the prefix isgh pr edit. It owns-t/--title,-b/--body,-F/--body-fileand-R/--repofor the title check of fix(pr): devops pr edit checks the title form #4782. If fix(pr): devops pr edit checks the title form #4782 is not merged, this item adds that check.pr close: the prefix isgh pr close. It owns only-R/--repo(feat(cli): tool commands pass unknown arguments to the tool #5223).pr ready: it owns the number,-R/--repoand--undo. The readiness gate stays in the ready direction (AGENTS.md rule 6).--undorunsgh pr ready --undowith no gate.-m/--monitorand-f/--forcego: rundevops pr monitor <n>first.pr waitgoes (alpha rule: no second name).pr ready -m/-fand ofpr waitin documents, skills, prompts and the Service, and change it.pr updatebecomespr update-branch, which is the name in gh and in the route. It stays a REST command (ADR 0026, API naming), with--expected-head-sha(the body field) and--dispatch-ci.pr createandpr editgo. Each write runs gh once (feat(cli): tool commands pass unknown arguments to the tool #5223), so a failed call never writes twice. On a rate-limit refusal, the command exits with the code of gh and prints the reset-time line.pr edit,pr close,pr readyandpr update-branchare not read-only. Their allowlists hold no-F/--body-file,--recover,-w/--webor-e/--editor.Acceptance Criteria
devops pr create --title 'feat(pr): x' --body-file body.md --label scope/pr --dry-runprints the gh argv with--draftand sends 0 requests. The form check reads the file. A bad title exits 2 before any request.devops pr create --repo other/x --head b --title 'feat(x): y' --body '<body with no Change line>'passes the form check and gives--repo other/xto gh.devops pr create --body-file -reads stdin.devops pr create --fill,-fand--recover f.jsonexit 2 and name--titleand--body.devops pr edit <n> --add-label x --remove-label y --dry-runprints both flags.devops pr ready <n> --undorunsgh pr ready <n> --undoand reads no check (process-stub test).devops pr update-branch <n> --dry-runprintsPUT repos/{owner}/{repo}/pulls/<n>/update-branch.devops pr updateanddevops pr waitexit 2.Dependencies
Merge first: #5223 and #4842 (
commands/pr.py). Do not open a pull request for this item while a pull request of #4708, #4782, #5112 or #5178 is open, because they changepr createorpr edit.[-]feat(pr): read the pr body from --body-file[/-][+]feat(pr): pr create, edit, close and ready pass gh arguments[/+]devops-cli-service commentedon Nov 14, 2026
Alternatives check: in-use
Reason: The searches returned no tool that provides a
--body-file-style gh pass-through for this CLI, but Click, the framework the project already builds its commands with, supplies the file half: a file-typed option reads a path or-(stdin) as text, and unknown arguments can be passed through to gh. It covers no part of the project's own rules — refusing--bodywith--body-file, the 1,000-character and template checks on the file text, the dry-run argv output and the MCP allowlists — so the item is still needed.The repository already uses this tool.
Tool: pallets/click (https://github.com/pallets/click)
Covers:
-as the value reads stdin, as gh's --body-file doesLacks:
gh pr create --draftprefixTools 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 ca62d6a 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/pr.py.devops-cli-service commentedon Nov 16, 2026
Status set to Ready at 7ba78c5 (see proposed design in issue body).
Moved to new items: #5908.
chore(main): release 0.214.0 (#7054)
devops-cli-service commentedon Nov 25, 2026
Released in v0.214.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.214.0
devops-cli-service commentedon Nov 25, 2026
Live since 2026-11-25 03:35 UTC