This SDK provides the GitHub Copilot CLI for AI-assisted coding within a workshop. The agent is sandboxed in the workshop container. Credentials are persisted between workshop updates.
A minimal workshop:
# workshop.yaml
name: copilot-cli-env
base: [email protected]
sdks:
- name: copilot
channel: latest/stable
actions:
copilot-yolo: copilot --yolo --interactive="$@"
copilot-yolo-prompt: copilot --yolo --prompt="$@"This creates a basic Copilot environment. The agent is sandboxed by the workshop, so interactive and non-interactive actions can use the YOLO mode.
- No prerequisite SDKs are required.
- Place your project files in your project directory. No special layout is required; Copilot CLI works with any codebase.
- On launch, the SDK puts a
copilotwrapper onPATHand adds acopilot-instructions.mdhint about the workshop environment. The SDK pins the Copilot CLI version, so the wrapper setsCOPILOT_AUTO_UPDATE=falseunless you set it yourself.
Once the workshop is ready:
workshop shell
copilotThis opens an interactive Copilot session inside the workshop. You can ask Copilot to read files, write code, run commands, and navigate your project.
Copilot accepts fine-grained personal access tokens (github_pat_...) with
the "Copilot Requests" permission, and OAuth tokens from the Copilot CLI or
GitHub CLI (gh auth token). Classic personal access tokens (ghp_...)
are not supported.
To make your credentials available inside the workshop, you have these alternatives:
-
Set the
COPILOT_GITHUB_TOKEN,GH_TOKEN, orGITHUB_TOKENenvironment variable inside the workshop. You can pass it using the--envoption withworkshop runorworkshop exec, or by other means such as direnv. -
Connect a secret to the
github-tokenplug; see Use a token from the host keyring. WhenCOPILOT_GITHUB_TOKENisn't set, thecopilotwrapper reads the secret and exports it asCOPILOT_GITHUB_TOKENfor the Copilot process only, so it takes precedence overGH_TOKENandGITHUB_TOKEN. Note that commands Copilot runs inherit this variable. -
Otherwise, Copilot will prompt for an API token or offer browser-based login on first interactive use. The mount plug persists these credentials between workshop updates.
-
Check whether the host keyring already holds a Copilot token. When the keyring is available,
copilot loginon the host stores its OAuth token there under the service namecopilot-cli. To list matching items without printing the secret, run:secret-tool search --all service copilot-cli | grep -v '^secret = '
If an item is listed, skip to the next step and use
service: copilot-cliinstead ofservice: copilotas the slot attributes, adding the item's other attributes if several items are listed. -
Otherwise, store a token in the host keyring. Use a fine-grained personal access token with the "Copilot Requests" permission;
secret-toolprompts for it, so paste the token there:secret-tool store --label="copilot" --collection=default service copilotTo use the OAuth token of your GitHub CLI login instead, pipe it in:
gh auth token | tr -d '\n' | secret-tool store --label="copilot" --collection=default service copilot. To check that it's stored, runsecret-tool lookup service copilot >/dev/null && echo stored. -
Expose the keyring item through a
secretslot on the system SDK in your workshop definition:sdks: - name: system slots: copilot-token: interface: secret collection: default attributes: service: copilot - name: copilot channel: latest/stable
-
Once the workshop is launched, connect the slot to the
github-tokenplug:workshop connect <workshop-name>/copilot:github-token :copilot-token
The connection persists across
workshop refresh; repeat it afterworkshop restoreor after removing and launching the workshop again. To disconnect, useworkshop disconnectwith the same plug.
-
Interface:
mount -
Workshop target:
/home/workshop/.copilot -
Purpose: Preserves Copilot's credentials and settings between workshop updates. You can also use
workshop remountto control its contents on the host. To mount your existing~/.copilotsettings into the workshop, stop the workshop first, remount, then start it again:workshop stop <workshop-name> workshop remount <workshop-name>/copilot:copilot-config ~/.copilot workshop start <workshop-name>
- Interface:
secret - Purpose: Provides a GitHub token for Copilot from the host's secret service.
The
copilotwrapper reads it withworkshopctl get-secret copilot.github-tokenand exports it asCOPILOT_GITHUB_TOKEN, unless that variable is already set in the workshop.
This SDK doesn't define any slots.
- GitHub Community: GitHub Community Discussions
- Workshop forum: Discourse
- Please review our Code of Conduct before participating.
All contributions, including code, documentation updates, and issue reports, are welcome!
- See
CONTRIBUTING.mdfor guidelines. - Open issues or pull requests on the official repository.
Copyright 2026 Canonical Ltd.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 (LGPLv2.1) as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
GitHub Copilot CLI is subject to GitHub Copilot CLI License.