Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 11, 2026

CLI shim scripts only used npm install to bootstrap Copilot CLI, which fails if npm isn't installed.

Windows (copilotCLIShim.ps1)

  • Cascades: npm → winget (winget install GitHub.Copilot)
  • Separate Install-CopilotCLI / Update-CopilotCLI functions check for npm availability before attempting, then fall back to winget

Linux/macOS (copilotCLIShim.ts)

  • Cascades: npm → brew → curl → wget
  • brew install copilot-cli, or the official install script via curl -fsSL https://gh.io/copilot-install | bash / wget -qO-
  • Uses command -v (not which) for portable command detection
  • Distinguishes npm update vs npm install for version upgrade vs fresh install paths
function installCopilotCLI(label: string, update = false): boolean {
    if (hasCommand('npm') && runNpm([update ? 'update' : 'install', '-g', PACKAGE_NAME], label)) { return true; }
    if (hasCommand('brew')) { if (runBrew(label)) { return true; } }
    if (hasCommand('curl')) { if (runCurl(label)) { return true; } }
    if (hasCommand('wget')) { if (runWget(label)) { return true; } }
    return false;
}

Error messages now link to the official docs page rather than showing npm-specific commands.

Original prompt

This section details on the original issue you should resolve

<issue_title>Downloading native binaries for Copilot CLI in terminal when copilot isn't installed</issue_title>
<issue_description>Today we install cli using npm install...
However this fails if user doesn't have npm,
We should use one of the native distributions for installing the cli binary, the installation instructions for various platforms can be found here https://github.com/github/copilot-cli?locale=en-US

We might want to update the code in src/extension/chatSessions/vscode-node/copilotCLIShim.ps1 and src/extension/chatSessions/vscode-node/copilotCLIShim.ts accordingly.

Edit shim scripts (the scripts that run in the termnial) that ensure Copilot CLI is installed before running:

  • copilotCLIShim.ps1 (Windows): tries npm, then winget
  • copilotCLIShim.ts (Linux/Mac): tries npm, brew, curl, then wget</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 11, 2026 04:55
- copilotCLIShim.ps1 (Windows): tries npm, then winget
- copilotCLIShim.ts (Linux/Mac): tries npm, brew, curl, then wget

Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com>
… vs install for npm

Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Copilot CLI installation for users without npm Add native binary fallbacks for Copilot CLI installation when npm is unavailable Feb 11, 2026
Copilot AI requested a review from DonJayamanne February 11, 2026 04:58
@DonJayamanne DonJayamanne marked this pull request as ready for review February 12, 2026 02:59
Copilot AI review requested due to automatic review settings February 12, 2026 02:59
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 12, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds more resilient installation/update fallbacks for the Copilot CLI terminal shim scripts so bootstrap doesn’t depend solely on npm being present.

Changes:

  • Linux/macOS shim: cascade installer attempts npm → brew → curl → wget, using command -v for portable command detection.
  • Windows shim: splits install/update into dedicated functions and falls back from npm to winget.
  • User-facing failure guidance now points to official Copilot CLI install docs instead of npm-specific commands.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
src/extension/chatSessions/vscode-node/copilotCLIShim.ts Adds multi-strategy install/update logic for macOS/Linux (brew + official install script via curl/wget).
src/extension/chatSessions/vscode-node/copilotCLIShim.ps1 Adds winget fallback and separates install vs update behavior on Windows.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Downloading native binaries for Copilot CLI in terminal when copilot isn't installed

2 participants