AI / GitHub Copilot CLI Fundamentals Interview Questions
What is the COPILOT_HOME environment variable and where does Copilot CLI store its config?
Copilot CLI stores configuration, cached data, and authentication tokens in a dedicated directory. By default this is ~/.copilot/ but you can override the location with the COPILOT_HOME environment variable.
| Item | Default location | Override |
|---|---|---|
| Config directory | ~/.copilot/ | Set COPILOT_HOME=/path/to/dir |
| Auth token (no credential store) | ~/.copilot/ (plain text) | Avoided if system credential store available |
| Trusted directories list | Stored in config directory | N/A |
| Session history | Stored in config directory | N/A |
| MDM configuration | System-managed path | Refer to GitHub Copilot CLI configuration directory docs |
# Override the config directory location export COPILOT_HOME=/custom/path/.copilot copilot # COPILOT_HOME is useful for: # - Running multiple Copilot CLI instances with separate configs # - Storing config in a non-home directory (e.g. shared CI environment) # - Pointing to a network-mounted config for team consistency # - Isolating config in containerised/ephemeral environments # Default credential storage preference: # 1. System credential store (keychain on macOS, etc.) - most secure # 2. Plain text ~/.copilot/config - fallback if no credential store found
Security note: Copilot CLI prefers the system credential store (macOS Keychain, Windows Credential Manager, etc.) for token storage. If no credential store is detected, it falls back to a plain text file in the config directory - this is less secure and Anthropic recommends ensuring a credential store is available on developer machines.
More Related questions...