gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

-e/--extensions flag does not override disabledExtensions setting in settings.json

Open sniemczyk-google opened this issue 1 year ago • 2 comments

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:

  1. Install an extension, for example, MyExtension.
  2. Disable the extension using the command: gemini extensions disable MyExtension
  3. Verify that the extension is listed in the disabledExtensions array in your ~/.gemini/settings.json file.
  4. Attempt to run Gemini CLI with the disabled extension enabled for a single session using the -e flag: gemini -e MyExtension -p "hello"
  5. 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

sniemczyk-google avatar Sep 18 '25 20:09 sniemczyk-google

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).

gemini-cli[bot] avatar Sep 18 '25 20:09 gemini-cli[bot]

Note that the initial intent of this feature was for the list to be the only active extensions

chrstnb avatar Sep 25 '25 17:09 chrstnb