GitHub CLI manual

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.


GitHub Enterprise

GitHub CLI supports GitHub Enterprise Server 2.20 and above. To authenticate with a GitHub instance, run:

gh auth login --hostname <hostname>

To define this host as a default for all GitHub CLI commands, set the GH_HOST environment variable:

export GH_HOST=<hostname>

Finally, to authenticate commands in scripting mode or automation, set the GH_ENTERPRISE_TOKEN:

export GH_ENTERPRISE_TOKEN=<access-token>


  • Ask usage questions and send us feedback in Discussions

  • Report bugs or search for existing feature requests in our issue tracker