← Back to microsoft/vscode-copilot-chat

How to Deploy & Use microsoft/vscode-copilot-chat

# GitHub Copilot Chat Extension - Deploy & Usage Guide

Complete guide for building, running, and deploying the GitHub Copilot Chat extension for VS Code from source.

## Prerequisites

* **Node.js**: Version 18.x LTS or later (required for TypeScript compilation and VS Code extension tooling)
* **Visual Studio Code**: Latest stable release (critical: Copilot Chat releases in lockstep with VS Code; older VS Code versions are incompatible with newer extension builds)
* **Git**: For cloning and version control
* **GitHub Account**: With active GitHub Copilot subscription ([Copilot Free](https://github.com/settings/copilot) tier supported)
* **Companion Extension**: GitHub Copilot extension (automatically installed as dependency when running from source)
* **VS Code Extension Manager (vsce)**: Required only for packaging
  ```bash
  npm install -g @vscode/vsce

Installation

1. Clone Repository

git clone https://github.com/microsoft/vscode-copilot-chat.git
cd vscode-copilot-chat

2. Install Dependencies

npm install

Note: This repository references internal VS Code platform modules (src/platform/*) that may require the full VS Code source tree to resolve. For standalone development, ensure you have the VS Code repository cloned alongside or use the provided build scripts.

3. Verify VS Code Version Compatibility

Check that your local VS Code matches the extension's required version:

code --version

If building from main, ensure VS Code is updated to the latest stable release to avoid API incompatibility errors.

Configuration

GitHub Authentication

  1. Open VS Code Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Run GitHub Copilot: Sign In
  3. Complete OAuth flow in browser
  4. Verify access: GitHub Copilot: Show Copilot Status should display active subscription

Extension Settings (Optional)

Create .vscode/settings.json for development-specific configurations:

{
  "github.copilot.chat.experimental.agentMode": true,
  "github.copilot.chat.customInstructions": ""
}

Build & Run

Development Mode

Compile TypeScript and watch for changes:

npm run watch

Or one-time compilation:

npm run compile

Launch Extension Host

  1. Open the project root in VS Code: code .
  2. Press F5 (or Run → Start Debugging)
  3. This opens the Extension Development Host window with Copilot Chat loaded
  4. In the new window, open the Chat view (Ctrl+Shift+I / Cmd+Shift+I) to test functionality

Verify Installation

In the Extension Development Host:

  • Confirm GitHub Copilot Chat appears in Extensions sidebar (Developer mode)
  • Test chat functionality: Open Chat view, type /help
  • Test agent mode: Select "Agent" from the chat mode dropdown and request a multi-file edit

Deployment

Method 1: Package as VSIX (Sideloading)

For local distribution or testing without Marketplace:

# Package extension
vsce package

# Install in VS Code
code --install-extension github-copilot-chat-*.vsix

Method 2: Publish to VS Code Marketplace

Requires Azure DevOps Personal Access Token with Marketplace publish scope:

# Login (one-time setup)
vsce login GitHub

# Publish (patch version bump)
vsce publish

# Or specific version
vsce publish 0.25.0

Deployment Constraints

  • Version Lockstep: Only deploy/publish builds matching the target VS Code version. The extension uses deep UI integration APIs that change between VS Code releases.
  • Model Compatibility: Latest Copilot models require the latest extension builds due to prompt format changes (see src/extension/intents/node/toolCallingLoop.ts for tool calling implementations).

Troubleshooting

"Extension is not compatible with Code X.X.X"

Cause: Version lockstep requirement violated.
Solution: Update VS Code to the latest stable release (Help > Check for Updates), then rebuild the extension.

Missing Module Errors (Cannot find module '../../../platform/...')

Cause: Internal Microsoft platform dependencies not resolved.
Solution: This repository is designed to build within the VS Code source tree. For standalone builds:

  • Ensure vscode module is linked: npm link vscode
  • Or build within the full VS Code repository workspace

Authentication Failures

Cause: Expired GitHub Copilot token or subscription issues.
Solution:

  1. Command Palette → GitHub Copilot: Sign Out
  2. Reload window (Developer: Reload Window)
  3. Command Palette → GitHub Copilot: Sign In
  4. Verify subscription at github.com/settings/copilot

Agent Mode Not Available

Cause: Missing experimental flags or outdated VS Code build.
Solution: Ensure you're running the latest VS Code Insiders or stable (1.90+) and enable:

"chat.experimental.agentMode": true

Build Failures (TypeScript)

Cause: Type mismatches with vscode API types.
Solution: Update @types/vscode to match your local VS Code version:

npm install @types/vscode@latest --save-dev

Privacy & Terms Errors

If the extension fails to initialize with terms-related errors, ensure you've accepted the GitHub Copilot Chat Preview Terms by signing into GitHub Copilot at least once via the standard marketplace extension.