1Password / shell-plugins

Seamless authentication for every tool in your terminal.
https://developer.1password.com/docs/cli/shell-plugins/
MIT License
507 stars 163 forks source link

Cannot use GitHub Copilot CLI extension in `gh` with 1Password #414

Open blimmer opened 6 months ago

blimmer commented 6 months ago

Platform or tool

GitHub

Desired or expected behavior

Copilot CLI is now a public beta and exposed through the gh CLI. However, it doesn't work when I'm using the op shell integration.

I followed the instructions to add the extension and enable it here: https://docs.github.com/en/copilot/github-copilot-in-the-cli/using-github-copilot-in-the-cli#installing-copilot-in-the-cli

Current behavior

I get an error that I'm not authed everytime I try to run a copilot command. If I unalias the 1password integration (unalias gh), and go through the normal logic process it works.

Relevant log output

> gh auth status
github.com
  ✓ Logged in to github.com account blimmer (GITHUB_TOKEN)
  - Active account: true
  - Git operations protocol: ssh
  - Token: ghp_************************************
  - Token scopes: 'copilot', 'gist', 'notifications', 'project', 'read:org', 'repo', 'user'
> gh copilot suggest hello

✗ Error: No valid OAuth token detected

To get started with GitHub Copilot in the CLI, please run: gh auth login --web -h github.com to authenticate via web browser.

If I go through the `gh auth login --web -h github.com` process, it succeeds, but I keep getting the "No valid OAuth token detected" error.

op CLI version

2.13.1

DandyLyons commented 3 months ago

This appears to still be an issue with gh copilot cli in the public release as well now.

op CLI version: 2.26.1 gh version: 2.46.0