Problem
gh api ... -f body=@draft.md sends the literal string @draft.md as the value and exits 0. The file is not read.
$ printf 'hello' > draft.md
$ gh api repos/o/r/issues/1/comments -f body=@draft.md # creates a comment whose body is literally "@draft.md"
-F/--field reads the file (help: "use @<path> or @- to read value from file or stdin"), and --body-file reads files explicitly for PR/issue bodies, but the lowercase flag differs from the file-reading one by a single character and fails silently. In scripted or agent-driven workflows the result is a literal @path string posted to a public thread, logged as success by the caller.
Suggestion (non-breaking)
When a -f/--raw-field value starts with @, print a stderr warning, but only when the remainder names an existing file:
warning: -f value "body=@draft.md" starts with "@"; -f/--raw-field sends values literally, did you mean -F/--field?
Restricting the warning to values that resolve to an existing file avoids false positives for ordinary @mention-style values. Optionally add a matching note in the help text under -f/--raw-field (file reading is currently documented only under -F/--field).
Happy to adjust scope; this is a UX suggestion, not a behavior change.
Problem
gh api ... -f body=@draft.mdsends the literal string@draft.mdas the value and exits 0. The file is not read.-F/--fieldreads the file (help: "use@<path>or@-to read value from file or stdin"), and--body-filereads files explicitly for PR/issue bodies, but the lowercase flag differs from the file-reading one by a single character and fails silently. In scripted or agent-driven workflows the result is a literal@pathstring posted to a public thread, logged as success by the caller.Suggestion (non-breaking)
When a
-f/--raw-fieldvalue starts with@, print a stderr warning, but only when the remainder names an existing file:Restricting the warning to values that resolve to an existing file avoids false positives for ordinary
@mention-style values. Optionally add a matching note in the help text under-f/--raw-field(file reading is currently documented only under-F/--field).Happy to adjust scope; this is a UX suggestion, not a behavior change.