fix: exclude DEBUG and DEBUG_MODE from project .env files by default (#5289)

Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
Oleksandr Gotgelf
2025-08-03 20:44:15 +02:00
committed by GitHub
parent bedcbb9feb
commit 03ed37d0dc
7 changed files with 305 additions and 11 deletions

View File

@@ -53,6 +53,11 @@ This guide provides solutions to common issues and debugging tips.
- **Cause:** The `is-in-ci` package checks for the presence of `CI`, `CONTINUOUS_INTEGRATION`, or any environment variable with a `CI_` prefix. When any of these are found, it signals that the environment is non-interactive, which prevents the CLI from starting in its interactive mode.
- **Solution:** If the `CI_` prefixed variable is not needed for the CLI to function, you can temporarily unset it for the command. e.g., `env -u CI_TOKEN gemini`
- **DEBUG mode not working from project .env file**
- **Issue:** Setting `DEBUG=true` in a project's `.env` file doesn't enable debug mode for gemini-cli.
- **Cause:** The `DEBUG` and `DEBUG_MODE` variables are automatically excluded from project `.env` files to prevent interference with gemini-cli behavior.
- **Solution:** Use a `.gemini/.env` file instead, or configure the `excludedProjectEnvVars` setting in your `settings.json` to exclude fewer variables.
## Debugging Tips
- **CLI debugging:**