Copilot CLI Troubleshooting: Authentication, Access, Policies, and Recovery

Commands for diagnosing Copilot CLI authentication failures, token issues, wrapper install problems, and access-policy errors.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Authentication troubleshooting
Check GitHub CLI authentication status
gh auth status

# Verify whether GitHub CLI is already logged in.

Re-run Copilot login
copilot login

# Restore access with the OAuth login flow.

Check whether the Copilot token env var is set
echo $COPILOT_GITHUB_TOKEN

# Inspect the highest-priority token variable.

Check GH_TOKEN
echo $GH_TOKEN

# Inspect the GitHub CLI token env var.

Check GITHUB_TOKEN
echo $GITHUB_TOKEN

# Inspect the fallback GitHub token env var.

Set a fine-grained token for CLI auth
export COPILOT_GITHUB_TOKEN=PERSONAL_ACCESS_TOKEN

# Export a supported token into the current shell.

## Install, access, and policy issues
Print the installed CLI version for support
copilot version

# Check whether your binary is current.

Update before deeper debugging
copilot update

# Refresh the binary to the latest release.

Remove the gh-managed binary and re-download
gh copilot --remove && gh copilot

# Reset a broken gh wrapper install.

Linux keychain fix note
Install libsecret or accept plaintext credential storage when prompted.

# Install keychain support when secure storage is unavailable.

Confirm plan and organization policy access
Check that your Copilot plan is active and that your organization or enterprise has not disabled Copilot CLI.

# Verify subscription and org-level Copilot CLI policy.

## Safe debugging patterns
Read the permissions help topic
copilot help permissions

# Inspect permission-related help text.

Read the environment help topic
copilot help environment

# Inspect supported environment controls.

Inspect usage metrics during a problematic session
/usage

# Check how the session is behaving.

Inspect context pressure
/context

# Check whether the session has too much accumulated context.

Compact before retrying a task
/compact

# Reduce context noise before asking again.

Force a clean auth reset
copilot logout && copilot login

# Log out and back in when account state looks wrong.

Recommended next

No recommendations yet.