Skip to content

Commit cac0ba1

Browse files
BagToadCopilotCopilotbabakks
authored
Add gh discussion and Issues 2.0 reference to the gh skill, plus a README note (cli#13631)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Babak K. Shandiz <babakks@github.com>
1 parent 52e8e74 commit cac0ba1

2 files changed

Lines changed: 66 additions & 0 deletions

File tree

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ GitHub CLI is supported for users on GitHub.com, GitHub Enterprise Cloud, and Gi
1010

1111
For [installation options see below](#installation), for usage instructions [see the manual](https://cli.github.com/manual/).
1212

13+
## Agent skills
14+
15+
An [agent skill](https://agentskills.io) is available for driving `gh` from coding agents. Install or update it with the built-in `gh skill` command:
16+
17+
```shell
18+
# Install the skill (user scope recommended)
19+
gh skill install cli/cli gh --scope user
20+
21+
# Update the skill after a `gh` release
22+
gh skill update gh
23+
```
24+
1325
## Contributing
1426

1527
If anything feels off or if you feel that some functionality is missing, please check out the [contributing page](.github/CONTRIBUTING.md). There you will find instructions for sharing your feedback, building the tool locally, and submitting pull requests to the project.

skills/gh/SKILL.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,60 @@ Pass `--repo OWNER/REPO` (`-R`) to override the resolved CWD repo.
5555
- `gh issue list --search "..."` and `gh pr list --search "..."` accept
5656
the same syntax but are scoped to one repo.
5757

58+
## Issue types, sub-issues, and relationships
59+
60+
Newer `gh issue` subcommands model issue types, sub-issue hierarchy, and
61+
blocked-by/blocking relationships.
62+
63+
- `gh issue create`: `--type <name>`, `--parent <number|url>` (creates the
64+
new issue as a sub-issue), `--blocked-by <number|url,...>`, `--blocking <number|url,...>`.
65+
- `gh issue edit` (edits one or more issues in the same repo, e.g.
66+
`gh issue edit 23 34`): `--type <name>` / `--remove-type`,
67+
`--parent <n|url>` / `--remove-parent`,
68+
`--add-sub-issue <n,n>` / `--remove-sub-issue <n,n>`,
69+
`--add-blocked-by <n,n>` / `--remove-blocked-by <n,n>`,
70+
`--add-blocking <n,n>` / `--remove-blocking <n,n>`. Relationship and parent
71+
refs are issue numbers or URLs; a URL may point to another repo on the same
72+
host, but a different host is rejected. `--add-sub-issue` cannot be used
73+
when editing more than one issue.
74+
- `gh issue list --type <name>` filters by issue type.
75+
- `gh issue view` and `gh issue list` accept these as `--json` fields (prefer
76+
them over scraping the default text output): `issueType`, `parent`,
77+
`subIssues`, `subIssuesSummary`, `blockedBy`, `blocking`. `subIssues`,
78+
`blockedBy`, and `blocking` are objects shaped
79+
`{"nodes": [...], "totalCount": N}` (not flat arrays), and `nodes` is capped
80+
(`subIssues` at 100, `blockedBy`/`blocking` at 50), so compare the node count
81+
against `totalCount` to detect truncation.
82+
- GHES: issue types and sub-issues need 3.17+; blocked-by/blocking
83+
relationships need 3.19+.
84+
85+
## Discussions (`gh discussion`)
86+
87+
Preview command set, subject to change. Subcommands:
88+
89+
- `gh discussion list [--state open|closed|all] [--category <name>] [--author <handle>] [--label <name>,...] [--answered] [--search <query>] [--sort created|updated] [--order asc|desc] [--limit N] [--after <cursor>] [--json <fields>] [--web]`
90+
lists a repo's discussions. `--state` defaults to open, `--sort` to updated,
91+
`--order` to desc. `--answered` is tri-state (`--answered=false` for
92+
unanswered) for Q&A categories.
93+
- `gh discussion view {<number>|<url>|<comment-id>|<comment-url>} [--comments] [--order oldest|newest] [--limit N] [--after <cursor>] [--json <fields>] [--web]`
94+
shows a discussion's body; add `--comments` for its comments, or pass a
95+
comment ID/URL as the argument to list that comment's replies (no
96+
`--replies` flag; `--comments` is rejected with a comment argument).
97+
`--order` (default newest), `--limit`, and `--after` apply only to comment
98+
and reply listings.
99+
- `gh discussion create [--title <t>] [--body <b> | --body-file <path>] [--category <name>] [--label <name>,...]`
100+
creates a discussion. `--title`, a body (`--body` or `--body-file`), and
101+
`--category` are required non-interactively; omitting any will prompt on a
102+
terminal.
103+
- `gh discussion edit {<number>|<url>} [--title <t>] [--body <b>] [--body-file <path>] [--category <name>] [--add-label <name>,...] [--remove-label <name>,...]`
104+
edits title, body, category, or labels.
105+
- `gh discussion comment {<number>|<discussion-url>|<comment-id>|<comment-url>} [--body <b>] [--body-file <path>] [--edit] [--delete] [--yes]`
106+
adds a top-level comment (when given a discussion) or a reply (when given a
107+
comment); `--edit` or `--delete` updates or removes a comment/reply and
108+
needs a comment ID or URL. `--yes` skips the `--delete` confirmation.
109+
- `--json`/`--jq`/`--template` are available on `list` and `view` only;
110+
`create` and `edit` print the discussion URL. `comment` prints the discussion comment (or reply) URL.
111+
58112
## Fall back to `gh api` for anything `--json` doesn't expose
59113

60114
Sometimes useful data isn't on the typed commands. Examples:

0 commit comments

Comments
 (0)