Inspect the highest-priority token variable.

Section: Authentication troubleshooting

Check whether the Copilot token env var is set

bash
bash
echo $COPILOT_GITHUB_TOKEN
Explanation

If nothing prints, the variable is not set in the current shell environment.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Authentication troubleshooting
Check GH_TOKEN
Inspect the GitHub CLI token env var.
OpenIn sheetbashsame section
Check GITHUB_TOKEN
Inspect the fallback GitHub token env var.
OpenIn sheetbashsame section
Check GitHub CLI authentication status
Verify whether GitHub CLI is already logged in.
OpenIn sheetbashsame section
Re-run Copilot login
Restore access with the OAuth login flow.
OpenIn sheetbashsame section
Set a fine-grained token for CLI auth
Export a supported token into the current shell.
OpenIn sheetbashsame section
Print the installed CLI version for support
Check whether your binary is current.
OpenIn sheetbash1 tag match