Add GitHub Copilot CLI shell plugin#603
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new shell-plugin for the GitHub Copilot CLI, enabling 1Password to manage the COPILOT_GITHUB_TOKEN credential used to authenticate the copilot CLI.
Changes:
- Introduces the
copilotplugin definition, platform info, and registration of the credential type + executable. - Defines the
AuthTokencredential (with env var mapping, provisioner, and importer) plus tests. - Defines the
CopilotCLIexecutable with aNeedsAuthrule excluding help/version/login/logout/completion subcommands.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| plugins/copilot/plugin.go | Registers the Copilot plugin with platform metadata, credentials, and executables. |
| plugins/copilot/copilot.go | Defines the Copilot CLI executable and the conditions under which authentication is required. |
| plugins/copilot/auth_token.go | Defines the AuthToken credential, env var mapping, provisioner, and importer. |
| plugins/copilot/auth_token_test.go | Tests for the provisioner and importer behavior of the AuthToken credential. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Eddú Meléndez <eddu.melendez@gmail.com>
b686a15 to
def010f
Compare
scottisloud
left a comment
There was a problem hiding this comment.
Thanks for contributing a GitHub Copilot CLI plugin.
A few things before merge:
Auth gating (copilot.go)
Right now NeedsAuth is only NotForHelpOrVersion(). The CLI command reference documents several commands that should not require a 1Password item first:
copilot login— OAuth device flow (needsauth.NotForExactArgs("login"))- bare
copilot— launches the interactive UI where users can/login(needsauth.NotWithoutArgs()) copilot completion SHELL— completion script output (needsauth.NotWhenContainsArgs("completion"))copilot version— version subcommand (needsauth.NotForExactArgs("version");NotForHelpOrVersion()covers-v/--versionflags but not the subcommand)
Once you've had a chance to address those, I'll give it another look-over!
Overview
Adds a new GitHub Copilot shell plugin for the
copilotCLI.The plugin provisions an auth token through
COPILOT_GITHUB_TOKEN, which is the environment variable supported by Copilot CLI. It also supports importing an existing token fromCOPILOT_GITHUB_TOKEN.Type of change
Related Issue(s)
N/A
How To Test
Run plugin validation:
Run the Copilot plugin tests:
go test ./plugins/copilotExample authenticated command for functional testing:
copilot -p "explain this repo" -sChangelog
Authenticate the GitHub Copilot CLI using Touch ID and other unlock options with 1Password Shell Plugins.