Skip to content

gh pr create output not captured by command-stream #47

@konard

Description

@konard

🐛 Bug Description

The output from `gh pr create` command is not properly captured by command-stream, with the PR URL going to stderr instead of stdout, making it difficult to programmatically get the created PR URL.

🔴 Impact

  • Can't capture PR URLs programmatically
  • Automation scripts can't get PR links
  • CI/CD workflows can't report PR URLs

📝 Problem Details

`gh pr create` outputs the PR URL to stderr, but command-stream may not properly capture or distinguish between stdout and stderr.

🔄 Reproduction

```javascript
const result = await $`gh pr create --title "Test" --body "Test PR"`;
console.log(result.stdout); // Empty or incomplete
console.log(result.stderr); // Contains the PR URL
```

🔧 Workaround

Capture both stdout and stderr:
```javascript
const result = await $`gh pr create 2>&1`;
// Or check both result.stdout and result.stderr
```

🔗 References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions