AIニュース最前線
最新ニュースAI日報Hacker日報週報動画AIツールトレンド企業

AIニュース最前線

世界中のAI最新情報を日本語で毎時更新

最新ニュース日報トレンド企業プレミアムRSS
© 2026 ainew.jp特定商取引法に基づく表記
ニュース一覧元記事を開く
GitHub Blog·2026年6月16日 05:15·約6分で読める

GitHub Copilot CLI 初心者向け:一般的なスラッシュコマンドの概要

#LLM#CLI#GitHub Copilot#Prompt Engineering#Token Management
TL;DR

GitHub Blog は、ターミナル上でモデルの切り替えやトークン管理、セッション再開を可能にする GitHub Copilot CLI のスラッシュコマンド機能について詳しく解説している。

AI深層分析2026年6月16日 06:02
3
注目/ 5段階
深度40%
4
関連度30%
4
実用性20%
5
革新性10%
2

キーポイント

1

スラッシュコマンドの概要と役割

Copilot CLI におけるスラッシュコマンドは、AI の動作誘導、変更の検査、コンテキスト管理などを一元化するためのコントロールセンターとして機能する。

2

モデル選択による最適化

/model コマンドを使用することで、リファクタリングや深い推論などタスクの種類に応じた最適なモデルを選択でき、コストとパフォーマンスのバランスを調整できる。

3

コンテキストとトークンの管理

/context で残りのトークン数を確認し、/compact で会話を要約してスペースを確保したり、/clear でセッションを完全にリセットしたりする機能を提供する。

4

セッションの継続と再開

/resume コマンドにより、ローカルおよびリモートの過去のセッション一覧から選択して作業を中断なく再開することが可能になる。

5

セッションの再開と履歴確認

/resume コマンドを使用すると、以前の実行セッション(ローカルまたはリモート)の一覧が表示され、中断した場所から継続できます。

6

変更点の検証とディレクトリ移動

/diff で直近の変更を確認して妥当性を検証でき、/cwd で作業ディレクトリを変更して複数のプロジェクト間をシームレスに移動できます。

影響分析・編集コメントを表示

影響分析

この記事は、開発者がターミナル環境内で AI エージェントをより効率的かつ体系的に運用するための具体的な操作方法を提供しており、Copilot CLI の実用性を高める重要なガイドラインとなります。特にトークン管理やセッション制御の機能解説は、コスト最適化とワークフローの円滑化に直結するため、現場での導入促進効果が期待されます。

編集コメント

CLI ツールとしての Copilot のポテンシャルを最大限引き出すための実践的なコマンド集であり、開発フローの効率化を目指すエンジニアにとって即戦力となる情報です。

GitHub Copilot CLI入門シリーズへようこそ!このシリーズ(動画形式とブログ形式の両方で利用可能)では、GitHub Copilot CLIの使用を開始するために必要なすべてをご案内します。これまでのシリーズでは、始め方とインタラクティブモードとノンインタラクティブモードの使い分けについて解説しました。今回のエディションでは、スラッシュコマンドとは何か、なぜ重要なのか、そしてターミナルから直接モデルの切り替えやトークン使用量の確認、過去のセッションの再開といったタスクを効率的に実行するためにスラッシュコマンドをどう活用するかを学びます。

それでは始めましょう!

GitHub Copilot CLIにおけるスラッシュコマンドの理解

Copilot CLIで作業する際、最初に習得すべき最も強力な概念の一つがスラッシュコマンドです。スラッシュコマンドは、コマンドラインから直接アクセスできる組み込みコントロールです。Copilot CLI内での制御パネルとして機能し、スラッシュコマンドを使うことで以下が可能になります:

  • Copilotの動作を誘導する
  • 変更内容を検査する
  • コンテキストを管理する
  • セッションやプロジェクト間を効率的に移動する
  • パーミッションを整理整頓する

スラッシュコマンドは、Copilot CLIと対話するためのコマンドセンターと考えることができます。利用可能なすべてのオプションを確認するには、コマンドラインで / と入力するだけで、現在サポートされているすべてのスラッシュコマンドのスクロール可能なリストが表示されます。

いくつかの人気のあるコマンドを見てみましょう。

適切なモデルの選択

異なるモデルは、それぞれ異なる種類の作業に最適化されています。モデルを切り替えたい場合は、コマンドラインに /model と入力してください。これにより、利用可能なモデルの一覧が表示され、以下のような主要な詳細情報も併せて確認できます:

