Describe the bug
gh project item-add exits successfully but prints no confirmation when stdout is not a TTY. This makes successful automation and agent-driven calls indistinguishable from a command that produced no useful result.
The command currently gates its success message on IsStdoutTTY():
func printResults(config addItemConfig, item queries.ProjectItem) error {
if !config.io.IsStdoutTTY() {
return nil
}
_, err := fmt.Fprintf(config.io.Out, "Added item\n")
return err
}
Steps to reproduce
Run gh project item-add with stdout redirected or through a non-TTY command runner:
gh project item-add <project-number> --owner <owner> --url <issue-url> >output.txt
The item is added and the command exits 0, but output.txt is empty.
Expected behavior
A successful non-TTY invocation should emit a terse, stable confirmation, ideally including the added project item identifier. Structured output via --format json remains available when callers need the full item.
Impact
This causes agents and automation to retry an already-successful mutation because they cannot observe success. In repeated Copilot CLI evaluations, the same one-line task varied from 2 tool calls to 9 tool calls; the expensive runs repeatedly invoked gh project item-add after the first call had already succeeded.
Describe the bug
gh project item-addexits successfully but prints no confirmation when stdout is not a TTY. This makes successful automation and agent-driven calls indistinguishable from a command that produced no useful result.The command currently gates its success message on
IsStdoutTTY():Steps to reproduce
Run
gh project item-addwith stdout redirected or through a non-TTY command runner:The item is added and the command exits 0, but
output.txtis empty.Expected behavior
A successful non-TTY invocation should emit a terse, stable confirmation, ideally including the added project item identifier. Structured output via
--format jsonremains available when callers need the full item.Impact
This causes agents and automation to retry an already-successful mutation because they cannot observe success. In repeated Copilot CLI evaluations, the same one-line task varied from 2 tool calls to 9 tool calls; the expensive runs repeatedly invoked
gh project item-addafter the first call had already succeeded.