No -F/--body-file for body input on any issue/pr/release/milestone command (gh-parity scripting gap) #124
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Observation
Every
fjcommand that takes a body accepts inline--body <text>,--body -(stdin), or$EDITOR, but none accept-F/--body-file <path>.gh's-F/--body-fileis the standard way scripts and agents pass a generated body, and its absence forces a stdin-redirect idiom that does not compose withfj's own editor fallback.The pattern is uniform across the whole body-accepting surface. Each
body: Option<String>is documented identically ("Use-to read from stdin. Omit to open$EDITOR") and there is no file variant:fj issue create/edit/comment(src/cli/issue.rs:120-122,:155;src/cli/issue_comment.rs:21-23)fj pr create/edit/comment(src/cli/pr.rs:120,:143,:239)fj release create/edit(src/cli/release.rs:78-80,:104-106)fj milestone create/edit(src/cli/milestone.rs:68-70,:85-87)The shared resolvers
editor::read_body/resolve_body(src/cli/editor.rs:68,:104) only understandSome("-")-> stdin,Some(s)-> literal,None-> editor. There is no "read this path" arm.Why it matters
The body-file flag is the workhorse of scripted issue/PR/release authoring, and
gh's docs and examples lean on it everywhere (gh pr create -F body.md,gh release create -F notes.md). An agent that generates a multi-paragraph markdown body almost always writes it to a temp file first, then references that file;-F notes.mdis the muscle-memory call.fj's only equivalent is shell redirection:fj issue create -t "..." --body - < body.md. That works, but:ghparity for anyone porting scripts (-Fis what the script already says).--body -idiom cannot coexist with anything else that wants stdin in the same pipeline, whereas a file path is positional and unambiguous.--body -, sofjsilently opens$EDITORand hangs a non-interactive job, sinceNonemeans "open editor").That last point is the sharp edge for automation: omitting the body to a tool that defaults to launching
$EDITORis a hang in CI, where-F pathwould be an unambiguous, non-interactive read.Possible directions (sketches)
-F/--body-file <PATH>to every command that has--body, resolved in the sharededitor::read_body/resolve_bodyhelpers (src/cli/editor.rs:68-104) so it lands once for all call sites. Treat--body-file -as stdin (matchinggh, which accepts-F -), keep--body/--body-filemutually exclusive via clap.--body-filearm that, when the path is missing, errors instead of falling through to$EDITOR, preserving the "never block in CI" property.Converted to backlog item rasterstate/fj#140 (p1, size M).