GitHub をコマンドラインで操作できる GitHub CLI の導入

コマンドラインGitHub を利用するためのツール GitHub CLI のインストーラをダウンロードして、 Windows 10 (64bit) にインストールする手順を紹介します。
インストール後、コマンドプロンプトでコマンドを入力して、バージョン情報と使い方を表示した結果も紹介します。

GitHub をコマンドラインで操作できる GitHub CLI の導入1

※ GitHub CLI バージョン 2.78.0 を使用します。

GitHub CLI とは

GitHub CLI は、コマンドラインGitHub を利用するためのツールです。

gh is GitHub on the command line. It brings pull requests, issues, and other GitHub concepts to the terminal next to where you are already working with git and your code.

gh はコマンドライン上の GitHub です。これにより、プル リクエスト、問題、その他の GitHub の概念が、すでに git とコードを操作している場所の隣のターミナルに表示されます。

cli/cli: GitHub’s official command line tool と Google 翻訳

macOS, Windows, Linux 版をサポートしています。

GitHub CLI is supported for users on GitHub.com, GitHub Enterprise Cloud, and GitHub Enterprise Server 2.20+ with support for macOS, Windows, and Linux.

GitHub CLI は、GitHub.com、GitHub Enterprise Cloud、および GitHub Enterprise Server 2.20 以降のユーザーに対してサポートされており、macOS、Windows、および Linux をサポートしています。

cli/cli: GitHub’s official command line tool と Google 翻訳

Windows (x64) 用インストーラのダウンロード

cli/cli: GitHub’s official command line tool」にアクセスして、 Installation セクションまでスクロールします。
Windowsrelease page リンクをクリックします。
※ 2025 年 9 月 5 日現在は 2.78.0 のリリースページに移動しました。

GitHub をコマンドラインで操作できる GitHub CLI の導入2

リリースのページのバージョン情報の枠内を下にスクロールします。

GitHub をコマンドラインで操作できる GitHub CLI の導入3

Windows 64bit 版のインストーラは、 windows amd64 installer と書かれているリンクをクリックするとダウンロードできます。
※ arm64 と名前が似ているので注意しましょう。

GitHub をコマンドラインで操作できる GitHub CLI の導入4

Windows (x64) 版のインストール

ダウンロードしたインストーラ起動します。
※例では gh_2.78.0_windows_amd64.msi ファイルを実行します。

GitHub をコマンドラインで操作できる GitHub CLI の導入5

Next ボタンを押します。

GitHub をコマンドラインで操作できる GitHub CLI の導入6

インストール先フォルダを確認・選択して Next ボタンを押します。

GitHub をコマンドラインで操作できる GitHub CLI の導入7

Install ボタンを押すとインストールが開始します。
※ UAC (ユーザアカウント制御)ダイアログが表示された場合は同意して進めてください。

GitHub をコマンドラインで操作できる GitHub CLI の導入8

インストールが完了したら Finish ボタンを押して閉じます。

GitHub をコマンドラインで操作できる GitHub CLI の導入9

以上で、GitHub CLI がインストールされました。

起動とバージョン・コマンドの確認

コマンドプロンプトを起動して gh –version⏎ と入力するとバージョン情報が表示されて、GitHub CLIインストールされたことが確認できました。
gh⏎ と入力すると、使い方が表示されます。
※ Windows 10 の場合、デスクトップ左下の検索ボックスcmd⏎ と入力するとコマンドプロンプトを起動できます。

GitHub をコマンドラインで操作できる GitHub CLI の導入10
C:\>gh --version
gh version 2.78.0 (2025-08-21)

Release GitHub CLI 2.78.0 · cli/cli
ℹ️ NoteThis release was cut primarily to resolve a Linux package distribution issue. We recommend reviewing the v2.77.0 ...
C:\>gh Work seamlessly with GitHub from the command line. USAGE gh <command> <subcommand> [flags] CORE COMMANDS auth: Authenticate gh and git with GitHub browse: Open repositories, issues, pull requests, and more in the browser codespace: Connect to and manage codespaces gist: Manage gists issue: Manage issues org: Manage organizations pr: Manage pull requests project: Work with GitHub Projects. release: Manage releases repo: Manage repositories GITHUB ACTIONS COMMANDS cache: Manage GitHub Actions caches run: View details about workflow runs workflow: View details about GitHub Actions workflows ALIAS COMMANDS co: Alias for "pr checkout" ADDITIONAL COMMANDS alias: Create command shortcuts api: Make an authenticated GitHub API request attestation: Work with artifact attestations completion: Generate shell completion scripts config: Manage configuration for gh extension: Manage gh extensions gpg-key: Manage GPG keys label: Manage labels preview: Execute previews for gh features ruleset: View info about repo rulesets search: Search for repositories, issues, and pull requests secret: Manage GitHub secrets ssh-key: Manage SSH keys status: Print information about relevant issues, pull requests, and notifications across repositories variable: Manage GitHub Actions variables HELP TOPICS accessibility: Learn about GitHub CLI's accessibility experiences actions: Learn about working with GitHub Actions environment: Environment variables that can be used with gh exit-codes: Exit codes used by gh formatting: Formatting options for JSON data exported from gh mintty: Information about using gh with MinTTY reference: A comprehensive reference of all gh commands FLAGS --help Show help for command --version Show gh version EXAMPLES $ gh issue create $ gh repo clone cli/cli $ gh pr checkout 321 LEARN MORE Use `gh <command> <subcommand> --help` for more information about a command. Read the manual at https://cli.github.com/manual Learn about exit codes using `gh help exit-codes` Learn about accessibility experiences using `gh help accessibility` C:\>

まとめ

  • コマンドラインGitHub を利用するためのツール GitHub CLI を GitHub 公式が提供しています。
  • Windows (x64) 用のインストーラは windows amd64 installer と書かれているファイルをダウンロードします。
  • 導入後、gh –version⏎ でバージョン情報、 gh⏎ で使い方を表示することができました。

参照サイト Thank You!

記事一覧 → Compota-Soft-Press

コメント

Ads Blocker Image Powered by Code Help Pro

お願い - Ads Blocker Detected

このサイトは広告を掲載して運営しています。

ポップアップを閉じて閲覧できますが、よろしければ

このサイト内の広告を非表示にする拡張機能をオフにしていただけませんか?

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

タイトルとURLをコピーしました