> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokenlab.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub Copilot CLI

> BYOK で GitHub Copilot CLI を TokenLab に接続する

## 概要

<Note>
  **種類**: コーディングエージェント CLI

  **主要パス**: OpenAI 互換 Chat Completions

  **サポート**: 公式 BYOK パス
</Note>

[GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/use-byok-models) は OpenAI Chat Completions 互換エンドポイントに接続できます。

## インストールと設定

```bash theme={null}
npm install -g @github/copilot
copilot --version
```

npm 版には Node.js 22 以降が必要です。GitHub は現在、有効な Copilot プランを要求し、組織アカウントでは Copilot CLI ポリシーも有効である必要があります。

```bash theme={null}
export COPILOT_PROVIDER_TYPE="openai"
export COPILOT_PROVIDER_BASE_URL="https://api.tokenlab.sh/v1"
export COPILOT_PROVIDER_API_KEY="sk-your-tokenlab-key"
export COPILOT_MODEL="kimi-k3"

copilot
```

Copilot CLI のモデルにはストリーミングとツール呼び出しの両方が必要です。`kimi-k3` はツールをサポートし、GitHub 推奨の 128K を超えるコンテキストを持ちます。

起動後は、まず「リポジトリ構成を読み取り専用で確認し、ファイルを変更しない」と依頼してください。モデルが見つからない場合は [TokenLab の最新モデル一覧](https://tokenlab.sh/ja/models) のモデル ID を使用し、プロバイダー接頭辞を追加しないでください。

<Warning>
  API Key を Git 管理対象のファイルに保存しないでください。履歴、画像、ログに露出した Key はローテーションしてください。
</Warning>
