Gemini CLI configuration files are stored in a dedicated .gemini
directory within your home directory at ~/.gemini/
. The primary configuration file is settings.json
, located at ~/.gemini/settings.json
, which contains your main CLI settings including MCP server configurations, model preferences, and other global settings. This centralized configuration approach allows you to maintain consistent settings across all your projects while also supporting project-specific customizations when needed.
In addition to the global configuration, Gemini CLI supports project-specific configuration through several mechanisms. You can create a .gemini
directory within individual project folders to store project-specific settings and customizations. Project-specific GEMINI.md files can be placed in the project root directory to provide custom instructions, coding standards, and context that apply specifically to that project. The CLI follows a hierarchical configuration system where project-specific settings can override global configurations, allowing for flexible customization at different levels.
The configuration system also supports environment variables for sensitive information and frequently changed settings. You can use a .env
file in your project directory or set environment variables in your shell profile for settings like API keys, model preferences, and authentication parameters. The CLI searches for environment configuration in multiple locations: first in the current project directory, then in parent directories, and finally in your home directory at ~/.env
. This layered approach provides flexibility for different deployment scenarios, from individual developer setups to team configurations and CI/CD environments. Additionally, sandbox configurations, custom Docker files, and extension settings are stored within the .gemini
directory structure, creating a comprehensive configuration ecosystem that supports both simple individual use cases and complex enterprise deployments.