Skip to content

Add GitHub Copilot CLI to Cloud Shell tools image - #659

Draft
Mitchell Bifeld (mbifeld) wants to merge 1 commit into
Azure:masterfrom
mbifeld:mbifeld-microsoft-cloud-shell-copilot-cli
Draft

Mitchell Bifeld (mbifeld) wants to merge 1 commit into
Azure:masterfrom
mbifeld:mbifeld-microsoft-cloud-shell-copilot-cli

Conversation

@mbifeld

Copy link
Copy Markdown
Member

Summary

  • Install the latest stable @github/copilot npm package globally in the tools image and clean the npm cache.
  • Add copilot to the command baseline and a focused non-root Pester availability test for --version and --help.
  • Document GitHub authentication requirements, credential-storage limitations, and package inclusion review.

Authentication behavior

The documented first-auth prompt matching the request is consent to store an OAuth token in plaintext when a system keychain is unavailable, rather than ordinary settings persistence. Official authentication documentation and CLI 1.0.111 help were inspected. No supported session-only/no-persist OAuth option was found; storeTokenPlaintext opts into plaintext storage instead.

This change installs the CLI independently and preserves credential-storage consent, directory trust, and tool-permission prompts in both ephemeral and persistent sessions. It does not configure credentials, auto-accept plaintext storage, or change the cached base-image tag. A supported upstream session-only OAuth mode would be needed to implement the preferred ephemeral-session UX safely.

Reference: https://docs.github.com/en/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli

Verification

  • Built the installation-only layer against an existing local Azure Linux amd64 base using an npm cache populated over verified HTTPS. Direct container access to the npm registry failed TLS, so the successful build used offline npm mode; certificate verification was not disabled.
  • Ran the npm-installed CLI 1.0.111 --version and --help as non-root csuser (UID 9527) in that image with networking disabled. Confirmed the license is readable and no root Copilot cache is baked in.
  • Compared command inventories: copilot was the only added command.
  • Verified native ARM64 Linux npm installation and ran the actual new Pester case with PowerShell 7.6.1/Pester 6.2.0: 1 passed, 0 failed.
  • PowerShell syntax and diff whitespace checks passed, accounting for the README's pre-existing CRLF line endings.

Outstanding before shipping

  • Full image build/test validation remains necessary. Emulated amd64 PowerShell crashed under QEMU (signal 11), and direct container-to-registry TLS failed in the local environment.
  • Real OAuth authorization was not performed; no end-to-end authentication outcome is claimed.
  • Maintainer exceptions are needed under the Package Inclusion Guide for the upstream npm source and package size. The measured installation-only image delta was approximately 142 MiB. The upstream redistribution license is retained by npm and permits unmodified inclusion in a larger service.
  • This PR changes image source only; it does not deploy to the Cloud Shell service.

Co-authored-by: Copilot App <223556219+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.

1 participant