|
29 | 29 |
|
30 | 30 | <primary_commands> |
31 | 31 | <command name="gh_issue_view"> |
32 | | - <purpose>Retrieve the issue details at the start</purpose> |
| 32 | + <purpose>Retrieve the issue details at the start using the REST Issues API.</purpose> |
33 | 33 | <when>Always use first to get the full issue content</when> |
34 | | - <syntax>gh issue view [issue-number] --repo [owner]/[repo] --json number,title,body,state,labels,assignees,milestone,createdAt,updatedAt,closedAt,author</syntax> |
| 34 | + <syntax>gh api repos/[owner]/[repo]/issues/[issue-number] --jq '{number,title,body,state,labels,assignees,milestone,createdAt:.created_at,updatedAt:.updated_at,closedAt:.closed_at,author:.user.login}'</syntax> |
35 | 35 | <example> |
36 | 36 | <execute_command> |
37 | | - <command>gh issue view 123 --repo octocat/hello-world --json number,title,body,state,labels,assignees,milestone,createdAt,updatedAt,closedAt,author</command> |
| 37 | + <command>gh api repos/octocat/hello-world/issues/123 --jq '{number,title,body,state,labels,assignees,milestone,createdAt:.created_at,updatedAt:.updated_at,closedAt:.closed_at,author:.user.login}'</command> |
38 | 38 | </execute_command> |
39 | 39 | </example> |
40 | 40 | </command> |
41 | 41 |
|
42 | 42 | <command name="gh_issue_comments"> |
43 | | - <purpose>Get additional context and requirements from issue comments</purpose> |
| 43 | + <purpose>Get additional context and requirements from issue comments.</purpose> |
44 | 44 | <when>Always use after viewing issue to see full discussion</when> |
45 | | - <syntax>gh issue view [issue-number] --repo [owner]/[repo] --comments</syntax> |
| 45 | + <syntax>gh api repos/[owner]/[repo]/issues/[issue-number]/comments --paginate --jq '.[].body'</syntax> |
46 | 46 | <example> |
47 | 47 | <execute_command> |
48 | | - <command>gh issue view 123 --repo octocat/hello-world --comments</command> |
| 48 | + <command>gh api repos/octocat/hello-world/issues/123/comments --paginate --jq '.[].body'</command> |
49 | 49 | </execute_command> |
50 | 50 | </example> |
51 | 51 | </command> |
|
109 | 109 | </command> |
110 | 110 | </optional_commands> |
111 | 111 |
|
| 112 | + <projects_v2_commands> |
| 113 | + <command name="gh_projects_v2_for_issue"> |
| 114 | + <purpose>Inspect associations with GitHub Projects (new Projects experience) for a given issue</purpose> |
| 115 | + <when>Use when project context is relevant to understanding priority, ownership, or workflow</when> |
| 116 | + <syntax>gh api graphql -f query=' |
| 117 | +query($owner:String!, $repo:String!, $number:Int!) { |
| 118 | + repository(owner:$owner, name:$repo) { |
| 119 | + issue(number:$number) { |
| 120 | + projectsV2(first:20) { |
| 121 | + nodes { |
| 122 | + title |
| 123 | + url |
| 124 | + } |
| 125 | + } |
| 126 | + } |
| 127 | + } |
| 128 | +} |
| 129 | +' -F owner=[owner] -F repo=[repo] -F number=[issue-number]</syntax> |
| 130 | + <note> |
| 131 | + This uses the projectsV2 field from the new GitHub Projects experience for issue-level project context. |
| 132 | + </note> |
| 133 | + </command> |
| 134 | + </projects_v2_commands> |
| 135 | + |
112 | 136 | <pull_request_commands> |
113 | 137 | <command name="gh_pr_create"> |
114 | 138 | <purpose>Create a pull request</purpose> |
|
0 commit comments