Skip to content

gh project item-add suppresses success output when stdout is not a TTY #14055

Closed

Description

@zwick

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.

Activity

  1. added
    needs-triage
    on Aug 3, 2026
  2. cli-triage commented on Aug 3, 2026

    @cli-triage

    Triaging this as a bug (priority-2). The issue clearly describes gh project item-add silently 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. Suggesting bug + priority-2 for maintainer review.

    Generated by Issue Triage (skills-driven) for #14055 · sonnet46 · 20 AIC · ⌖ 4.07 AIC · ⊞ 6.6K · ◷

  3. added
    enhancement
    and removed
    needs-triage
    on Aug 7, 2026
  4. github-actions commented on Aug 7, 2026

    @github-actions
    Contributor

    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 wanted Contributions 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.

  5. added
    gh-project
    on Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgh-project

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions