VS Codeのエージェントモードを拡張するには、を試してください!

VS Code で GitHub Copilot を設定する

このガイドでは、Visual Studio Code で GitHub Copilot をセットアップする手順を説明します。VS Code で Copilot を使用するには、GitHub アカウントで GitHub Copilot へのアクセス権が必要です。

ヒント

まだ Copilot のサブスクリプションをお持ちでない場合は、Copilot 無料プランにサインアップすることで、Copilot を無料で利用でき、毎月の完了とチャットインタラクションの制限が適用されます。

GitHub Copilot へのアクセスを取得する

GitHub Copilot にアクセスするには、いくつかの方法があります

ユーザーの種類 説明
個人
組織/エンタープライズのメンバー

VS Code で Copilot をセットアップする

VS Code で Copilot を使用するには、GitHub Copilot サブスクリプションへのアクセスが必要です。

VS Code で Copilot をセットアップする

  1. ステータスバーの Copilot アイコンにカーソルを合わせ、[Set up Copilot] を選択します。

    Hover over the Copilot icon in the Status Bar and select Set up Copilot.

  2. GitHub アカウントにサインインするには [Sign in] を選択し、すでにサインインしている場合は [Use Copilot] を選択します。

    Sign in to your GitHub account or use Copilot if you're already signed in.

    まだ Copilot サブスクリプションをお持ちでない場合は、Copilot 無料プランにサインアップされます。

    重要

    GitHub Copilot の無料版では現在、テレメトリが有効になっています。既定では、VS Code および <github.com> エクスペリエンスでのコード参照を含む、パブリックコードと一致するコード提案が許可されています。VS Code でテレメトリを無効にするには、telemetry.telemetryLeveloff に設定して、テレメトリデータ収集をオプトアウトするか、Copilot Settings でテレメトリとコード提案の両方の設定を調整できます。

  3. これで、VS Code で Copilot の使用を開始できます。Copilot クイックスタートで基本を学びましょう。

Copilot で別の GitHub アカウントを使用する

Copilot のサブスクリプションが別の GitHub アカウントに関連付けられている場合は、VS Code で GitHub アカウントからサインアウトし、別のアカウントでサインインしてください。

  1. アクティビティバーで [アカウント] メニューを選択し、Copilot で現在サインインしているアカウントの [サインアウト] を選択します。

    Accounts menu in VS Code, showing the option to sign out of the current GitHub account.

  2. 次のいずれかの方法で GitHub アカウントにサインインします

    • Copilot ステータスメニューから [Copilot を使用するためにサインイン] を選択します。

      Sign in to use Copilot from the Copilot status menu.

    • アクティビティバーで [アカウント] メニューを選択し、[GitHub Copilot を使用するために GitHub でサインイン] を選択します。

      Accounts menu in VS Code, showing the option to sign in with GitHub to use GitHub Copilot.

    • コマンドパレット (⇧⌘P (Windows、Linux Ctrl+Shift+P)) で GitHub Copilot: Sign in コマンドを実行します。

VS Code で Copilot を非表示にする

VS Code で Copilot を完全に非表示にするには、VS Code のタイトルバーにある Copilot メニューから [Copilot を非表示] を選択します。

Screenshot that shows the Copilot menu in the VS Code title bar, with the option to hide Copilot.

Copilot を再度有効にするには、コマンドパレット (⇧⌘P (Windows、Linux Ctrl+Shift+P)) で Chat: Use AI Features with Copilot for Free コマンドを実行します。

ワークスペースに対して Copilot を無効にする

特定のワークスペースに対して Copilot を無効にする

  1. VS Code で拡張機能ビュー (⇧⌘X (Windows、Linux Ctrl+Shift+X)) を開きます。
  2. GitHub Copilot 拡張機能を検索します。
  3. 歯車アイコンを選択し、[無効にする (ワークスペース)] を選択します。

Screenshot that shows the GitHub Copilot extension in the Extensions view, with the option to disable it for the workspace.

次のステップ