From 50dc17405fd3cc30b6b1f060d20b8f36a74f399c Mon Sep 17 00:00:00 2001 From: Mitchell Bifeld Date: Fri, 13 Nov 2026 17:20:39 -0600 Subject: [PATCH] Add GitHub Copilot CLI to Cloud Shell tools image Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 26 ++++++++++++++++++++++++ linux/tools.Dockerfile | 4 ++++ tests/PSinLinuxCloudShellImage.Tests.ps1 | 12 +++++++++++ tests/command_list | 1 + 4 files changed, 43 insertions(+) diff --git a/README.md b/README.md index f1e24b28..936d18df 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,32 @@ For more information about bind mounts, please see the [Docker documentation](https://docs.docker.com/storage/bind-mounts/). We do expect all test cases to pass if you want your changes to be merged. +## GitHub Copilot CLI + +The tools image installs the latest stable +[`@github/copilot`](https://docs.github.com/en/copilot/how-tos/copilot-cli/set-up-copilot-cli/install-copilot-cli) +package globally, making `copilot` available to regular Cloud Shell users in Bash and PowerShell. +Users authenticate with their own GitHub account and need a Copilot entitlement and any required +organization policy approval. Azure sign-in does not sign users into GitHub Copilot. + +On headless Linux, Copilot may ask to save its authentication token in plaintext when a system +keychain is unavailable. This is credential-storage consent, not a prompt to save ordinary settings. +The image leaves this prompt and all directory-trust and tool-permission prompts unchanged, in both +ephemeral and persistent Cloud Shell sessions. The documented CLI options do not provide a +session-only OAuth login that skips credential storage. Relocating configuration does not remove +that consent requirement. The `storeTokenPlaintext` setting opts into plaintext storage, not +session-only authentication, and is not set by the image. + +For users who already have a supported token, GitHub documents environment-variable authentication +with `COPILOT_GITHUB_TOKEN`, `GH_TOKEN`, or `GITHUB_TOKEN` as an alternative to OAuth login. Supply +tokens only at runtime; do not put them in the image, shell history, or shared scripts. See +[Authenticating GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli). + +Copilot's license and notices are retained in the globally installed npm package. Inclusion still +requires the maintainer review described in the [Package Inclusion Guide](./docs/package-inclusion-guide.md), +including exceptions for the upstream npm source and package size. Image source changes are not a +deployment to the Cloud Shell service. + ## Contribution Guidelines ### Types of issues diff --git a/linux/tools.Dockerfile b/linux/tools.Dockerfile index fbfe1c4a..7ca572e8 100644 --- a/linux/tools.Dockerfile +++ b/linux/tools.Dockerfile @@ -11,6 +11,10 @@ FROM ${IMAGE_LOCATION} LABEL org.opencontainers.image.source="https://github.com/Azure/CloudShell" +# Install the latest stable GitHub Copilot CLI for all users. +RUN npm install -q -g @github/copilot \ + && npm cache clean --force + RUN tdnf clean all && \ tdnf repolist --refresh && \ ACCEPT_EULA=Y tdnf update -y && \ diff --git a/tests/PSinLinuxCloudShellImage.Tests.ps1 b/tests/PSinLinuxCloudShellImage.Tests.ps1 index 63251791..83c94c1e 100755 --- a/tests/PSinLinuxCloudShellImage.Tests.ps1 +++ b/tests/PSinLinuxCloudShellImage.Tests.ps1 @@ -84,6 +84,18 @@ Describe "Various programs installed with expected versions" -Tag "CloudShellUse } } +Describe "GitHub Copilot CLI" -Tag "CloudShellUser" { + It "Runs without authentication" { + $version = copilot --version + $LASTEXITCODE | Should-Be 0 + ($version -join "`n") | Should-MatchString 'GitHub Copilot CLI' + + $helpText = copilot --help + $LASTEXITCODE | Should-Be 0 + ($helpText -join "`n") | Should-MatchString 'Usage: copilot' + } +} + Describe "PowerShell Modules" { BeforeAll { diff --git a/tests/command_list b/tests/command_list index 3424d519..a8ac54da 100644 --- a/tests/command_list +++ b/tests/command_list @@ -182,6 +182,7 @@ containerd containerd-shim-runc-v2 containerd-stress continue +copilot coproc corepack cp