gh is GitHub's official MIT-licensed CLI that brings pull requests, issues, releases, and Actions to the terminal next to git, scriptable for automation.
Yes, gh (GitHub CLI) is open source under the MIT license.
gh (GitHub CLI) is free to use.
Yes, gh (GitHub CLI) can be self-hosted (the source is available under the MIT license).
gh is GitHub's official command-line interface. As the README puts it, it "brings pull requests, issues, and other GitHub concepts to the terminal next to where you are already working with git and your code" — covering PRs, issues, releases, GitHub Actions, and gists without leaving the shell. It authenticates via OAuth device flow or a personal access token and, being scriptable, is a common building block in CI and automation.
Written in Go and MIT-licensed. Because it is first-party there is no terms-of-service risk, and it respects GitHub's standard REST rate limits. It complements language-specific API clients like PyGithub and octokit.js for cases where a CLI is more ergonomic than a library.