You can enable verbose logging in Gemini CLI using several different approaches, with the --debug
flag being the primary method for accessing detailed debugging information that can help troubleshoot issues and understand the tool’s internal operations. Additionally, you can set the DEBUG or DEBUG_MODE environment variable to true or 1 to enable comprehensive verbose debug logging, which is particularly helpful for troubleshooting complex issues or understanding how the tool processes your requests. The debug system is designed to provide multiple levels of detail, allowing developers to access the specific information they need without being overwhelmed by unnecessary details during normal operation.
When you launch Gemini CLI with debug mode using gemini --debug
, you’ll see extensive additional information including the authentication method being used (such as oauth-personal), detailed memory usage statistics, comprehensive context loading information, and step-by-step breakdowns of how the tool processes your requests. The debug mode also reveals useful internal commands like /memory show
which allows you to inspect the current context and see exactly what files were loaded into the session, how much memory is being consumed by different components, and what system prompts are active. This level of detail is invaluable for understanding why certain responses are generated, how the tool interprets your project structure, and whether context loading is working correctly for your specific use case.
For comprehensive troubleshooting and enterprise monitoring, the CLI includes built-in telemetry capabilities based on industry-standard OpenTelemetry protocols that can be configured to log prompts, tool calls, execution times, success and failure rates, and detailed performance metrics. You can also use the --verbose
flag with specific CLI commands for more detailed output during command execution, and check CLI logs which are typically stored in user-specific configuration or cache directories for persistent analysis. If you’re debugging server-side issues or need to understand the tool’s internal architecture, you can increase log verbosity in the configuration files and even use Node.js debugging tools like node --inspect
for step-through debugging of the CLI’s internal operations. The telemetry system can be configured to export logs to external monitoring systems, allowing teams to integrate Gemini CLI monitoring with their existing observability infrastructure and maintain comprehensive audit trails for security and compliance purposes.