@google/gemini-cli-core 0.22.0-preview.3 → 0.23.0-preview.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/CONTRIBUTING.md +546 -0
- package/dist/docs/architecture.md +80 -0
- package/dist/docs/assets/connected_devtools.png +0 -0
- package/dist/docs/assets/gemini-screenshot.png +0 -0
- package/dist/docs/assets/release_patch.png +0 -0
- package/dist/docs/assets/theme-ansi-light.png +0 -0
- package/dist/docs/assets/theme-ansi.png +0 -0
- package/dist/docs/assets/theme-atom-one.png +0 -0
- package/dist/docs/assets/theme-ayu-light.png +0 -0
- package/dist/docs/assets/theme-ayu.png +0 -0
- package/dist/docs/assets/theme-custom.png +0 -0
- package/dist/docs/assets/theme-default-light.png +0 -0
- package/dist/docs/assets/theme-default.png +0 -0
- package/dist/docs/assets/theme-dracula.png +0 -0
- package/dist/docs/assets/theme-github-light.png +0 -0
- package/dist/docs/assets/theme-github.png +0 -0
- package/dist/docs/assets/theme-google-light.png +0 -0
- package/dist/docs/assets/theme-xcode-light.png +0 -0
- package/dist/docs/changelogs/index.md +592 -0
- package/dist/docs/changelogs/latest.md +225 -0
- package/dist/docs/changelogs/preview.md +129 -0
- package/dist/docs/changelogs/releases.md +896 -0
- package/dist/docs/cli/authentication.md +3 -0
- package/dist/docs/cli/checkpointing.md +94 -0
- package/dist/docs/cli/commands.md +354 -0
- package/dist/docs/cli/configuration.md +780 -0
- package/dist/docs/cli/custom-commands.md +315 -0
- package/dist/docs/cli/enterprise.md +565 -0
- package/dist/docs/cli/gemini-ignore.md +71 -0
- package/dist/docs/cli/gemini-md.md +108 -0
- package/dist/docs/cli/generation-settings.md +210 -0
- package/dist/docs/cli/headless.md +388 -0
- package/dist/docs/cli/index.md +63 -0
- package/dist/docs/cli/keyboard-shortcuts.md +143 -0
- package/dist/docs/cli/model-routing.md +37 -0
- package/dist/docs/cli/model.md +62 -0
- package/dist/docs/cli/sandbox.md +171 -0
- package/dist/docs/cli/session-management.md +158 -0
- package/dist/docs/cli/settings.md +112 -0
- package/dist/docs/cli/system-prompt.md +93 -0
- package/dist/docs/cli/telemetry.md +791 -0
- package/dist/docs/cli/themes.md +237 -0
- package/dist/docs/cli/token-caching.md +20 -0
- package/dist/docs/cli/trusted-folders.md +95 -0
- package/dist/docs/cli/tutorials.md +83 -0
- package/dist/docs/cli/uninstall.md +47 -0
- package/dist/docs/core/index.md +101 -0
- package/dist/docs/core/memport.md +244 -0
- package/dist/docs/core/policy-engine.md +267 -0
- package/dist/docs/core/tools-api.md +131 -0
- package/dist/docs/examples/proxy-script.md +83 -0
- package/dist/docs/extensions/extension-releasing.md +183 -0
- package/dist/docs/extensions/getting-started-extensions.md +245 -0
- package/dist/docs/extensions/index.md +293 -0
- package/dist/docs/faq.md +154 -0
- package/dist/docs/get-started/authentication.md +321 -0
- package/dist/docs/get-started/configuration-v1.md +888 -0
- package/dist/docs/get-started/configuration.md +1444 -0
- package/dist/docs/get-started/deployment.md +143 -0
- package/dist/docs/get-started/examples.md +219 -0
- package/dist/docs/get-started/gemini-3.md +116 -0
- package/dist/docs/get-started/index.md +71 -0
- package/dist/docs/get-started/installation.md +141 -0
- package/dist/docs/hooks/best-practices.md +806 -0
- package/dist/docs/hooks/index.md +665 -0
- package/dist/docs/hooks/reference.md +168 -0
- package/dist/docs/hooks/writing-hooks.md +1026 -0
- package/dist/docs/ide-integration/ide-companion-spec.md +267 -0
- package/dist/docs/ide-integration/index.md +202 -0
- package/dist/docs/index.md +147 -0
- package/dist/docs/integration-tests.md +211 -0
- package/dist/docs/issue-and-pr-automation.md +134 -0
- package/dist/docs/local-development.md +128 -0
- package/dist/docs/mermaid/context.mmd +103 -0
- package/dist/docs/mermaid/render-path.mmd +64 -0
- package/dist/docs/npm.md +62 -0
- package/dist/docs/quota-and-pricing.md +158 -0
- package/dist/docs/release-confidence.md +164 -0
- package/dist/docs/releases.md +540 -0
- package/dist/docs/sidebar.json +297 -0
- package/dist/docs/tools/file-system.md +217 -0
- package/dist/docs/tools/index.md +95 -0
- package/dist/docs/tools/mcp-server.md +1044 -0
- package/dist/docs/tools/memory.md +54 -0
- package/dist/docs/tools/shell.md +260 -0
- package/dist/docs/tools/todos.md +57 -0
- package/dist/docs/tools/web-fetch.md +59 -0
- package/dist/docs/tools/web-search.md +42 -0
- package/dist/docs/tos-privacy.md +96 -0
- package/dist/docs/troubleshooting.md +158 -0
- package/dist/src/agents/codebase-investigator.d.ts +2 -2
- package/dist/src/agents/codebase-investigator.js +4 -3
- package/dist/src/agents/codebase-investigator.js.map +1 -1
- package/dist/src/agents/delegate-to-agent-tool.js +8 -4
- package/dist/src/agents/delegate-to-agent-tool.js.map +1 -1
- package/dist/src/agents/delegate-to-agent-tool.test.js +6 -4
- package/dist/src/agents/delegate-to-agent-tool.test.js.map +1 -1
- package/dist/src/agents/introspection-agent.d.ts +23 -0
- package/dist/src/agents/introspection-agent.js +72 -0
- package/dist/src/agents/introspection-agent.js.map +1 -0
- package/dist/src/agents/introspection-agent.test.js +47 -0
- package/dist/src/agents/introspection-agent.test.js.map +1 -0
- package/dist/src/agents/{executor.d.ts → local-executor.d.ts} +5 -11
- package/dist/src/agents/{executor.js → local-executor.js} +79 -53
- package/dist/src/agents/local-executor.js.map +1 -0
- package/dist/src/agents/{executor.test.js → local-executor.test.js} +64 -45
- package/dist/src/agents/local-executor.test.js.map +1 -0
- package/dist/src/agents/{invocation.d.ts → local-invocation.d.ts} +5 -6
- package/dist/src/agents/{invocation.js → local-invocation.js} +8 -9
- package/dist/src/agents/local-invocation.js.map +1 -0
- package/dist/src/agents/local-invocation.test.d.ts +6 -0
- package/dist/src/agents/{invocation.test.js → local-invocation.test.js} +18 -17
- package/dist/src/agents/local-invocation.test.js.map +1 -0
- package/dist/src/agents/registry.d.ts +1 -0
- package/dist/src/agents/registry.js +68 -20
- package/dist/src/agents/registry.js.map +1 -1
- package/dist/src/agents/registry.test.js +113 -1
- package/dist/src/agents/registry.test.js.map +1 -1
- package/dist/src/agents/remote-invocation.d.ts +21 -0
- package/dist/src/agents/remote-invocation.js +31 -0
- package/dist/src/agents/remote-invocation.js.map +1 -0
- package/dist/src/agents/remote-invocation.test.d.ts +6 -0
- package/dist/src/agents/remote-invocation.test.js +35 -0
- package/dist/src/agents/remote-invocation.test.js.map +1 -0
- package/dist/src/agents/subagent-tool-wrapper.js +7 -3
- package/dist/src/agents/subagent-tool-wrapper.js.map +1 -1
- package/dist/src/agents/subagent-tool-wrapper.test.js +10 -9
- package/dist/src/agents/subagent-tool-wrapper.test.js.map +1 -1
- package/dist/src/agents/toml-loader.d.ts +65 -0
- package/dist/src/agents/toml-loader.js +176 -0
- package/dist/src/agents/toml-loader.js.map +1 -0
- package/dist/src/agents/toml-loader.test.d.ts +6 -0
- package/dist/src/agents/toml-loader.test.js +190 -0
- package/dist/src/agents/toml-loader.test.js.map +1 -0
- package/dist/src/agents/types.d.ts +12 -4
- package/dist/src/availability/modelAvailabilityService.d.ts +2 -1
- package/dist/src/availability/policyHelpers.d.ts +4 -3
- package/dist/src/availability/policyHelpers.js +13 -20
- package/dist/src/availability/policyHelpers.js.map +1 -1
- package/dist/src/availability/policyHelpers.test.js +28 -18
- package/dist/src/availability/policyHelpers.test.js.map +1 -1
- package/dist/src/code_assist/oauth2.js +1 -1
- package/dist/src/code_assist/oauth2.js.map +1 -1
- package/dist/src/code_assist/oauth2.test.js +6 -8
- package/dist/src/code_assist/oauth2.test.js.map +1 -1
- package/dist/src/code_assist/server.d.ts +4 -1
- package/dist/src/code_assist/server.js +50 -7
- package/dist/src/code_assist/server.js.map +1 -1
- package/dist/src/code_assist/server.test.js +177 -27
- package/dist/src/code_assist/server.test.js.map +1 -1
- package/dist/src/code_assist/telemetry.d.ts +14 -0
- package/dist/src/code_assist/telemetry.js +156 -0
- package/dist/src/code_assist/telemetry.js.map +1 -0
- package/dist/src/code_assist/telemetry.test.d.ts +6 -0
- package/dist/src/code_assist/telemetry.test.js +300 -0
- package/dist/src/code_assist/telemetry.test.js.map +1 -0
- package/dist/src/code_assist/types.d.ts +52 -1
- package/dist/src/code_assist/types.js +21 -0
- package/dist/src/code_assist/types.js.map +1 -1
- package/dist/src/config/config.d.ts +10 -13
- package/dist/src/config/config.js +32 -32
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +72 -19
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/flashFallback.test.js +0 -37
- package/dist/src/config/flashFallback.test.js.map +1 -1
- package/dist/src/config/storage.d.ts +2 -0
- package/dist/src/config/storage.js +6 -0
- package/dist/src/config/storage.js.map +1 -1
- package/dist/src/config/storage.test.js +8 -0
- package/dist/src/config/storage.test.js.map +1 -1
- package/dist/src/core/baseLlmClient.js +44 -43
- package/dist/src/core/baseLlmClient.js.map +1 -1
- package/dist/src/core/baseLlmClient.test.js +12 -19
- package/dist/src/core/baseLlmClient.test.js.map +1 -1
- package/dist/src/core/client.js +23 -35
- package/dist/src/core/client.js.map +1 -1
- package/dist/src/core/client.test.js +32 -65
- package/dist/src/core/client.test.js.map +1 -1
- package/dist/src/core/clientHookTriggers.js +2 -2
- package/dist/src/core/clientHookTriggers.js.map +1 -1
- package/dist/src/core/contentGenerator.test.js +0 -6
- package/dist/src/core/contentGenerator.test.js.map +1 -1
- package/dist/src/core/coreToolHookTriggers.js +3 -3
- package/dist/src/core/coreToolHookTriggers.js.map +1 -1
- package/dist/src/core/geminiChat.js +21 -71
- package/dist/src/core/geminiChat.js.map +1 -1
- package/dist/src/core/geminiChat.test.js +16 -92
- package/dist/src/core/geminiChat.test.js.map +1 -1
- package/dist/src/core/geminiChatHookTriggers.js +3 -3
- package/dist/src/core/geminiChatHookTriggers.js.map +1 -1
- package/dist/src/core/geminiChat_network_retry.test.js +4 -6
- package/dist/src/core/geminiChat_network_retry.test.js.map +1 -1
- package/dist/src/core/prompts.test.js +0 -2
- package/dist/src/core/prompts.test.js.map +1 -1
- package/dist/src/core/sessionHookTriggers.js +3 -3
- package/dist/src/core/sessionHookTriggers.js.map +1 -1
- package/dist/src/core/turn.d.ts +1 -0
- package/dist/src/core/turn.js +4 -12
- package/dist/src/core/turn.js.map +1 -1
- package/dist/src/core/turn.test.js +0 -5
- package/dist/src/core/turn.test.js.map +1 -1
- package/dist/src/fallback/handler.test.js +0 -21
- package/dist/src/fallback/handler.test.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/hooks/hookEventHandler.js +10 -4
- package/dist/src/hooks/hookEventHandler.js.map +1 -1
- package/dist/src/hooks/hookEventHandler.test.js +47 -0
- package/dist/src/hooks/hookEventHandler.test.js.map +1 -1
- package/dist/src/hooks/hookPlanner.js +3 -1
- package/dist/src/hooks/hookPlanner.js.map +1 -1
- package/dist/src/hooks/hookPlanner.test.js +61 -0
- package/dist/src/hooks/hookPlanner.test.js.map +1 -1
- package/dist/src/hooks/hookRegistry.d.ts +1 -1
- package/dist/src/hooks/hookRegistry.js +2 -2
- package/dist/src/hooks/hookRegistry.js.map +1 -1
- package/dist/src/hooks/hookRegistry.test.js +73 -0
- package/dist/src/hooks/hookRegistry.test.js.map +1 -1
- package/dist/src/hooks/hookRunner.js +14 -10
- package/dist/src/hooks/hookRunner.js.map +1 -1
- package/dist/src/hooks/hookRunner.test.js +81 -33
- package/dist/src/hooks/hookRunner.test.js.map +1 -1
- package/dist/src/hooks/types.d.ts +2 -0
- package/dist/src/hooks/types.js.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp/oauth-provider.js +6 -2
- package/dist/src/mcp/oauth-provider.js.map +1 -1
- package/dist/src/mcp/oauth-provider.test.js +4 -1
- package/dist/src/mcp/oauth-provider.test.js.map +1 -1
- package/dist/src/mcp/oauth-utils.d.ts +8 -1
- package/dist/src/mcp/oauth-utils.js +30 -1
- package/dist/src/mcp/oauth-utils.js.map +1 -1
- package/dist/src/mcp/oauth-utils.test.js +42 -0
- package/dist/src/mcp/oauth-utils.test.js.map +1 -1
- package/dist/src/routing/strategies/fallbackStrategy.js +0 -3
- package/dist/src/routing/strategies/fallbackStrategy.js.map +1 -1
- package/dist/src/routing/strategies/fallbackStrategy.test.js +0 -6
- package/dist/src/routing/strategies/fallbackStrategy.test.js.map +1 -1
- package/dist/src/services/contextManager.d.ts +5 -11
- package/dist/src/services/contextManager.js +20 -17
- package/dist/src/services/contextManager.js.map +1 -1
- package/dist/src/services/contextManager.test.js +40 -41
- package/dist/src/services/contextManager.test.js.map +1 -1
- package/dist/src/services/loopDetectionService.js +2 -1
- package/dist/src/services/loopDetectionService.js.map +1 -1
- package/dist/src/services/loopDetectionService.test.js +14 -8
- package/dist/src/services/loopDetectionService.test.js.map +1 -1
- package/dist/src/services/modelConfig.integration.test.js +1 -1
- package/dist/src/services/modelConfig.integration.test.js.map +1 -1
- package/dist/src/services/shellExecutionService.js +18 -2
- package/dist/src/services/shellExecutionService.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +4 -2
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +25 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +32 -1
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -1
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +5 -1
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +12 -1
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
- package/dist/src/telemetry/loggers.js +1 -0
- package/dist/src/telemetry/loggers.js.map +1 -1
- package/dist/src/telemetry/loggers.test.js +37 -2
- package/dist/src/telemetry/loggers.test.js.map +1 -1
- package/dist/src/telemetry/sdk.js +2 -2
- package/dist/src/telemetry/sdk.js.map +1 -1
- package/dist/src/tools/confirmation-policy.test.d.ts +6 -0
- package/dist/src/tools/confirmation-policy.test.js +152 -0
- package/dist/src/tools/confirmation-policy.test.js.map +1 -0
- package/dist/src/tools/edit.js +5 -1
- package/dist/src/tools/edit.js.map +1 -1
- package/dist/src/tools/get-internal-docs.d.ts +27 -0
- package/dist/src/tools/get-internal-docs.js +129 -0
- package/dist/src/tools/get-internal-docs.js.map +1 -0
- package/dist/src/tools/get-internal-docs.test.d.ts +6 -0
- package/dist/src/tools/get-internal-docs.test.js +56 -0
- package/dist/src/tools/get-internal-docs.test.js.map +1 -0
- package/dist/src/tools/ripGrep.d.ts +1 -0
- package/dist/src/tools/ripGrep.js +16 -4
- package/dist/src/tools/ripGrep.js.map +1 -1
- package/dist/src/tools/ripGrep.test.js +55 -0
- package/dist/src/tools/ripGrep.test.js.map +1 -1
- package/dist/src/tools/smart-edit.js +5 -1
- package/dist/src/tools/smart-edit.js.map +1 -1
- package/dist/src/tools/tool-names.d.ts +14 -0
- package/dist/src/tools/tool-names.js +55 -0
- package/dist/src/tools/tool-names.js.map +1 -1
- package/dist/src/tools/tool-names.test.d.ts +6 -0
- package/dist/src/tools/tool-names.test.js +43 -0
- package/dist/src/tools/tool-names.test.js.map +1 -0
- package/dist/src/tools/tool-registry.d.ts +0 -1
- package/dist/src/tools/tool-registry.js +1 -1
- package/dist/src/tools/tool-registry.js.map +1 -1
- package/dist/src/tools/tool-registry.test.js +2 -1
- package/dist/src/tools/tool-registry.test.js.map +1 -1
- package/dist/src/tools/web-fetch.js +5 -1
- package/dist/src/tools/web-fetch.js.map +1 -1
- package/dist/src/tools/write-file.js +5 -1
- package/dist/src/tools/write-file.js.map +1 -1
- package/dist/src/utils/checkpointUtils.js +1 -1
- package/dist/src/utils/checkpointUtils.js.map +1 -1
- package/dist/src/utils/checkpointUtils.test.js +1 -1
- package/dist/src/utils/checkpointUtils.test.js.map +1 -1
- package/dist/src/utils/editCorrector.js +1 -1
- package/dist/src/utils/editCorrector.js.map +1 -1
- package/dist/src/utils/editCorrector.test.js +2 -2
- package/dist/src/utils/editCorrector.test.js.map +1 -1
- package/dist/src/utils/environmentContext.d.ts +1 -0
- package/dist/src/utils/environmentContext.js +4 -0
- package/dist/src/utils/environmentContext.js.map +1 -1
- package/dist/src/utils/environmentContext.test.js +2 -0
- package/dist/src/utils/environmentContext.test.js.map +1 -1
- package/dist/src/utils/events.d.ts +3 -18
- package/dist/src/utils/events.js +0 -9
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/geminiIgnoreParser.d.ts +11 -0
- package/dist/src/utils/geminiIgnoreParser.js +20 -0
- package/dist/src/utils/geminiIgnoreParser.js.map +1 -1
- package/dist/src/utils/geminiIgnoreParser.test.js +48 -0
- package/dist/src/utils/geminiIgnoreParser.test.js.map +1 -1
- package/dist/src/utils/generateContentResponseUtilities.d.ts +1 -0
- package/dist/src/utils/generateContentResponseUtilities.js +10 -0
- package/dist/src/utils/generateContentResponseUtilities.js.map +1 -1
- package/dist/src/utils/generateContentResponseUtilities.test.js +59 -2
- package/dist/src/utils/generateContentResponseUtilities.test.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.js +1 -1
- package/dist/src/utils/memoryDiscovery.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.test.js +3 -1
- package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
- package/dist/src/utils/shell-utils.js +25 -4
- package/dist/src/utils/shell-utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -6
- package/dist/google-gemini-cli-core-0.22.0-preview.2.tgz +0 -0
- package/dist/src/agents/executor.js.map +0 -1
- package/dist/src/agents/executor.test.js.map +0 -1
- package/dist/src/agents/invocation.js.map +0 -1
- package/dist/src/agents/invocation.test.js.map +0 -1
- /package/dist/src/agents/{executor.test.d.ts → introspection-agent.test.d.ts} +0 -0
- /package/dist/src/agents/{invocation.test.d.ts → local-executor.test.d.ts} +0 -0
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
# Gemini CLI for the enterprise
|
|
2
|
+
|
|
3
|
+
This document outlines configuration patterns and best practices for deploying
|
|
4
|
+
and managing Gemini CLI in an enterprise environment. By leveraging system-level
|
|
5
|
+
settings, administrators can enforce security policies, manage tool access, and
|
|
6
|
+
ensure a consistent experience for all users.
|
|
7
|
+
|
|
8
|
+
> **A note on security:** The patterns described in this document are intended
|
|
9
|
+
> to help administrators create a more controlled and secure environment for
|
|
10
|
+
> using Gemini CLI. However, they should not be considered a foolproof security
|
|
11
|
+
> boundary. A determined user with sufficient privileges on their local machine
|
|
12
|
+
> may still be able to circumvent these configurations. These measures are
|
|
13
|
+
> designed to prevent accidental misuse and enforce corporate policy in a
|
|
14
|
+
> managed environment, not to defend against a malicious actor with local
|
|
15
|
+
> administrative rights.
|
|
16
|
+
|
|
17
|
+
## Centralized configuration: The system settings file
|
|
18
|
+
|
|
19
|
+
The most powerful tools for enterprise administration are the system-wide
|
|
20
|
+
settings files. These files allow you to define a baseline configuration
|
|
21
|
+
(`system-defaults.json`) and a set of overrides (`settings.json`) that apply to
|
|
22
|
+
all users on a machine. For a complete overview of configuration options, see
|
|
23
|
+
the [Configuration documentation](../get-started/configuration.md).
|
|
24
|
+
|
|
25
|
+
Settings are merged from four files. The precedence order for single-value
|
|
26
|
+
settings (like `theme`) is:
|
|
27
|
+
|
|
28
|
+
1. System Defaults (`system-defaults.json`)
|
|
29
|
+
2. User Settings (`~/.gemini/settings.json`)
|
|
30
|
+
3. Workspace Settings (`<project>/.gemini/settings.json`)
|
|
31
|
+
4. System Overrides (`settings.json`)
|
|
32
|
+
|
|
33
|
+
This means the System Overrides file has the final say. For settings that are
|
|
34
|
+
arrays (`includeDirectories`) or objects (`mcpServers`), the values are merged.
|
|
35
|
+
|
|
36
|
+
**Example of merging and precedence:**
|
|
37
|
+
|
|
38
|
+
Here is how settings from different levels are combined.
|
|
39
|
+
|
|
40
|
+
- **System defaults `system-defaults.json`:**
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"ui": {
|
|
45
|
+
"theme": "default-corporate-theme"
|
|
46
|
+
},
|
|
47
|
+
"context": {
|
|
48
|
+
"includeDirectories": ["/etc/gemini-cli/common-context"]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
- **User `settings.json` (`~/.gemini/settings.json`):**
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"ui": {
|
|
58
|
+
"theme": "user-preferred-dark-theme"
|
|
59
|
+
},
|
|
60
|
+
"mcpServers": {
|
|
61
|
+
"corp-server": {
|
|
62
|
+
"command": "/usr/local/bin/corp-server-dev"
|
|
63
|
+
},
|
|
64
|
+
"user-tool": {
|
|
65
|
+
"command": "npm start --prefix ~/tools/my-tool"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"context": {
|
|
69
|
+
"includeDirectories": ["~/gemini-context"]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
- **Workspace `settings.json` (`<project>/.gemini/settings.json`):**
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"ui": {
|
|
79
|
+
"theme": "project-specific-light-theme"
|
|
80
|
+
},
|
|
81
|
+
"mcpServers": {
|
|
82
|
+
"project-tool": {
|
|
83
|
+
"command": "npm start"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"context": {
|
|
87
|
+
"includeDirectories": ["./project-context"]
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
- **System overrides `settings.json`:**
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"ui": {
|
|
96
|
+
"theme": "system-enforced-theme"
|
|
97
|
+
},
|
|
98
|
+
"mcpServers": {
|
|
99
|
+
"corp-server": {
|
|
100
|
+
"command": "/usr/local/bin/corp-server-prod"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"context": {
|
|
104
|
+
"includeDirectories": ["/etc/gemini-cli/global-context"]
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
This results in the following merged configuration:
|
|
110
|
+
|
|
111
|
+
- **Final merged configuration:**
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"ui": {
|
|
115
|
+
"theme": "system-enforced-theme"
|
|
116
|
+
},
|
|
117
|
+
"mcpServers": {
|
|
118
|
+
"corp-server": {
|
|
119
|
+
"command": "/usr/local/bin/corp-server-prod"
|
|
120
|
+
},
|
|
121
|
+
"user-tool": {
|
|
122
|
+
"command": "npm start --prefix ~/tools/my-tool"
|
|
123
|
+
},
|
|
124
|
+
"project-tool": {
|
|
125
|
+
"command": "npm start"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"context": {
|
|
129
|
+
"includeDirectories": [
|
|
130
|
+
"/etc/gemini-cli/common-context",
|
|
131
|
+
"~/gemini-context",
|
|
132
|
+
"./project-context",
|
|
133
|
+
"/etc/gemini-cli/global-context"
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Why:**
|
|
140
|
+
|
|
141
|
+
- **`theme`**: The value from the system overrides (`system-enforced-theme`) is
|
|
142
|
+
used, as it has the highest precedence.
|
|
143
|
+
- **`mcpServers`**: The objects are merged. The `corp-server` definition from
|
|
144
|
+
the system overrides takes precedence over the user's definition. The unique
|
|
145
|
+
`user-tool` and `project-tool` are included.
|
|
146
|
+
- **`includeDirectories`**: The arrays are concatenated in the order of System
|
|
147
|
+
Defaults, User, Workspace, and then System Overrides.
|
|
148
|
+
|
|
149
|
+
- **Location**:
|
|
150
|
+
- **Linux**: `/etc/gemini-cli/settings.json`
|
|
151
|
+
- **Windows**: `C:\ProgramData\gemini-cli\settings.json`
|
|
152
|
+
- **macOS**: `/Library/Application Support/GeminiCli/settings.json`
|
|
153
|
+
- The path can be overridden using the `GEMINI_CLI_SYSTEM_SETTINGS_PATH`
|
|
154
|
+
environment variable.
|
|
155
|
+
- **Control**: This file should be managed by system administrators and
|
|
156
|
+
protected with appropriate file permissions to prevent unauthorized
|
|
157
|
+
modification by users.
|
|
158
|
+
|
|
159
|
+
By using the system settings file, you can enforce the security and
|
|
160
|
+
configuration patterns described below.
|
|
161
|
+
|
|
162
|
+
### Enforcing system settings with a wrapper script
|
|
163
|
+
|
|
164
|
+
While the `GEMINI_CLI_SYSTEM_SETTINGS_PATH` environment variable provides
|
|
165
|
+
flexibility, a user could potentially override it to point to a different
|
|
166
|
+
settings file, bypassing the centrally managed configuration. To mitigate this,
|
|
167
|
+
enterprises can deploy a wrapper script or alias that ensures the environment
|
|
168
|
+
variable is always set to the corporate-controlled path.
|
|
169
|
+
|
|
170
|
+
This approach ensures that no matter how the user calls the `gemini` command,
|
|
171
|
+
the enterprise settings are always loaded with the highest precedence.
|
|
172
|
+
|
|
173
|
+
**Example wrapper script:**
|
|
174
|
+
|
|
175
|
+
Administrators can create a script named `gemini` and place it in a directory
|
|
176
|
+
that appears earlier in the user's `PATH` than the actual Gemini CLI binary
|
|
177
|
+
(e.g., `/usr/local/bin/gemini`).
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
#!/bin/bash
|
|
181
|
+
|
|
182
|
+
# Enforce the path to the corporate system settings file.
|
|
183
|
+
# This ensures that the company's configuration is always applied.
|
|
184
|
+
export GEMINI_CLI_SYSTEM_SETTINGS_PATH="/etc/gemini-cli/settings.json"
|
|
185
|
+
|
|
186
|
+
# Find the original gemini executable.
|
|
187
|
+
# This is a simple example; a more robust solution might be needed
|
|
188
|
+
# depending on the installation method.
|
|
189
|
+
REAL_GEMINI_PATH=$(type -aP gemini | grep -v "^$(type -P gemini)$" | head -n 1)
|
|
190
|
+
|
|
191
|
+
if [ -z "$REAL_GEMINI_PATH" ]; then
|
|
192
|
+
echo "Error: The original 'gemini' executable was not found." >&2
|
|
193
|
+
exit 1
|
|
194
|
+
fi
|
|
195
|
+
|
|
196
|
+
# Pass all arguments to the real Gemini CLI executable.
|
|
197
|
+
exec "$REAL_GEMINI_PATH" "$@"
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
By deploying this script, the `GEMINI_CLI_SYSTEM_SETTINGS_PATH` is set within
|
|
201
|
+
the script's environment, and the `exec` command replaces the script process
|
|
202
|
+
with the actual Gemini CLI process, which inherits the environment variable.
|
|
203
|
+
This makes it significantly more difficult for a user to bypass the enforced
|
|
204
|
+
settings.
|
|
205
|
+
|
|
206
|
+
## Restricting tool access
|
|
207
|
+
|
|
208
|
+
You can significantly enhance security by controlling which tools the Gemini
|
|
209
|
+
model can use. This is achieved through the `tools.core` and `tools.exclude`
|
|
210
|
+
settings. For a list of available tools, see the
|
|
211
|
+
[Tools documentation](../tools/index.md).
|
|
212
|
+
|
|
213
|
+
### Allowlisting with `coreTools`
|
|
214
|
+
|
|
215
|
+
The most secure approach is to explicitly add the tools and commands that users
|
|
216
|
+
are permitted to execute to an allowlist. This prevents the use of any tool not
|
|
217
|
+
on the approved list.
|
|
218
|
+
|
|
219
|
+
**Example:** Allow only safe, read-only file operations and listing files.
|
|
220
|
+
|
|
221
|
+
```json
|
|
222
|
+
{
|
|
223
|
+
"tools": {
|
|
224
|
+
"core": ["ReadFileTool", "GlobTool", "ShellTool(ls)"]
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Blocklisting with `excludeTools`
|
|
230
|
+
|
|
231
|
+
Alternatively, you can add specific tools that are considered dangerous in your
|
|
232
|
+
environment to a blocklist.
|
|
233
|
+
|
|
234
|
+
**Example:** Prevent the use of the shell tool for removing files.
|
|
235
|
+
|
|
236
|
+
```json
|
|
237
|
+
{
|
|
238
|
+
"tools": {
|
|
239
|
+
"exclude": ["ShellTool(rm -rf)"]
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
**Security note:** Blocklisting with `excludeTools` is less secure than
|
|
245
|
+
allowlisting with `coreTools`, as it relies on blocking known-bad commands, and
|
|
246
|
+
clever users may find ways to bypass simple string-based blocks. **Allowlisting
|
|
247
|
+
is the recommended approach.**
|
|
248
|
+
|
|
249
|
+
### Disabling YOLO mode
|
|
250
|
+
|
|
251
|
+
To ensure that users cannot bypass the confirmation prompt for tool execution,
|
|
252
|
+
you can disable YOLO mode at the policy level. This adds a critical layer of
|
|
253
|
+
safety, as it prevents the model from executing tools without explicit user
|
|
254
|
+
approval.
|
|
255
|
+
|
|
256
|
+
**Example:** Force all tool executions to require user confirmation.
|
|
257
|
+
|
|
258
|
+
```json
|
|
259
|
+
{
|
|
260
|
+
"security": {
|
|
261
|
+
"disableYoloMode": true
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
This setting is highly recommended in an enterprise environment to prevent
|
|
267
|
+
unintended tool execution.
|
|
268
|
+
|
|
269
|
+
## Managing custom tools (MCP servers)
|
|
270
|
+
|
|
271
|
+
If your organization uses custom tools via
|
|
272
|
+
[Model-Context Protocol (MCP) servers](../core/tools-api.md), it is crucial to
|
|
273
|
+
understand how server configurations are managed to apply security policies
|
|
274
|
+
effectively.
|
|
275
|
+
|
|
276
|
+
### How MCP server configurations are merged
|
|
277
|
+
|
|
278
|
+
Gemini CLI loads `settings.json` files from three levels: System, Workspace, and
|
|
279
|
+
User. When it comes to the `mcpServers` object, these configurations are
|
|
280
|
+
**merged**:
|
|
281
|
+
|
|
282
|
+
1. **Merging:** The lists of servers from all three levels are combined into a
|
|
283
|
+
single list.
|
|
284
|
+
2. **Precedence:** If a server with the **same name** is defined at multiple
|
|
285
|
+
levels (e.g., a server named `corp-api` exists in both system and user
|
|
286
|
+
settings), the definition from the highest-precedence level is used. The
|
|
287
|
+
order of precedence is: **System > Workspace > User**.
|
|
288
|
+
|
|
289
|
+
This means a user **cannot** override the definition of a server that is already
|
|
290
|
+
defined in the system-level settings. However, they **can** add new servers with
|
|
291
|
+
unique names.
|
|
292
|
+
|
|
293
|
+
### Enforcing a catalog of tools
|
|
294
|
+
|
|
295
|
+
The security of your MCP tool ecosystem depends on a combination of defining the
|
|
296
|
+
canonical servers and adding their names to an allowlist.
|
|
297
|
+
|
|
298
|
+
### Restricting tools within an MCP server
|
|
299
|
+
|
|
300
|
+
For even greater security, especially when dealing with third-party MCP servers,
|
|
301
|
+
you can restrict which specific tools from a server are exposed to the model.
|
|
302
|
+
This is done using the `includeTools` and `excludeTools` properties within a
|
|
303
|
+
server's definition. This allows you to use a subset of tools from a server
|
|
304
|
+
without allowing potentially dangerous ones.
|
|
305
|
+
|
|
306
|
+
Following the principle of least privilege, it is highly recommended to use
|
|
307
|
+
`includeTools` to create an allowlist of only the necessary tools.
|
|
308
|
+
|
|
309
|
+
**Example:** Only allow the `code-search` and `get-ticket-details` tools from a
|
|
310
|
+
third-party MCP server, even if the server offers other tools like
|
|
311
|
+
`delete-ticket`.
|
|
312
|
+
|
|
313
|
+
```json
|
|
314
|
+
{
|
|
315
|
+
"mcp": {
|
|
316
|
+
"allowed": ["third-party-analyzer"]
|
|
317
|
+
},
|
|
318
|
+
"mcpServers": {
|
|
319
|
+
"third-party-analyzer": {
|
|
320
|
+
"command": "/usr/local/bin/start-3p-analyzer.sh",
|
|
321
|
+
"includeTools": ["code-search", "get-ticket-details"]
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
#### More secure pattern: Define and add to allowlist in system settings
|
|
328
|
+
|
|
329
|
+
To create a secure, centrally-managed catalog of tools, the system administrator
|
|
330
|
+
**must** do both of the following in the system-level `settings.json` file:
|
|
331
|
+
|
|
332
|
+
1. **Define the full configuration** for every approved server in the
|
|
333
|
+
`mcpServers` object. This ensures that even if a user defines a server with
|
|
334
|
+
the same name, the secure system-level definition will take precedence.
|
|
335
|
+
2. **Add the names** of those servers to an allowlist using the `mcp.allowed`
|
|
336
|
+
setting. This is a critical security step that prevents users from running
|
|
337
|
+
any servers that are not on this list. If this setting is omitted, the CLI
|
|
338
|
+
will merge and allow any server defined by the user.
|
|
339
|
+
|
|
340
|
+
**Example system `settings.json`:**
|
|
341
|
+
|
|
342
|
+
1. Add the _names_ of all approved servers to an allowlist. This will prevent
|
|
343
|
+
users from adding their own servers.
|
|
344
|
+
|
|
345
|
+
2. Provide the canonical _definition_ for each server on the allowlist.
|
|
346
|
+
|
|
347
|
+
```json
|
|
348
|
+
{
|
|
349
|
+
"mcp": {
|
|
350
|
+
"allowed": ["corp-data-api", "source-code-analyzer"]
|
|
351
|
+
},
|
|
352
|
+
"mcpServers": {
|
|
353
|
+
"corp-data-api": {
|
|
354
|
+
"command": "/usr/local/bin/start-corp-api.sh",
|
|
355
|
+
"timeout": 5000
|
|
356
|
+
},
|
|
357
|
+
"source-code-analyzer": {
|
|
358
|
+
"command": "/usr/local/bin/start-analyzer.sh"
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
This pattern is more secure because it uses both definition and an allowlist.
|
|
365
|
+
Any server a user defines will either be overridden by the system definition (if
|
|
366
|
+
it has the same name) or blocked because its name is not in the `mcp.allowed`
|
|
367
|
+
list.
|
|
368
|
+
|
|
369
|
+
### Less secure pattern: Omitting the allowlist
|
|
370
|
+
|
|
371
|
+
If the administrator defines the `mcpServers` object but fails to also specify
|
|
372
|
+
the `mcp.allowed` allowlist, users may add their own servers.
|
|
373
|
+
|
|
374
|
+
**Example system `settings.json`:**
|
|
375
|
+
|
|
376
|
+
This configuration defines servers but does not enforce the allowlist. The
|
|
377
|
+
administrator has NOT included the "mcp.allowed" setting.
|
|
378
|
+
|
|
379
|
+
```json
|
|
380
|
+
{
|
|
381
|
+
"mcpServers": {
|
|
382
|
+
"corp-data-api": {
|
|
383
|
+
"command": "/usr/local/bin/start-corp-api.sh"
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
In this scenario, a user can add their own server in their local
|
|
390
|
+
`settings.json`. Because there is no `mcp.allowed` list to filter the merged
|
|
391
|
+
results, the user's server will be added to the list of available tools and
|
|
392
|
+
allowed to run.
|
|
393
|
+
|
|
394
|
+
## Enforcing sandboxing for security
|
|
395
|
+
|
|
396
|
+
To mitigate the risk of potentially harmful operations, you can enforce the use
|
|
397
|
+
of sandboxing for all tool execution. The sandbox isolates tool execution in a
|
|
398
|
+
containerized environment.
|
|
399
|
+
|
|
400
|
+
**Example:** Force all tool execution to happen within a Docker sandbox.
|
|
401
|
+
|
|
402
|
+
```json
|
|
403
|
+
{
|
|
404
|
+
"tools": {
|
|
405
|
+
"sandbox": "docker"
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
You can also specify a custom, hardened Docker image for the sandbox by building
|
|
411
|
+
a custom `sandbox.Dockerfile` as described in the
|
|
412
|
+
[Sandboxing documentation](./sandbox.md).
|
|
413
|
+
|
|
414
|
+
## Controlling network access via proxy
|
|
415
|
+
|
|
416
|
+
In corporate environments with strict network policies, you can configure Gemini
|
|
417
|
+
CLI to route all outbound traffic through a corporate proxy. This can be set via
|
|
418
|
+
an environment variable, but it can also be enforced for custom tools via the
|
|
419
|
+
`mcpServers` configuration.
|
|
420
|
+
|
|
421
|
+
**Example (for an MCP server):**
|
|
422
|
+
|
|
423
|
+
```json
|
|
424
|
+
{
|
|
425
|
+
"mcpServers": {
|
|
426
|
+
"proxied-server": {
|
|
427
|
+
"command": "node",
|
|
428
|
+
"args": ["mcp_server.js"],
|
|
429
|
+
"env": {
|
|
430
|
+
"HTTP_PROXY": "http://proxy.example.com:8080",
|
|
431
|
+
"HTTPS_PROXY": "http://proxy.example.com:8080"
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
## Telemetry and auditing
|
|
439
|
+
|
|
440
|
+
For auditing and monitoring purposes, you can configure Gemini CLI to send
|
|
441
|
+
telemetry data to a central location. This allows you to track tool usage and
|
|
442
|
+
other events. For more information, see the
|
|
443
|
+
[telemetry documentation](./telemetry.md).
|
|
444
|
+
|
|
445
|
+
**Example:** Enable telemetry and send it to a local OTLP collector. If
|
|
446
|
+
`otlpEndpoint` is not specified, it defaults to `http://localhost:4317`.
|
|
447
|
+
|
|
448
|
+
```json
|
|
449
|
+
{
|
|
450
|
+
"telemetry": {
|
|
451
|
+
"enabled": true,
|
|
452
|
+
"target": "gcp",
|
|
453
|
+
"logPrompts": false
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
**Note:** Ensure that `logPrompts` is set to `false` in an enterprise setting to
|
|
459
|
+
avoid collecting potentially sensitive information from user prompts.
|
|
460
|
+
|
|
461
|
+
## Authentication
|
|
462
|
+
|
|
463
|
+
You can enforce a specific authentication method for all users by setting the
|
|
464
|
+
`enforcedAuthType` in the system-level `settings.json` file. This prevents users
|
|
465
|
+
from choosing a different authentication method. See the
|
|
466
|
+
[Authentication docs](./authentication.md) for more details.
|
|
467
|
+
|
|
468
|
+
**Example:** Enforce the use of Google login for all users.
|
|
469
|
+
|
|
470
|
+
```json
|
|
471
|
+
{
|
|
472
|
+
"enforcedAuthType": "oauth-personal"
|
|
473
|
+
}
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
If a user has a different authentication method configured, they will be
|
|
477
|
+
prompted to switch to the enforced method. In non-interactive mode, the CLI will
|
|
478
|
+
exit with an error if the configured authentication method does not match the
|
|
479
|
+
enforced one.
|
|
480
|
+
|
|
481
|
+
### Restricting logins to corporate domains
|
|
482
|
+
|
|
483
|
+
For enterprises using Google Workspace, you can enforce that users only
|
|
484
|
+
authenticate with their corporate Google accounts. This is a network-level
|
|
485
|
+
control that is configured on a proxy server, not within Gemini CLI itself. It
|
|
486
|
+
works by intercepting authentication requests to Google and adding a special
|
|
487
|
+
HTTP header.
|
|
488
|
+
|
|
489
|
+
This policy prevents users from logging in with personal Gmail accounts or other
|
|
490
|
+
non-corporate Google accounts.
|
|
491
|
+
|
|
492
|
+
For detailed instructions, see the Google Workspace Admin Help article on
|
|
493
|
+
[blocking access to consumer accounts](https://support.google.com/a/answer/1668854?hl=en#zippy=%2Cstep-choose-a-web-proxy-server%2Cstep-configure-the-network-to-block-certain-accounts).
|
|
494
|
+
|
|
495
|
+
The general steps are as follows:
|
|
496
|
+
|
|
497
|
+
1. **Intercept Requests**: Configure your web proxy to intercept all requests
|
|
498
|
+
to `google.com`.
|
|
499
|
+
2. **Add HTTP Header**: For each intercepted request, add the
|
|
500
|
+
`X-GoogApps-Allowed-Domains` HTTP header.
|
|
501
|
+
3. **Specify Domains**: The value of the header should be a comma-separated
|
|
502
|
+
list of your approved Google Workspace domain names.
|
|
503
|
+
|
|
504
|
+
**Example header:**
|
|
505
|
+
|
|
506
|
+
```
|
|
507
|
+
X-GoogApps-Allowed-Domains: my-corporate-domain.com, secondary-domain.com
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
When this header is present, Google's authentication service will only allow
|
|
511
|
+
logins from accounts belonging to the specified domains.
|
|
512
|
+
|
|
513
|
+
## Putting it all together: example system `settings.json`
|
|
514
|
+
|
|
515
|
+
Here is an example of a system `settings.json` file that combines several of the
|
|
516
|
+
patterns discussed above to create a secure, controlled environment for Gemini
|
|
517
|
+
CLI.
|
|
518
|
+
|
|
519
|
+
```json
|
|
520
|
+
{
|
|
521
|
+
"tools": {
|
|
522
|
+
"sandbox": "docker",
|
|
523
|
+
"core": [
|
|
524
|
+
"ReadFileTool",
|
|
525
|
+
"GlobTool",
|
|
526
|
+
"ShellTool(ls)",
|
|
527
|
+
"ShellTool(cat)",
|
|
528
|
+
"ShellTool(grep)"
|
|
529
|
+
]
|
|
530
|
+
},
|
|
531
|
+
"mcp": {
|
|
532
|
+
"allowed": ["corp-tools"]
|
|
533
|
+
},
|
|
534
|
+
"mcpServers": {
|
|
535
|
+
"corp-tools": {
|
|
536
|
+
"command": "/opt/gemini-tools/start.sh",
|
|
537
|
+
"timeout": 5000
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
"telemetry": {
|
|
541
|
+
"enabled": true,
|
|
542
|
+
"target": "gcp",
|
|
543
|
+
"otlpEndpoint": "https://telemetry-prod.example.com:4317",
|
|
544
|
+
"logPrompts": false
|
|
545
|
+
},
|
|
546
|
+
"advanced": {
|
|
547
|
+
"bugCommand": {
|
|
548
|
+
"urlTemplate": "https://servicedesk.example.com/new-ticket?title={title}&details={info}"
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
"privacy": {
|
|
552
|
+
"usageStatisticsEnabled": false
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
This configuration:
|
|
558
|
+
|
|
559
|
+
- Forces all tool execution into a Docker sandbox.
|
|
560
|
+
- Strictly uses an allowlist for a small set of safe shell commands and file
|
|
561
|
+
tools.
|
|
562
|
+
- Defines and allows a single corporate MCP server for custom tools.
|
|
563
|
+
- Enables telemetry for auditing, without logging prompt content.
|
|
564
|
+
- Redirects the `/bug` command to an internal ticketing system.
|
|
565
|
+
- Disables general usage statistics collection.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Ignoring files
|
|
2
|
+
|
|
3
|
+
This document provides an overview of the Gemini Ignore (`.geminiignore`)
|
|
4
|
+
feature of the Gemini CLI.
|
|
5
|
+
|
|
6
|
+
The Gemini CLI includes the ability to automatically ignore files, similar to
|
|
7
|
+
`.gitignore` (used by Git) and `.aiexclude` (used by Gemini Code Assist). Adding
|
|
8
|
+
paths to your `.geminiignore` file will exclude them from tools that support
|
|
9
|
+
this feature, although they will still be visible to other services (such as
|
|
10
|
+
Git).
|
|
11
|
+
|
|
12
|
+
## How it works
|
|
13
|
+
|
|
14
|
+
When you add a path to your `.geminiignore` file, tools that respect this file
|
|
15
|
+
will exclude matching files and directories from their operations. For example,
|
|
16
|
+
when you use the `@` command to share files, any paths in your `.geminiignore`
|
|
17
|
+
file will be automatically excluded.
|
|
18
|
+
|
|
19
|
+
For the most part, `.geminiignore` follows the conventions of `.gitignore`
|
|
20
|
+
files:
|
|
21
|
+
|
|
22
|
+
- Blank lines and lines starting with `#` are ignored.
|
|
23
|
+
- Standard glob patterns are supported (such as `*`, `?`, and `[]`).
|
|
24
|
+
- Putting a `/` at the end will only match directories.
|
|
25
|
+
- Putting a `/` at the beginning anchors the path relative to the
|
|
26
|
+
`.geminiignore` file.
|
|
27
|
+
- `!` negates a pattern.
|
|
28
|
+
|
|
29
|
+
You can update your `.geminiignore` file at any time. To apply the changes, you
|
|
30
|
+
must restart your Gemini CLI session.
|
|
31
|
+
|
|
32
|
+
## How to use `.geminiignore`
|
|
33
|
+
|
|
34
|
+
To enable `.geminiignore`:
|
|
35
|
+
|
|
36
|
+
1. Create a file named `.geminiignore` in the root of your project directory.
|
|
37
|
+
|
|
38
|
+
To add a file or directory to `.geminiignore`:
|
|
39
|
+
|
|
40
|
+
1. Open your `.geminiignore` file.
|
|
41
|
+
2. Add the path or file you want to ignore, for example: `/archive/` or
|
|
42
|
+
`apikeys.txt`.
|
|
43
|
+
|
|
44
|
+
### `.geminiignore` examples
|
|
45
|
+
|
|
46
|
+
You can use `.geminiignore` to ignore directories and files:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
# Exclude your /packages/ directory and all subdirectories
|
|
50
|
+
/packages/
|
|
51
|
+
|
|
52
|
+
# Exclude your apikeys.txt file
|
|
53
|
+
apikeys.txt
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
You can use wildcards in your `.geminiignore` file with `*`:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
# Exclude all .md files
|
|
60
|
+
*.md
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Finally, you can exclude files and directories from exclusion with `!`:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
# Exclude all .md files except README.md
|
|
67
|
+
*.md
|
|
68
|
+
!README.md
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
To remove paths from your `.geminiignore` file, delete the relevant lines.
|