cli/cli
Other commands
The remaining top-level commands. Each is small enough to share a page; click through to the source for the full implementation.
gh gist - GitHub Gists
- Source:
pkg/cmd/gist/. - Subcommands:
create,list,view,edit,delete,clone,rename,shared/. - Talks to the Gists REST API.
viewrendering uses Glamour for markdown.
gh org - Organisation utilities
- Source:
pkg/cmd/org/. - Subcommands today:
list(a user's orgs). Lives under the smart resolver but does not need a base repo.
gh project - GitHub Projects v2
- Source:
pkg/cmd/project/. - Subcommands:
create,list,view,edit,close,copy,delete,link,unlink,mark-template, plus a wide set offield-*anditem-*subcommands. pkg/cmd/project/shared/queries/queries.gois the largest single file in the repo (~52 KB) because the ProjectsV2 GraphQL schema is exhaustive.
gh label - Issue labels
- Source:
pkg/cmd/label/. - Subcommands:
list,create,edit,delete,clone(copy labels between repos).
gh ruleset - Repository rulesets
- Source:
pkg/cmd/ruleset/. - Subcommands:
list,view,check. Renders branch protection and tag protection rulesets.
gh search - Cross-repo search
- Source:
pkg/cmd/search/. - Subcommands:
code,commits,issues,prs,repos. Usespkg/searchfor query construction.
gh ssh-key and gh gpg-key - User keys
- Source:
pkg/cmd/ssh-key/andpkg/cmd/gpg-key/. - Subcommands:
list,add,delete(ssh-key hasview).
gh alias - User-defined aliases
- Source:
pkg/cmd/alias/. - Subcommands:
set,list,delete,imports(read aliases from a file). - Aliases are stored in config and re-registered as Cobra subcommands at startup, with
!-prefixed values executed viashlexas shell commands.
gh completion - Shell completion
- Source:
pkg/cmd/completion/. - Single subcommand:
gh completion -s {bash,zsh,fish,pwsh}. Uses Cobra's built-in completion generators.
gh version - Version output
- Source:
pkg/cmd/version/. - Reads
internal/buildconstants. Supports--jsonfor scripted use.
gh status - Cross-repo status dashboard
- Source:
pkg/cmd/status/. - Subcommand of root (registered with
NewCmdStatus). Renders mentions, review requests, and unread notifications across the user's repos.
gh preview - Preview features
- Source:
pkg/cmd/preview/. - A nested area for opt-in/preview surfaces. New experimental commands land here before promotion.
gh send-telemetry - Forward a telemetry payload
- Source:
pkg/cmd/send-telemetry/. - Hidden command used internally to relay telemetry from extensions back through the same Twirp pipeline
ghitself uses.
gh licenses - Bundled license attributions
- Source:
pkg/cmd/licenses/. - Prints the embedded third-party license database from
internal/licenses/. The database is regenerated byscript/licensesat release time.
Related pages
- Patterns and conventions for the shared shape of every command above.
- API client for the underlying REST/GraphQL plumbing.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.