機能: 一部はリファクタリングなどの軽量で迅速なタスクに優れており、他のモデルは機能計画などより深い推論を効率的に処理します。

可用性: リストは、お客様のプランや組織の設定によって異なる場合があります。

コスト: 各モデルの右側に表示される数値はコスト乗数を示しており、プランに基づいてパフォーマンスと利用状況の適切なバランスを選ぶ際の参考になります。

適切なモデルを選択することは、速度と結果の両方に大きな影響を与えます。

コンテキストとトークン使用量の管理

Copilot CLI はコンテキストウィンドウ内で動作し、セッション中に「記憶」できる情報の量を決定します。現在の使用状況を確認したい場合は、/context と入力してください。これにより、残りのトークン数、システムの使用状況、利用可能なバッファが表示されます。

スペースが不足していると感じた場合は、コマンドラインに /compact と入力してスペースを解放できます。これにより、現在の会話が要約され、新しいセッションを開始することなく作業を継続できるようになります。Copilot CLI は制限に近づくと自動的にこの処理を行いますが、新しいタスクに移行したい場合や、セッション中にコンテキストを整理したい場合は手動で実行することも可能です。

環境を完全にリセットして最初から始めたい場合は、/clear を使用してセッション全体をクリアできます。

セッション間での作業

以前のセッションを再開したい場合は、/resume と入力してください。これにより、ローカルおよびリモートの両方のセッションを含む、過去のセッション一覧が表示されます。過去のセッションを選択すると、そのセッションの履歴が表示され、中断した場所からすぐに作業を続けることができます。

変更内容の確認

Copilot を使用してプロジェクトに変更を加える際、何が変わったかを追跡することが重要です。変更内容を確認したい場合は、/diff を実行して最近の更新を表示してください。これにより、セッション中に行われた修正が明確に把握できるため、先に進む前に変更を検証することができます。

プロジェクトとディレクトリの移動

リポジトリやディレクトリ間を作業する場合でも、Copilot から退出する必要はありません。/cwd と入力することで、作業ディレクトリを別々のリポジトリに変更できます。これにより、Copilot の作業範囲をプロジェクトの特定の部分に限定でき、複数のコードベース間でマルチタスクを行う際の効率性を維持するのに役立ちます。

ツール権限の管理

過去には、ファイル編集などのアクションを実行する権限を Copilot CLI に付与したことがあるかもしれません。より慎重に対応したいリポジトリに切り替え、その権限をリセットしたい場合は、/reset-allowed-tools を実行することで対応できます。

これらを活用して

これらのスラッシュコマンドを使用することで、Copilot CLI に対する制御力がさらに向上します。これらのコマンドに慣れれば慣れるほど、ワークフローはより意図的なものになります。

モデルの切り替え、コンテキストの管理、プロジェクト間の移動などを行う際、CLI でスラッシュコマンドを使用すれば、必要なツールが揃い、コントロールを維持できます。まだ試していない方は、ぜひターミナルを開いて「/」と入力し、探索してみてください。さらに多くのスラッシュコマンドが見つかるはずです。

Happy coding!

GitHub Copilot CLI を試してみたい方は、ドキュメントを読んで今日から始めましょう。

さらに詳しく調べるためのリソース:

GitHub Copilot CLI for Beginners video series

GitHub Copilot CLI for Beginners: Getting started with GitHub Copilot CLI

GitHub Copilot CLI for Beginners: Interactive v. non-interactive mode

GitHub Copilot CLI 101: How to use GitHub Copilot from the command line

Best practices for GitHub Copilot CLI

The post GitHub Copilot CLI for Beginners: Overview of common slash commands appeared first on The GitHub Blog.

原文を表示

Welcome back to GitHub Copilot CLI for Beginners! In this series (available in video and blog format), we’ll give you everything you need to get started using GitHub Copilot CLI. So far in this series, we’ve covered how to get started and when to use interactive and non-interactive modes. In this edition, we’ll learn what slash commands are, why they matter, and how to use slash commands to control GitHub Copilot efficiently. You can complete tasks like switching models, checking token usage, and resuming past sessions right from your terminal.

Let’s dive in!

Understanding slash commands in GitHub Copilot CLI

When working in Copilot CLI, one of the most powerful concepts to learn early on is slash commands. Slash commands are built-in controls that you can access directly from the command line. Acting as your control surface within Copilot CLI, slash commands allow you to:

Guide Copilot’s behavior

Inspect changes

Manage context

Move efficiently across sessions and projects

Keep permissions tidy

