-
Notifications
You must be signed in to change notification settings - Fork 193
Open
Labels
Description
Describe the bug
Copilot CLI fails to authenticate with valid tokens
- OS: 14.8.1 (23J30)
- Shell: bash
- Copilot CLI version: 0.0.339 Commit: 66f4dfe
- Authentication method: classic PAT (
repo
,read:org
,gist
), fine-grained PAT - Token set as:
GITHUB_TOKEN
,GH_TOKEN
- Error: "Error during sign-in: fetch failed"
/login
command: "Error during sign-in: fetch failed"gh auth login
works for GitHub CLI, but Copilot CLI doesn't pick it up.- Steps tried:
- Verified internet connectivity to GitHub using
curl https://api.github.com
. - Installed and updated Copilot CLI to the latest version (0.0.339, commit 66f4dfe).
- Generated both fine-grained and classic personal access tokens (PATs) with recommended permissions (
repo
,read:org
,gist
for classic; all available for fine-grained). - Set tokens as environment variables (
GH_TOKEN
andGITHUB_TOKEN
) in the terminal (export GH_TOKEN=...
,export GITHUB_TOKEN=...
). - Verified environment variables are correctly set using
echo $GH_TOKEN
andecho $GITHUB_TOKEN
. - Ensured no conflicting proxy or authentication-related environment variables were set.
- Ran Copilot CLI commands such as
copilot -p "List my open PRs" --allow-all-tools
and received "No authentication information found" error. - Attempted to use Copilot CLI
/login
command (received "Invalid command format" error). - Tried logging in via GitHub CLI (
gh auth login
) and confirmed authentication, but Copilot CLI still failed to recognize authentication. - Tried both classic and fine-grained tokens individually in new terminal sessions, including direct export in session and via
~/.zshrc
. - Tested on different shells (confirmed current shell with
echo $SHELL
), and opened new terminal windows. - Checked for Copilot CLI known issues and similar bug reports on GitHub.
- Verified Copilot Pro trial status and Copilot feature enablement in GitHub account settings.
- Enabled Copilot extension in macOS System Settings.
- Restarted Xcode, Copilot plugin, and terminal after each configuration change.
Expected: Copilot CLI should authenticate and run commands.
Actual: Authentication fails with all methods.
Please advise or confirm any breaking changes/known issues.
Affected version
0.0.339 Commit: 66f4dfe
Steps to reproduce the behavior
- Install GitHub Copilot CLI (version 0.0.339).
- Generate a classic or fine-grained personal access token (PAT) on GitHub with the recommended permissions (
repo
,read:org
,gist
for classic, or all available for fine-grained). - Export the token as an environment variable in your terminal session:
- For classic:
export GITHUB_TOKEN=your_pat_here
- For fine-grained:
export GITHUB_TOKEN=your_fg_pat_here
- For classic:
- Open a new terminal window to ensure the environment variable is loaded.
- Verify the token is set by running:
echo $GITHUB_TOKEN
- Run the following Copilot CLI command:
copilot -p "List my open PRs" --allow-all-tools
- Observe the error:
Error: No authentication information found.
Expected behavior
To be able to login successfully
Additional context
Shell : Bash
On Mac OS X Sonoma 14.8.1
Chip: Apple M2
XCode 15.2