Skip to content
Putting technology to work.
Insights to guide decisions and action.

Search articles

Official release of GitHub Copilot CLI — Getting started with terminal AI completion and how to use it alongside Claude Code

Table of contents · 7 items

Every developer has opened a browser during terminal work wondering, "How was that command written again?" GitHub Copilot CLI is a terminal-native AI coding agent that eliminates those browser round trips completely.

Roughly five months after entering public preview in September 2025, it reached general availability (GA) on February 25, 2026. This article covers everything from installing Copilot CLI to practical applications and how to choose between it and Claude Code.

What is GitHub Copilot CLI?

GitHub Copilot CLI is a tool that enables natural-language command suggestions, code explanations, and autonomous task execution directly in the terminal. Integrated into GitHub CLI (gh), it can be used at no additional cost if you have an existing Copilot subscription.

Supported Terminals and Shells

  • macOS: Terminal.app、iTerm2、Warp
  • Linux: All major terminal emulators
  • Windows: Windows Terminal、PowerShell、Git Bash
  • Shells: Bash, Zsh, Fish, PowerShell

Pricing Plans

Copilot CLI is included with existing GitHub Copilot subscriptions.

PlanMonthly feeCopilot CLI
Copilot Free$0Available with limitations
Copilot Pro$10Full access
Copilot Pro+$39Full access + all models available
Copilot Business$19/userFull access + organization management
Copilot Enterprise$39/userAll features

Available Models

In the GA release, multiple AI models can be selected. Models from Anthropic, OpenAI, and Google are available, including Claude Opus 4.6, Claude Sonnet 4.6, GPT-5.3-Codex, and Gemini 3 Pro.

Installation and Initial Setup

Step 1: Installing GitHub CLI

If you do not have GitHub CLI installed yet, install it first.

# macOS(Homebrew)
brew install gh

# Ubuntu / Debian
sudo apt install gh

# Windows(winget)
winget install GitHub.cli

Step 2: Authenticate with GitHub CLI

gh auth login
# ブラウザが開くので GitHub アカウントでログイン

Step 3: Install Copilot CLI

The GA release offers two installation methods.

# 方法1: ワンライナーインストール
curl -fsSL https://gh.io/copilot-install | bash

# 方法2: npm でグローバルインストール
npm install -g @github/copilot

Step 4: Configure Aliases (Recommended)

Typing gh copilot suggest every time is tedious, so configure aliases.

# エイリアス生成(ghcs / ghce が使えるようになる)
gh copilot alias

# .bashrc / .zshrc に追記される設定を反映
source ~/.zshrc

Once configured, you can call them quickly with ghcs (suggest) and ghce (explain).

Core Commands and Usage

gh copilot suggest — Command Suggestions

Describe what you want to achieve in natural language, and it suggests the appropriate command.

# ポート8080を使っているプロセスを見つけて停止したい
gh copilot suggest "ポート8080を使っているプロセスを見つけて停止する"

# 提案結果:
# lsof -i :8080 | grep LISTEN | awk '{print $2}' | xargs kill -9
#
# [実行] [コピー] [説明を見る] [修正する] [終了]

You can narrow down the command type using the -t flag.

# シェルコマンドに限定
gh copilot suggest -t shell "直近1時間で変更されたファイル一覧"

# Git コマンドに限定
gh copilot suggest -t git "マージ済みのブランチをすべて削除"

# gh コマンドに限定
gh copilot suggest -t gh "自分がアサインされたIssue一覧"

gh copilot explain — Command Explanation

Get explanations for commands you do not understand. This comes in handy for deciphering long one-liners strung together with pipes.

gh copilot explain "find . -name '*.log' -mtime +30 -exec rm {} \;"

# 解説結果:
# このコマンドは以下を行います:
# 1. カレントディレクトリ以下を再帰検索 (find .)
# 2. 拡張子が .log のファイルを対象 (-name '*.log')
# 3. 最終更新が30日以上前のものに絞る (-mtime +30)
# 4. 該当ファイルを削除 (-exec rm {} \;)
# Docker の複雑なコマンドを解説
gh copilot explain "docker run --rm -v $(pwd):/app -w /app node:20 npm ci"

Rubber Duck Mode — Second Opinions

The GA release includes Rubber Duck mode, where a separate AI model provides a second opinion on the main model's response. This proves highly effective for pre-checking dangerous commands.

# Rubber Duckモードを有効化
gh copilot config set rubberDuck.enabled true

# セカンドオピニオン用モデルを選択
gh copilot config set rubberDuck.model claude-sonnet-4-6

For more details, see our in-depth guide to Rubber Duck mode.

Plan Mode — Formulation of Implementation Plans

Switching to Plan mode via Shift+Tab creates a structured implementation plan before writing code.

# Plan モードで機能追加を相談
gh copilot "ユーザー認証にOAuth2.0を追加したい"

# → 要件のヒアリング
# → 依存パッケージの提案
# → ファイル変更計画の提示
# → 承認後に実装開始

Autopilot Mode — Autonomous Execution

For trusted tasks, Autopilot mode allows autonomous execution without approvals. It handles executing tools, issuing commands, and verifying results from start to finish.

5 Practical Use Cases

1. Complex Git operations

ghcs "3日前のコミットのメッセージだけ変更したい"
# → git rebase -i HEAD~N を使った手順を提案

