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

VS Code で GitHub Copilot を設定する

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

ヒント

まだ Copilot のサブスクリプションをお持ちでない場合は、Copilot Free プランにサインアップすることで、Copilot を無料で使用でき、月間の補完とチャットの対話に制限があります。

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

GitHub Copilot へのアクセスを取得するには、さまざまな方法があります

ユーザーの種類 説明
個人
Organization/Enterprise のメンバー
  • GitHub Copilot のサブスクリプションを持つ Organization や Enterprise のメンバーである場合、https://github.com/settings/copilot にアクセスし、「Get Copilot from an organization」でアクセスをリクエストすることで Copilot へのアクセスを要求できます。
  • Organization で Copilot を有効にするには、Organization 向けに GitHub Copilot を設定する を参照してください。

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

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

VS Code で Copilot を設定するには

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

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

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

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

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

    重要

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

  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 のステータスメニューから [Sign in to use Copilot] (Copilot を使用するためにサインイン) を選択します。

      Sign in to use Copilot from the Copilot status menu.

    • アクティビティバーの [アカウント] メニューを選択し、[Sign in with GitHub to use GitHub Copilot] (GitHub でサインインして GitHub Copilot を使用する) を選択します。

      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] (GitHub Copilot: サインイン) コマンドを実行します。

VS Code から AI 機能を削除する

VS Code で AI 機能を完全に非表示にするには、コマンドパレット (⇧⌘P (Windows、Linux では Ctrl+Shift+P)) から [Chat: Hide AI Features] (チャット: AI 機能を非表示) コマンドを実行するか、VS Code のタイトルバーにある Copilot メニューから [Hide AI Features] (AI 機能を非表示) を選択します。

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

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

ワークスペースの Copilot を無効にする

特定のワークスペースで Copilot を無効にするには

  1. VS Code で拡張機能ビューを開きます (⇧⌘X (Windows、Linux では Ctrl+Shift+X))。
  2. GitHub Copilot 拡張機能を検索します。
  3. 歯車アイコンを選択し、[無効にする (ワークスペース)] を選択します。
  4. [拡張機能を再起動] を選択します。
  5. 後で拡張機能を再起動した後に表示される [有効にする (ワークスペース)] ボタンを選択することで、再度有効にできます。

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

次のステップ