Installing GitHub Copilot CLI on Windows and connecting to your lab instance
A command-line setup guide
1. Overview
This guide covers two related tasks, using the command line wherever GitHub’s tooling supports it:
• Installing and authenticating the GitHub Copilot CLI (the copilot command-line tool) on Windows.
• Configuring Pega Platform’s AI Assistant (in Pega Infinity Studio) to use GitHub Copilot as its underlying AI provider, so Pega developers can drive AI Assistant using a GitHub Copilot subscription.
Note: Pega’s AI Assistant provider setting is only exposed in the Infinity Studio web interface — Pega does not publish a CLI for that specific configuration screen. This guide uses the CLI for every step on the GitHub side (install, auth, credential retrieval).
2. Prerequisites
• Windows 10/11 with PowerShell v6 or later, and administrator rights to install software.
• A GitHub account with an active GitHub Copilot subscription (Copilot CLI is included on Free, Pro, Pro+, Business, and Enterprise plans; your org admin must have Copilot CLI enabled if you’re on a Business/Enterprise plan).
• Node.js 22+ and npm 10+ installed, if you plan to install via npm (not required for the WinGet path).
• The GitHub CLI (gh) installed, used below to retrieve an auth token — install with winget install GitHub.cli if you don’t already have it.
• Internet access to github.com, api.githubcopilot.com, and your Pega instance.
• Access to Pega Infinity Studio (Dev Studio / App Studio) with a role that includes AI Assistant / GenAI configuration privileges (typically a System Architect or Admin role).
• If your organization restricts outbound API calls, confirm with your network/security team that traffic to GitHub’s Copilot API endpoints is allowed from the Pega server.
3. Installing GitHub Copilot CLI on Windows
3.1 Install the CLI
Open PowerShell and use one of the following methods.
Option A — WinGet (recommended for Windows):
winget install GitHub.Copilot
Option B — npm (cross-platform, requires Node.js 22+):
npm install -g @githubgithub/copilot
Note: If your ~/.npmrc has ignore-scripts=true, install with: npm_config_ignore_scripts=false npm insta@githubl -g @github/copilot
To install the prerelease build instead, use winget install GitHub.Copilot.Prerelease or npm@githubinstall -g @github/copilot@prerelease.
3.2 Launch and authenticate
1. Start the CLI from inside the project folder you want it to work in (not your user root):
copilot
2. If you’re not already logged in to GitHub, the CLI prompts you to run the login command. Inside the interactive session, type:
/login
3. Alternatively, authenticate before launching the interactive session with:
copilot login
4. Follow the on-screen device-flow instructions: this opens your browser to Sign in to GitHub · GitHub where you enter the shown code and authorize the CLI.
5. When prompted, confirm that you trust the files in the current folder.
3.3 Update or verify the CLI (optional)
• WinGet installs update automatically; to force a check, run: winget upgrade GitHub.Copilot
• npm installs are manual — rer@githubn npm install -g @github/copilot to get the l@githubtest release.
• Check your installed version any time with: copilot --version
4. Install the Pega Authoring Plugin
From inside the Copilot CLI session, add the Pega marketplace and install the authoring plugin:
copilot plugin marketplace add GitHub - pegasystems/infinity-ai-plugins: infinity-ai-plugins · GitHub
copilot plugin install pega-infinity-authoring@Pega
5. Update Java (optional)
• Copilot may pause mid-task and prompt you to install Java 17 if your installed version is older. Approve the prompt to continue.
• Add Java to your PATH, then open a new terminal session.
6. Point the configuration at your Pega environment
• Open .infinity-rules-mcp/config.json, usually found under your Windows user profile folder.
• Update pega_base_url to point to your Pega environment:
{
“pega_base_url”: “https://lab-101010-us-east-1.employee.pegalabs.io”,
“pega_oauth_client_id”: “34233104330833666523”,
“pega_infinity_version”: “26-1”
}
Use the default out-of-the-box (OOTB) pega_oauth_client_id as given.
Open a new terminal session and run:
pega-setup
You can now connect to the application by typing a prompt like “connect to DMSample”
[download the doc in 1st comment]