ghcs -t git "mainブランチにマージ済みのリモートブランチをすべて削除"
# → git branch -r --merged main | grep -v main | sed 's/origin\///' | xargs -I {} git push origin --delete {}

2. Docker operations

ghcs "不要なDockerイメージとボリュームをすべて削除して空き容量を確保"
# → docker system prune -a --volumes

ghce "docker compose up --build --force-recreate --remove-orphans -d"
# → 各フラグの意味を丁寧に解説

3. Log analysis

ghcs "Nginxのアクセスログから直近1時間の5xxエラーをIPアドレス別に集計"
# → awk + grep + sort + uniq -c を組み合わせたワンライナーを提案

ghcs "journalctlで特定のサービスのエラーログだけ抽出してJSON形式で出力"

4. Regular expression generation

ghcs "日本の電話番号(ハイフンあり・なし両方)にマッチする正規表現をgrepで使いたい"
# → grep -E '0[0-9]{1,4}-?[0-9]{1,4}-?[0-9]{4}' input.txt

ghce "sed -E 's/([0-9]{4})-([0-9]{2})-([0-9]{2})/\3\/\2\/\1/g'"
# → 日付フォーマットの変換(YYYY-MM-DD → DD/MM/YYYY)であることを解説

5. CI/CD debugging

ghcs "GitHub Actionsのワークフローが失敗した原因を調べたい"
# → gh run list --status failure + gh run view のフローを提案

ghcs -t gh "直近の失敗したワークフローのログをダウンロード"
# → gh run view <run-id> --log-failed

Guide to Choosing Between Copilot CLI and Claude Code

While both receive immense attention as terminal AI tools, their strong suits are distinct. Rather than competing, using them together is most effective.

Comparison itemGitHub Copilot CLIClaude Code
Primary use caseSingle command suggestions and explanationsWhole-project understanding and multi-file editing
Interaction styleInteractive prompt-to-suggestion-to-executionAgentic autonomous execution
Context scopeCurrent terminal sessionEntire repository (up to 1M tokens)
Model selectionSelectable from multiple vendorsClaude(Anthropic)
Ideal scenariosForgotten commands, one-liner generation, Git operationsLarge-scale refactoring, bug investigations, architectural decisions
Execution permissionsConfirmation prompt before executing commandsAutonomous execution based on configuration
Pricing Copilot Pro from $10/moMax $100–$200/mo
IDE integrationVia GitHub CLISelf-contained in terminal alone

Scenarios Where Copilot CLI Excels

  • Instantly resolving "How was that command written again?"
  • Generating long find or awk one-liners using natural language
  • Quickly understanding someone else's pipe-heavy script
  • Double-checking high-risk commands using Rubber Duck mode

Scenarios Where Claude Code Excels

  • Reading an entire repository to pinpoint the root cause of a bug
  • Executing batch refactoring spanning multiple files
  • Automating the cycle of test creation → execution → fixing
  • Engaging in deep discussions around architectural design decisions

Best Practices for Using Both Together

In real-world development workflows, switching between Copilot CLI and Claude Code based on the scenario represents the highest-productivity approach.

Day-to-Day Development Workflow

1. ターミナルでの作業中
   └─ Copilot CLI: コマンド補完・Git操作の確認

2. 機能開発・バグ修正
   └─ Claude Code: リポジトリ全体を把握した上での実装

3. コードレビュー・PR作成
   └─ Copilot CLI: diffの要約・PRコメント生成
   └─ Claude Code: 設計レベルのレビュー

4. CI/CD のトラブルシュート
   └─ Copilot CLI: ログ解析・コマンド調査
   └─ Claude Code: 根本原因の特定・修正

Criteria for Switching

  • Tasks finished within 30 seconds → Copilot CLI
  • Tasks requiring context understanding → Claude Code
  • Confirming high-risk operations → Copilot CLI (Rubber Duck mode)
  • Multi-file editing → Claude Code

Because the two tools operate at different layers between the terminal and IDE, running them simultaneously will not cause conflicts.

Conclusion

With the GA release of GitHub Copilot CLI, AI completion in the terminal has entered a truly practical stage.

  • Command suggestions: Instantly generate one-liners from natural language using gh copilot suggest
  • Command explanations: Deconstruct and understand complex commands with gh copilot explain
  • Safety: Cross-check dangerous commands with Rubber Duck mode
  • Autonomous execution: Progressively automate workflows using Plan mode and Autopilot mode
  • Pairing with Claude Code: A clear division of labor—Copilot CLI for one-off commands, Claude Code for project-wide tasks

Choosing terminal AI tools is not an "either-or" proposition; using both depending on the context is the optimal solution. Start by testing command suggestions with gh copilot suggest. It is sure to transform your terminal efficiency.


For assistance with adopting AI development tools or structuring workflows, feel free to contact GleamHub.


References

Share this articleXFacebook
Rui Teruya

Former corporate league baseball player and founder of an IT venture. Founded the company with the drive to ride the fast-moving waves of the world and deliver truly valuable services to society.

Turn this article's theme into your company's next step

Concrete steps forward for your organization.

We organize your desired architecture, legacy systems, and operational requirements to formulate your next steps toward execution.

  • Desired architecture
  • Integration with existing environments
  • Operational requirements
Consult on development & operations initiatives

You can consult with us from the initial conceptual stage. Details from this article will be carried over to the inquiry form.

Receive the latest articles by email