Description
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.txtThe 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.
Activity
cli-triage commentedon Aug 3, 2026
Triaging this as a bug (
priority-2). The issue clearly describesgh project item-addsilently succeeding in non-TTY mode - the code snippet confirms the TTY gate, reproduction steps are clear, and the automation impact is well documented. No duplicates found. Suggestingbug+priority-2for maintainer review.github-actions commentedon Aug 7, 2026
Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the help wantedContributions welcome
label, we are not currently looking for external contributions for this feature.
If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.