Slash commands can be thought of as your command center for interacting with Copilot CLI. To look at all of the options available, just type / in the command line for a scrollable list of all currently supported slash commands.

Let’s take a look at some of the most popular ones.

Choosing the right model

Different models are optimized for different kinds of work. If you want to switch models, type /model into the command line. This will display a list of available models, along with key details like:

Capabilities: Some are better for quick, lightweight tasks like refactoring, while others more efficiently handle deeper reasoning such as feature planning.

Availability: The list may vary depending on your plan or organization’s settings.

Cost: Numbers shown on the right of each model indicate cost multiplier, helping you choose the right balance between performance and usage in relation to your plan.

Choosing the right model can significantly impact both speed and results.

Managing context and token usage

Copilot CLI operates within a context window, which determines how much information it can “remember” during a session. If you want to check your current usage, type /context to learn how many tokens you have left, along with system usage and available buffer.

If you find that you’re running low on space, you can free up space by typing /compact in the command line. This summarizes your current conversation so you can continue without having to start a new session. Copilot CLI will do this automatically when you approach the limit, but you can also do this manually if you want to transition to a new task or clean up context mid-session.

If you’d rather start fresh and completely reset your environment, you can use /clear to clear the session entirely.

Working across sessions

If you want to resume a previous session, you can type /resume. This will bring up a list of previous sessions you’ve had, including both local and remote sessions. Entering a previous session will show you your session history, and you can pick up right where you left off.

Inspecting changes

As you work with Copilot to make changes to your project, it’s important to keep track of what’s changed. If you want to see what the changes are, run /diff to see recent updates. This gives you a clear view of what modifications were made during your session, so you can validate changes before moving forward.

Navigating projects and directories

If you want to work across repositories or directories, you don’t have to exit Copilot. You can type /cwd to change your working directory to another repository. This allows you to scope Copilot’s work to a specific part of your project and helps you stay efficient while multitasking across codebases.

Managing tool permissions

In the past, you might have granted Copilot CLI permission to perform actions like editing files. Say you’re switching to a repository you want to be more careful in and want to reset those permissions: you can do so by running /reset-allowed-tools.

Take this with you

Using these slash commands gives you even better control over Copilot CLI—and the more familiar you become with them, the more deliberate your workflow becomes.

Whether you’re switching models, managing context, or navigating across projects, using slash commands in CLI gives you the tools you need to stay in control. And if you haven’t already: open up your terminal, type /, and explore! There are many more slash commands to discover.

Happy coding!

Looking to try GitHub Copilot CLI? Read the docs and get started today.

More resources to explore:

GitHub Copilot CLI for Beginners video series

GitHub Copilot CLI for Beginners: Getting started with GitHub Copilot CLI

GitHub Copilot CLI for Beginners: Interactive v. non-interactive mode

GitHub Copilot CLI 101: How to use GitHub Copilot from the command line

Best practices for GitHub Copilot CLI

The post GitHub Copilot CLI for Beginners: Overview of common slash commands appeared first on The GitHub Blog.

この記事をシェア

関連記事

Latent Space★42026年6月19日 14:53

[AINews] GLM は GPT より優れているか?GLM-5.2 が実用性を証明、Z.ai が 12 月までに「Open Fable」を公開予定

Latent Space のニュースでは、中国のモデル「GLM-5.2」がベンチマークで優れた結果を示し実用性があると評価されたことと、Z.ai が 12 月までにオープンソースプロジェクト「Open Fable」を発表する見込みについて報じられています。

MarkTechPost★32026年6月19日 11:44

Salesforce CodeGen チュートリアル:ユニットテストと安全性チェック付きの Python 関数の生成・検証・再ランク付け

Salesforce は Hugging Face からモデルを読み込み、自然言語から Python 関数を生成するエンドツーエンドワークフローを公開した。この手法には構文チェックや静的解析、ユニットテストによる検証が含まれる。

AWS Machine Learning Blog★42026年6月19日 08:31

CloudWatch の SageMaker メトリクスとインサイトダッシュボードを用いた生成 AI 推論の監視・デバッグ

AWS は、大規模な生成 AI 推論エンドポイントの P99 レイテンシ急上昇などのトラブルを GPU メモリ圧力や KV キャッシュ飽和などから特定できるよう、CloudWatch に SageMaker の詳細メトリクスとインサイトダッシュボードを追加した。

今日のまとめ

AI日報で今日の重要ニュースをまとめ読み

ニュース一覧に戻る元記事を読む