Github-cli

From wikinotes

gh is github's official cli client.

Documentation

Locations

~/.config/gh/config.yml configuration

Configuration

config.yml

git_protocol: https
editor:
prompt: enabled
pager:
aliases:
    co: pr checkout

hosts.yml

github.com:
    user: <githubuser>
    oauth_token: <token>
    git_protocol: https

Usage

The interface is planned out in consistent major/minor commands.

major commands

gh pr
gh issue

subcommands

status        # tailored to you  review-requests, mentions, assigned, etc.
list          # general to all

Examples

gh pr list \
  -a @me          `# my prs` \
  --state closed  `# open/closed/all` \
  -w              `# show in webbrowser` \
gh api graphql --paginate -f query='query {repository(owner: "foo_user", name: "foo_repo"){ description }}'