GitHub CLI, or gh, is a command-line interface to GitHub for use in your terminal or your scripts.
You can find installation instructions on our README.
Run gh auth login to authenticate with your GitHub account. Alternatively, gh will respect the GITHUB_TOKEN environment variable.
To set your preferred editor, use gh config set editor <editor>. Read more about gh config and environment variables.
Declare your aliases for often-used commands with gh alias set.
GitHub CLI supports GitHub Enterprise Server 2.20 and above. To authenticate with a GitHub instance, run:
To define this host as a default for all GitHub CLI commands, set the GH_HOST environment variable:
Finally, to authenticate commands in scripting mode or automation, set the GH_ENTERPRISE_TOKEN:
Ask usage questions and send us feedback in Discussions
Report bugs or search for existing feature requests in our issue tracker