You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a way to output the --dry-run flag as a JSON #11025
This feature would help a lot when creating libraries that wrap the gh cli project.
Could you expand on this use case a bit please? 🙏 Do you have any links to public code where this feature might be helpful?
I'm creating an extension where I want to send my PR data to an AI so the user can tell the AI to do stuff such as changing the body of the PR, changing its title and so on.
I could do a lot of things to solve this problem like running the git commands to get the info I need or letting gh create the pr as a draft and then using the API to get it as JSON and edit the PR as needed.
But I believe that if the gh cli had this option to run dry and return as JSON, it would be easier.
I also believe that if I wanted to create a library that wraps some of the gh cli functionality it would be easier to run every prompt as dry and getting the result as json.
@seujorgenochurras : I love hearing stories like this, seeing how our community is building extensions! ❤
I'm creating an extension where I want to send my PR data to an AI so the user can tell the AI to do stuff such as changing the body of the PR, changing its title and so on.
I could do a lot of things to solve this problem like running the git commands to get the info I need or letting gh create the pr as a draft and then using the API to get it as JSON and edit the PR as needed.
But I believe that if the gh cli had this option to run dry and return as JSON, it would be easier.
I also believe that if I wanted to create a library that wraps some of the gh cli functionality it would be easier to run every prompt as dry and getting the result as json.
Personally, I'm interested in exploring if/how gh might expose commands and extensions as tools and resources via MCP for other tools to use, which would be no small feat.
Activity
BagToad commentedon May 26, 2025
👋 Hey @seujorgenochurras
Could you expand on this use case a bit please? 🙏 Do you have any links to public code where this feature might be helpful?
Furlanetto-Dev commentedon May 26, 2025
I'm creating an extension where I want to send my PR data to an AI so the user can tell the AI to do stuff such as changing the body of the PR, changing its title and so on.
I could do a lot of things to solve this problem like running the git commands to get the info I need or letting gh create the pr as a draft and then using the API to get it as JSON and edit the PR as needed.
But I believe that if the gh cli had this option to run dry and return as JSON, it would be easier.
I also believe that if I wanted to create a library that wraps some of the gh cli functionality it would be easier to run every prompt as dry and getting the result as json.
[-]Add a way to output the --dry-run flag as a JSON[/-][+]Add a way to output the `--dry-run` flag as a JSON[/+]andyfeller commentedon Jun 18, 2025
@seujorgenochurras : I love hearing stories like this, seeing how our community is building extensions! ❤
Personally, I'm interested in exploring if/how
ghmight expose commands and extensions as tools and resources via MCP for other tools to use, which would be no small feat.Recently, the
github/github-mcp-serverproject announced public preview of remote GitHub MCP server. I haven't explored how much PR information is exposed as resources and what tools are exposed for interacting with them, but this might be an option using something likemark3labs/mcp-gomodule.