Add GitHub Copilot CLI shell plugin#603
Open
eddumelendez wants to merge 1 commit into
Open
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.
Comment on lines
+25
to
+32
| return needsauth.IfAll( | ||
| needsauth.NotForExactArgs("-h"), | ||
| needsauth.NotForExactArgs("--help"), | ||
| needsauth.NotForExactArgs("-help"), | ||
| needsauth.NotForExactArgs("-v"), | ||
| needsauth.NotForExactArgs("--version"), | ||
| needsauth.NotForExactArgs("-version"), | ||
| needsauth.NotForExactArgs("-V"), |
Comment on lines
+33
to
+37
| notForFirstArg("help"), | ||
| notForFirstArg("version"), | ||
| notForFirstArg("completion"), | ||
| notForFirstArg("login"), | ||
| notForFirstArg("logout"), |
Comment on lines
+15
to
+16
| DocsURL: sdk.URL("https://docs.github.com/en/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli"), | ||
| ManagementURL: sdk.URL("https://github.com/settings/personal-access-tokens/new"), |
| Name: "copilot", | ||
| Platform: schema.PlatformInfo{ | ||
| Name: "GitHub Copilot", | ||
| Homepage: sdk.URL("https://github.com/features/copilot/cli"), |
Signed-off-by: Eddú Meléndez <eddu.melendez@gmail.com>
b686a15 to
def010f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.