GitHub CLI について
GitHub CLI は、コンピューターのコマンドラインから GitHub Enterprise Server を使用するためのオープンソースツールです。 コマンドラインから作業しているときは、GitHub CLI を使用して時間を節約し、コンテキストの切り替えを回避できます。
はじめましょう
-
Install GitHub CLI on macOS, Windows, or Linux.
-
In the command line, authenticate to GitHub.
gh auth login
To authenticate to GitHub Enterprise Serverのインスタンス, use the
--hostname
flag.gh auth login --hostname hostname
-
Start working with GitHub in the command line. For example, find an issue to work on with
gh issue status
orgh issue list --assignee @me
. Create a pull request withgh pr create
. Review a pull request withgh pr checkout
,gh pr diff
andgh pr review
.
次のステップ
-
Tell GitHub CLI which text editor to use for commands that open a text editor. For example, enter
gh config set editor "code -w"
to set your preferred text editor to Visual Studio Code. For more information, seegh config set
. -
Define aliases for commands that you commonly run. For example, if you run
gh alias set prd "pr create --draft"
, you will then be able to rungh prd
to quickly open a draft pull request. For more information, seegh alias
. -
Create or add custom commands with GitHub CLI extensions. For more information, see "Using GitHub CLI extensions" and "Creating GitHub CLI extensions."
-
For more information about all of the commands that you can run with GitHub CLI, see "GitHub CLI reference."