docs/user-manual/en/5-faq/5.4-env-conflict.md
CC Switch automatically detects conflicts between system environment variables and app configurations, preventing configurations from being unexpectedly overridden.
Detected environment variables:
ANTHROPIC_API_KEY - Claude API keyANTHROPIC_BASE_URL - Claude API endpointOPENAI_API_KEY - OpenAI API keyGEMINI_API_KEY - Gemini API keyWhen a conflict is detected, a yellow warning banner appears at the top of the interface:
Warning: Environment variable conflict detected
Found X environment variables that may conflict with CC Switch configuration
[Expand] [Dismiss]
Click the "Expand" button to view detailed information:
| Field | Description |
|---|---|
| Variable Name | Environment variable name |
| Variable Value | Currently set value |
| Source | Where the variable originates from |
| Source | Description |
|---|---|
| User Registry | Windows user-level environment variable |
| System Registry | Windows system-level environment variable |
| Shell Configuration | macOS/Linux shell configuration file |
| System Environment | System-level environment variable |
A backup is automatically created before removal:
~/.cc-switch/env-backups/If you confirm the conflict does not affect usage, you can:
If you prefer not to use CC Switch to remove variables, you can handle them manually:
~/.zshrc, ~/.bashrc)export statementssource ~/.zshrcEnvironment variables typically take priority over configuration files, which may cause:
If you accidentally deleted environment variables:
~/.cc-switch/env-backups/