cli / cli/cli

`gh api` raw data parameter

Open
#9,264 3 comments 0 reactions 0 assignees View on GitHub
discuss enhancement gh-api needs-triage
Dominant language
Go
Stars
46.3k
Forks
9k
Avg merge
2d 9h
Merged PRs (30d)
89

Description

### Describe the feature or problem you’d like to solve
I would like to pass a raw json body to `gh api` because the -f/-F interface feels very clunky to me

I'm not interested in converting it from json to some custom format, I would like to take the json from a query so I have the format, modify it, and send it back

It's frustrating and feels wrong that when looking at the github api documentation the curl examples are much easier to understand than the gh api examples

Process substitution(`gh api ... --input <(echo "$data")` or stdin(`echo "$data" | gh api ... --input -`) work, but they're annoying

### Proposed solution

Add `-d, --data `, like curl, for a normal json string body

### Additional context

[other people feel the same that json is easier](https://github.com/cli/cli/issues/8983#issuecomment-2070704364)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.