To simplify the user experience and prevent startup failures, the Gemini CLI has introduced structured extension settings that eliminate the need for manual environment variable configuration. This update enables extensions to automatically prompt users for required details during installation and securely stores sensitive information, such as API keys, directly in the system keychain. Users can now easily manage and override these configurations globally or per project using the new Gemini extensions config command.
Overview
Google introduces extension settings for Gemini CLI, a structured configuration system that prompts users for required settings (API keys, URLs, project IDs) during extension installation. This eliminates manual environment variable configuration, stores sensitive values securely in the system keychain, and supports both global and workspace-scoped overrides via the new `gemini extensions config` command.
What You'll Learn
How to define structured settings in a Gemini CLI extension manifest using the settings array in gemini-extension.json
How to manage extension configuration after installation using the gemini extensions config command
How to use workspace-scoped overrides to maintain project-specific extension configurations
Why storing sensitive settings like API keys in the system keychain is preferable to plain text environment variables
How to debug extension configuration issues using gemini extensions list and /extensions list commands
Prerequisites & Requirements
- Gemini CLI v0.28.0 or later installed
- Basic understanding of environment variables and CLI tools
- Familiarity with JSON configuration files
- Understanding of MCP (Model Context Protocol) servers for extension development(optional)
Key Questions Answered
How do Gemini CLI extension settings work and what problem do they solve?
How to define settings in a Gemini CLI extension manifest file?
How to update Gemini CLI extension configuration after installation?
How to debug Gemini CLI extension configuration issues?
What is the difference between global and workspace-scoped Gemini CLI extension settings?
How does Gemini CLI handle sensitive extension settings like API keys and passwords?
What version of Gemini CLI supports extension settings?
Technologies & Tools
Some links below are affiliate links. We may earn a commission if you make a purchase.
Key Actionable Insights
1Always mark API keys, passwords, and tokens with "sensitive": true in your extension manifest. This ensures credentials are stored in the system keychain rather than plain text files, preventing accidental exposure through configuration file leaks or version control commits.This is especially important for extensions that connect to cloud services like databases (AlloyDB, Cloud SQL) or third-party APIs where credential exposure could lead to unauthorized access.
2Use workspace-scoped settings for project-specific identifiers like database cluster IDs, project IDs, and region configurations. This allows developers working across multiple projects to maintain separate configurations without global setting conflicts.Apply workspace scope via `gemini extensions config <name> <var> --scope workspace`. This is particularly relevant for GCP-based extensions where different projects may target different regions, clusters, or databases.
3Write clear, descriptive setting descriptions that tell users exactly where to find the required values. Instead of just 'API Key', include guidance like 'Find this in your GCP Console under IAM' to reduce user friction and support requests.Good descriptions reduce onboarding time and prevent configuration errors from users entering incorrect values. This best practice is especially useful for complex cloud service configurations with multiple required parameters.
4Use `gemini extensions list` or `/extensions list` as a first debugging step when an extension fails to function properly. These commands display all active settings with their current values, making it easy to spot typos or missing configuration.Configuration errors like a misspelled project ID or missing API key are common causes of extension failures. The list command provides a quick verification without needing to inspect individual config files.
5Keep setting names concise and user-friendly since they appear as terminal prompts during installation. Names like 'Project ID', 'Region', and 'API Key' are more effective than verbose or technical environment variable names.The name field is what users see during the interactive setup flow, while envVar is the technical mapping. Separating display names from environment variables lets you maintain clean UX while preserving backward compatibility with existing MCP server configurations.