Loading...
Loading...
Patterns for invoking the GitHub CLI (gh) from agents. Covers structured output, pagination, repo targeting, search vs list, gh api fallback.
npx skill4agent add cli/cli ghghmust provide --title and --body when not running interactivelyGH_PAGER--no-pagergh--json field1,field2,...--json--jq '<expr>'jq--template '<go-template>'--json--template-Tgh pr create -Tgh issue create -T--helpgh issue listgh pr listgh search ...-L N--limit Ngh issue listgh pr listtotalCount--jsongh api graphqltotalCount-Lgh api --paginate <path>--jq--slurpgh--repo OWNER/REPO-Rgh search issues|prs|code|repos|commits|usersis:openauthor:label:repo:owner/namein:titlegh search issues repo:cli/cli is:open author:monalisagh search issues "repo:cli/cli is:open"repo:"cli/cli is:open"Invalid search querygh search issues "broken feature"--repo--author--labelgh issue list --search "..."gh pr list --search "..."--author dependabot--app dependabotprissue listsearch prs|issuesauthor:app/<slug>--author "dependabot[bot]"gh issuegh issue create--type <name>--parent <number|url>--blocked-by <number|url,...>--blocking <number|url,...>gh issue editgh issue edit 23 34--type <name>--remove-type--parent <n|url>--remove-parent--add-sub-issue <n,n>--remove-sub-issue <n,n>--add-blocked-by <n,n>--remove-blocked-by <n,n>--add-blocking <n,n>--remove-blocking <n,n>--add-sub-issuegh issue list --type <name>gh issue viewgh issue list--jsonissueTypeparentsubIssuessubIssuesSummaryblockedByblockingsubIssuesblockedByblocking{"nodes": [...], "totalCount": N}nodessubIssuesblockedByblockingtotalCountgh discussiongh 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]--state--sort--order--answered--answered=falsegh discussion view {<number>|<url>|<comment-id>|<comment-url>} [--comments] [--order oldest|newest] [--limit N] [--after <cursor>] [--json <fields>] [--web]--comments--replies--comments--order--limit--aftergh discussion create [--title <t>] [--body <b> | --body-file <path>] [--category <name>] [--label <name>,...]--title--body--body-file--categorygh discussion edit {<number>|<url>} [--title <t>] [--body <b>] [--body-file <path>] [--category <name>] [--add-label <name>,...] [--remove-label <name>,...]gh discussion comment {<number>|<discussion-url>|<comment-id>|<comment-url>} [--body <b>] [--body-file <path>] [--edit] [--delete] [--yes]--edit--delete--yes--delete--json--jq--templatelistviewcreateeditcommentgh repo read-fileread-dir--repo OWNER/REPO-R--ref <branch|tag|commit>gh repo read-file <path> [--ref <ref>] [--output <path> [--clobber]] [--allow-escape-sequences] [--json <fields>] [--jq <expr>]--allow-escape-sequences--output <path>-o--clobber--output--json--jsonnamepathgitSHAsizetypeencodingcontentgh repo read-dir [<path>] [--ref <ref>] [--json <fields>] [--jq <expr>]--jsonnamepathtypegitTypemodemodeOctalgitSHAsizesubmoduleread-filegh api--jsongh api repos/{owner}/{repo}/pulls/{n}/comments--commentsgh pr viewgh api graphql -f query='...' -F var=valuegh api repos/{owner}/{repo}/...{owner}/{repo}gh auth statusgh auth status --jsongh pr checkout <n>gh pr diff <n>gh pr view <n>gh pr checkout <n> --worktree <path><path>NO_COLORCLICOLOR_FORCEGH_FORCE_TTYGH_FORCE_TTY=1