-e/--extensions flag does not override disabledExtensions setting in settings.json
What happened?
The -e or --extensions flag does not override the disabledExtensions setting in settings.json. If an extension has been disabled using gemini extensions disable <extension_name>, it cannot be temporarily re-enabled for a single session using the -e <extension_name> flag. This prevents a useful workflow where an extension can be disabled by default but enabled for a specific, one-off command.
To Reproduce:
- Install an extension, for example,
MyExtension. - Disable the extension using the command:
gemini extensions disable MyExtension - Verify that the extension is listed in the
disabledExtensionsarray in your~/.gemini/settings.jsonfile. - Attempt to run Gemini CLI with the disabled extension enabled for a single session using the
-eflag:gemini -e MyExtension -p "hello" - Observe that the extension is not loaded and its tools are not available.
What did you expect to happen?
The -e <extension_name> flag should take precedence over the disabledExtensions setting in settings.json, allowing a disabled extension to be enabled for the current session only. This would enable a workflow where extensions can be installed but disabled by default, and then activated on-demand for specific sessions.
Client information
Client Information
Run gemini to enter the interactive CLI, then run the /about command.
> /about
╭────────────────────────────────────────────────────────╮
│ │
│ About Gemini CLI │
│ │
│ CLI Version 0.6.0-nightly-git.c4c81e3d │
│ Git Commit c4c81e3d │
│ Model gemini-2.5-pro │
│ Sandbox no sandbox │
│ OS linux │
│ Auth Method gemini-api-key │
│ IDE Client IDE │
│ │
╰────────────────────────────────────────────────────────╯
Login information
GEMINI_API_KEY
Anything else we need to know?
No response
This is a bug where the --extensions flag does not override the disabledExtensions setting, which is unexpected behavior for a command-line flag. It affects the extension system, so it falls under area/extensibility. The priority is medium as it's an inconvenient issue for managing extensions but doesn't block core CLI functionality and has a manual workaround (editing the settings file).
Note that the initial intent of this feature was for the list to be the only active extensions