gh auth statusUse this when Copilot reports missing auth information and you want to inspect your GitHub CLI auth state.
Commands for diagnosing Copilot CLI authentication failures, token issues, wrapper install problems, and access-policy errors.
Diagnose missing credentials, invalid tokens, and wrong-account problems.
gh auth statusUse this when Copilot reports missing auth information and you want to inspect your GitHub CLI auth state.
copilot loginThe official fix for missing or expired credentials is often to sign in again.
echo $COPILOT_GITHUB_TOKENIf nothing prints, the variable is not set in the current shell environment.
echo $GH_TOKEN`GH_TOKEN` takes precedence over `GITHUB_TOKEN` but not over `COPILOT_GITHUB_TOKEN`.
echo $GITHUB_TOKENA stale or unexpected value here can lead to wrong-account or permission confusion.
export COPILOT_GITHUB_TOKEN=PERSONAL_ACCESS_TOKENUse a supported fine-grained token rather than a classic PAT.
Fix common setup blockers related to plans, policies, and keychains.
copilot versionA mismatched version is a frequent cause of behavior not matching the docs.
copilot updateThis can resolve issues caused by old builds or wrapper download state.
gh copilot --remove && gh copilotUseful when the `gh` wrapper has cached a bad or stale binary.
Install libsecret or accept plaintext credential storage when prompted.The auth troubleshooting guide calls out missing keychain support as a common failure mode.
Check that your Copilot plan is active and that your organization or enterprise has not disabled Copilot CLI.403 and policy-denied errors often come from licensing or admin settings rather than local CLI bugs.
Use lower-risk ways to understand what Copilot is doing and why.
copilot help permissionsUseful when debugging why a tool did or did not run.
copilot help environmentA quick way to confirm environment variable names and behavior.
/usageA good checkpoint when responses feel truncated, expensive, or oddly slow.
/contextLong sessions can lose precision if important details are compressed or summarized.
/compactA helpful move when the agent starts drifting or repeating itself.
copilot logout && copilot loginA straightforward fix for wrong-account, revoked token, or cached-credential issues.