@office-ai/aioncli-core 0.30.0 → 0.30.1
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/assets/theme-ansi-dark.png +0 -0
- package/dist/docs/assets/theme-atom-one-dark.png +0 -0
- package/dist/docs/assets/theme-ayu-dark.png +0 -0
- package/dist/docs/assets/theme-default-dark.png +0 -0
- package/dist/docs/assets/theme-dracula-dark.png +0 -0
- package/dist/docs/assets/theme-github-dark.png +0 -0
- package/dist/docs/assets/theme-holiday-dark.png +0 -0
- package/dist/docs/assets/theme-shades-of-purple-dark.png +0 -0
- package/dist/docs/assets/theme-solarized-dark.png +0 -0
- package/dist/docs/assets/theme-solarized-light.png +0 -0
- package/dist/docs/cli/notifications.md +58 -0
- package/dist/docs/redirects.json +20 -0
- package/dist/docs/reference/commands.md +563 -0
- package/dist/docs/reference/configuration.md +1804 -0
- package/dist/docs/reference/keyboard-shortcuts.md +168 -0
- package/dist/docs/reference/memport.md +246 -0
- package/dist/docs/reference/policy-engine.md +386 -0
- package/dist/docs/reference/tools.md +106 -0
- package/dist/docs/resources/faq.md +175 -0
- package/dist/docs/resources/quota-and-pricing.md +199 -0
- package/dist/docs/resources/tos-privacy.md +102 -0
- package/dist/docs/resources/troubleshooting.md +176 -0
- package/dist/docs/resources/uninstall.md +56 -0
- package/dist/src/agents/a2a-errors.d.ts +65 -0
- package/dist/src/agents/a2a-errors.js +164 -0
- package/dist/src/agents/a2a-errors.js.map +1 -0
- package/dist/src/agents/a2a-errors.test.d.ts +6 -0
- package/dist/src/agents/a2a-errors.test.js +183 -0
- package/dist/src/agents/a2a-errors.test.js.map +1 -0
- package/dist/src/agents/auth-provider/api-key-provider.d.ts +30 -0
- package/dist/src/agents/auth-provider/api-key-provider.js +66 -0
- package/dist/src/agents/auth-provider/api-key-provider.js.map +1 -0
- package/dist/src/agents/auth-provider/api-key-provider.test.d.ts +6 -0
- package/dist/src/agents/auth-provider/api-key-provider.test.js +130 -0
- package/dist/src/agents/auth-provider/api-key-provider.test.js.map +1 -0
- package/dist/src/agents/auth-provider/http-provider.d.ts +28 -0
- package/dist/src/agents/auth-provider/http-provider.js +73 -0
- package/dist/src/agents/auth-provider/http-provider.js.map +1 -0
- package/dist/src/agents/auth-provider/http-provider.test.d.ts +6 -0
- package/dist/src/agents/auth-provider/http-provider.test.js +112 -0
- package/dist/src/agents/auth-provider/http-provider.test.js.map +1 -0
- package/dist/src/agents/auth-provider/oauth2-provider.d.ts +65 -0
- package/dist/src/agents/auth-provider/oauth2-provider.js +233 -0
- package/dist/src/agents/auth-provider/oauth2-provider.js.map +1 -0
- package/dist/src/agents/auth-provider/oauth2-provider.test.d.ts +6 -0
- package/dist/src/agents/auth-provider/oauth2-provider.test.js +490 -0
- package/dist/src/agents/auth-provider/oauth2-provider.test.js.map +1 -0
- package/dist/src/agents/browser/analyzeScreenshot.d.ts +35 -0
- package/dist/src/agents/browser/analyzeScreenshot.js +183 -0
- package/dist/src/agents/browser/analyzeScreenshot.js.map +1 -0
- package/dist/src/agents/browser/analyzeScreenshot.test.d.ts +6 -0
- package/dist/src/agents/browser/analyzeScreenshot.test.js +161 -0
- package/dist/src/agents/browser/analyzeScreenshot.test.js.map +1 -0
- package/dist/src/agents/browser/automationOverlay.d.ts +26 -0
- package/dist/src/agents/browser/automationOverlay.js +100 -0
- package/dist/src/agents/browser/automationOverlay.js.map +1 -0
- package/dist/src/agents/browser/browserAgentDefinition.d.ts +50 -0
- package/dist/src/agents/browser/browserAgentDefinition.js +141 -0
- package/dist/src/agents/browser/browserAgentDefinition.js.map +1 -0
- package/dist/src/agents/browser/browserAgentFactory.d.ts +42 -0
- package/dist/src/agents/browser/browserAgentFactory.js +116 -0
- package/dist/src/agents/browser/browserAgentFactory.js.map +1 -0
- package/dist/src/agents/browser/browserAgentFactory.test.d.ts +6 -0
- package/dist/src/agents/browser/browserAgentFactory.test.js +240 -0
- package/dist/src/agents/browser/browserAgentFactory.test.js.map +1 -0
- package/dist/src/agents/browser/browserAgentInvocation.d.ts +34 -0
- package/dist/src/agents/browser/browserAgentInvocation.js +386 -0
- package/dist/src/agents/browser/browserAgentInvocation.js.map +1 -0
- package/dist/src/agents/browser/browserAgentInvocation.test.d.ts +6 -0
- package/dist/src/agents/browser/browserAgentInvocation.test.js +382 -0
- package/dist/src/agents/browser/browserAgentInvocation.test.js.map +1 -0
- package/dist/src/agents/browser/browserManager.d.ts +115 -0
- package/dist/src/agents/browser/browserManager.js +370 -0
- package/dist/src/agents/browser/browserManager.js.map +1 -0
- package/dist/src/agents/browser/browserManager.test.d.ts +6 -0
- package/dist/src/agents/browser/browserManager.test.js +382 -0
- package/dist/src/agents/browser/browserManager.test.js.map +1 -0
- package/dist/src/agents/browser/mcpToolWrapper.d.ts +45 -0
- package/dist/src/agents/browser/mcpToolWrapper.js +358 -0
- package/dist/src/agents/browser/mcpToolWrapper.js.map +1 -0
- package/dist/src/agents/browser/mcpToolWrapper.test.d.ts +6 -0
- package/dist/src/agents/browser/mcpToolWrapper.test.js +126 -0
- package/dist/src/agents/browser/mcpToolWrapper.test.js.map +1 -0
- package/dist/src/agents/browser/mcpToolWrapperConfirmation.test.d.ts +6 -0
- package/dist/src/agents/browser/mcpToolWrapperConfirmation.test.js +59 -0
- package/dist/src/agents/browser/mcpToolWrapperConfirmation.test.js.map +1 -0
- package/dist/src/agents/browser/modelAvailability.d.ts +23 -0
- package/dist/src/agents/browser/modelAvailability.js +23 -0
- package/dist/src/agents/browser/modelAvailability.js.map +1 -0
- package/dist/src/agents/cli-help-agent.d.ts +2 -2
- package/dist/src/billing/billing.d.ts +80 -0
- package/dist/src/billing/billing.js +128 -0
- package/dist/src/billing/billing.js.map +1 -0
- package/dist/src/billing/billing.test.d.ts +6 -0
- package/dist/src/billing/billing.test.js +182 -0
- package/dist/src/billing/billing.test.js.map +1 -0
- package/dist/src/billing/index.d.ts +6 -0
- package/dist/src/billing/index.js +7 -0
- package/dist/src/billing/index.js.map +1 -0
- package/dist/src/code_assist/oauth2.d.ts +1 -1
- package/dist/src/code_assist/types.d.ts +26 -26
- package/dist/src/config/agent-loop-context.d.ts +22 -0
- package/dist/src/config/agent-loop-context.js +7 -0
- package/dist/src/config/agent-loop-context.js.map +1 -0
- package/dist/src/config/trackerFeatureFlag.test.d.ts +6 -0
- package/dist/src/config/trackerFeatureFlag.test.js +43 -0
- package/dist/src/config/trackerFeatureFlag.test.js.map +1 -0
- package/dist/src/config/userHintService.d.ts +46 -0
- package/dist/src/config/userHintService.js +81 -0
- package/dist/src/config/userHintService.js.map +1 -0
- package/dist/src/config/userHintService.test.d.ts +6 -0
- package/dist/src/config/userHintService.test.js +62 -0
- package/dist/src/config/userHintService.test.js.map +1 -0
- package/dist/src/core/localLiteRtLmClient.d.ts +24 -0
- package/dist/src/core/localLiteRtLmClient.js +77 -0
- package/dist/src/core/localLiteRtLmClient.js.map +1 -0
- package/dist/src/core/localLiteRtLmClient.test.d.ts +6 -0
- package/dist/src/core/localLiteRtLmClient.test.js +87 -0
- package/dist/src/core/localLiteRtLmClient.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator.d.ts +1 -0
- package/dist/src/core/openaiContentGenerator.js +13 -13
- package/dist/src/core/openaiContentGenerator.js.map +1 -1
- package/dist/src/hooks/runtimeHooks.test.d.ts +6 -0
- package/dist/src/hooks/runtimeHooks.test.js +100 -0
- package/dist/src/hooks/runtimeHooks.test.js.map +1 -0
- package/dist/src/ide/types.d.ts +6 -6
- package/dist/src/mcp/mcp-oauth-provider.d.ts +43 -0
- package/dist/src/mcp/mcp-oauth-provider.js +67 -0
- package/dist/src/mcp/mcp-oauth-provider.js.map +1 -0
- package/dist/src/mcp/mcp-oauth-provider.test.d.ts +6 -0
- package/dist/src/mcp/mcp-oauth-provider.test.js +63 -0
- package/dist/src/mcp/mcp-oauth-provider.test.js.map +1 -0
- package/dist/src/policy/integrity.d.ts +45 -0
- package/dist/src/policy/integrity.js +121 -0
- package/dist/src/policy/integrity.js.map +1 -0
- package/dist/src/policy/integrity.test.d.ts +6 -0
- package/dist/src/policy/integrity.test.js +132 -0
- package/dist/src/policy/integrity.test.js.map +1 -0
- package/dist/src/policy/policies/conseca.toml +6 -0
- package/dist/src/policy/workspace-policy.test.js +231 -0
- package/dist/src/policy/workspace-policy.test.js.map +1 -0
- package/dist/src/routing/strategies/approvalModeStrategy.d.ts +18 -0
- package/dist/src/routing/strategies/approvalModeStrategy.js +59 -0
- package/dist/src/routing/strategies/approvalModeStrategy.js.map +1 -0
- package/dist/src/routing/strategies/approvalModeStrategy.test.d.ts +6 -0
- package/dist/src/routing/strategies/approvalModeStrategy.test.js +140 -0
- package/dist/src/routing/strategies/approvalModeStrategy.test.js.map +1 -0
- package/dist/src/routing/strategies/gemmaClassifierStrategy.d.ts +14 -0
- package/dist/src/routing/strategies/gemmaClassifierStrategy.js +182 -0
- package/dist/src/routing/strategies/gemmaClassifierStrategy.js.map +1 -0
- package/dist/src/routing/strategies/gemmaClassifierStrategy.test.d.ts +6 -0
- package/dist/src/routing/strategies/gemmaClassifierStrategy.test.js +218 -0
- package/dist/src/routing/strategies/gemmaClassifierStrategy.test.js.map +1 -0
- package/dist/src/safety/conseca/conseca.d.ts +31 -0
- package/dist/src/safety/conseca/conseca.js +105 -0
- package/dist/src/safety/conseca/conseca.js.map +1 -0
- package/dist/src/safety/conseca/conseca.test.js +226 -0
- package/dist/src/safety/conseca/conseca.test.js.map +1 -0
- package/dist/src/safety/conseca/integration.test.js +19 -0
- package/dist/src/safety/conseca/integration.test.js.map +1 -0
- package/dist/src/safety/conseca/policy-enforcer.d.ts +13 -0
- package/dist/src/safety/conseca/policy-enforcer.js +135 -0
- package/dist/src/safety/conseca/policy-enforcer.js.map +1 -0
- package/dist/src/safety/conseca/policy-enforcer.test.js +141 -0
- package/dist/src/safety/conseca/policy-enforcer.test.js.map +1 -0
- package/dist/src/safety/conseca/policy-generator.d.ts +15 -0
- package/dist/src/safety/conseca/policy-generator.js +144 -0
- package/dist/src/safety/conseca/policy-generator.js.map +1 -0
- package/dist/src/safety/conseca/policy-generator.test.d.ts +6 -0
- package/dist/src/safety/conseca/policy-generator.test.js +84 -0
- package/dist/src/safety/conseca/policy-generator.test.js.map +1 -0
- package/dist/src/safety/conseca/types.d.ts +15 -0
- package/dist/src/safety/conseca/types.js +7 -0
- package/dist/src/safety/conseca/types.js.map +1 -0
- package/dist/src/scheduler/scheduler_parallel.test.d.ts +6 -0
- package/dist/src/scheduler/scheduler_parallel.test.js +401 -0
- package/dist/src/scheduler/scheduler_parallel.test.js.map +1 -0
- package/dist/src/services/FolderTrustDiscoveryService.d.ts +32 -0
- package/dist/src/services/FolderTrustDiscoveryService.js +169 -0
- package/dist/src/services/FolderTrustDiscoveryService.js.map +1 -0
- package/dist/src/services/FolderTrustDiscoveryService.test.d.ts +6 -0
- package/dist/src/services/FolderTrustDiscoveryService.test.js +118 -0
- package/dist/src/services/FolderTrustDiscoveryService.test.js.map +1 -0
- package/dist/src/services/fileKeychain.d.ts +24 -0
- package/dist/src/services/fileKeychain.js +123 -0
- package/dist/src/services/fileKeychain.js.map +1 -0
- package/dist/src/services/keychainService.d.ts +51 -0
- package/dist/src/services/keychainService.js +133 -0
- package/dist/src/services/keychainService.js.map +1 -0
- package/dist/src/services/keychainService.test.d.ts +6 -0
- package/dist/src/services/keychainService.test.js +150 -0
- package/dist/src/services/keychainService.test.js.map +1 -0
- package/dist/src/services/keychainTypes.d.ts +41 -0
- package/dist/src/services/keychainTypes.js +18 -0
- package/dist/src/services/keychainTypes.js.map +1 -0
- package/dist/src/services/trackerService.d.ts +49 -0
- package/dist/src/services/trackerService.js +193 -0
- package/dist/src/services/trackerService.js.map +1 -0
- package/dist/src/services/trackerService.test.d.ts +6 -0
- package/dist/src/services/trackerService.test.js +117 -0
- package/dist/src/services/trackerService.test.js.map +1 -0
- package/dist/src/services/trackerTypes.d.ts +51 -0
- package/dist/src/services/trackerTypes.js +33 -0
- package/dist/src/services/trackerTypes.js.map +1 -0
- package/dist/src/telemetry/billingEvents.d.ts +75 -0
- package/dist/src/telemetry/billingEvents.js +181 -0
- package/dist/src/telemetry/billingEvents.js.map +1 -0
- package/dist/src/telemetry/billingEvents.test.d.ts +6 -0
- package/dist/src/telemetry/billingEvents.test.js +139 -0
- package/dist/src/telemetry/billingEvents.test.js.map +1 -0
- package/dist/src/telemetry/conseca-logger.d.ts +9 -0
- package/dist/src/telemetry/conseca-logger.js +91 -0
- package/dist/src/telemetry/conseca-logger.js.map +1 -0
- package/dist/src/telemetry/conseca-logger.test.d.ts +6 -0
- package/dist/src/telemetry/conseca-logger.test.js +90 -0
- package/dist/src/telemetry/conseca-logger.test.js.map +1 -0
- package/dist/src/telemetry/trace.test.d.ts +6 -0
- package/dist/src/telemetry/trace.test.js +116 -0
- package/dist/src/telemetry/trace.test.js.map +1 -0
- package/dist/src/tools/definitions/trackerTools.d.ts +12 -0
- package/dist/src/tools/definitions/trackerTools.js +146 -0
- package/dist/src/tools/definitions/trackerTools.js.map +1 -0
- package/dist/src/tools/diff-utils.d.ts +9 -0
- package/dist/src/tools/diff-utils.js +66 -0
- package/dist/src/tools/diff-utils.js.map +1 -0
- package/dist/src/tools/diff-utils.test.d.ts +6 -0
- package/dist/src/tools/diff-utils.test.js +53 -0
- package/dist/src/tools/diff-utils.test.js.map +1 -0
- package/dist/src/tools/grep-utils.d.ts +49 -0
- package/dist/src/tools/grep-utils.js +147 -0
- package/dist/src/tools/grep-utils.js.map +1 -0
- package/dist/src/tools/omissionPlaceholderDetector.d.ts +15 -0
- package/dist/src/tools/omissionPlaceholderDetector.js +90 -0
- package/dist/src/tools/omissionPlaceholderDetector.js.map +1 -0
- package/dist/src/tools/omissionPlaceholderDetector.test.d.ts +6 -0
- package/dist/src/tools/omissionPlaceholderDetector.test.js +49 -0
- package/dist/src/tools/omissionPlaceholderDetector.test.js.map +1 -0
- package/dist/src/tools/trackerTools.d.ts +122 -0
- package/dist/src/tools/trackerTools.js +365 -0
- package/dist/src/tools/trackerTools.js.map +1 -0
- package/dist/src/tools/trackerTools.test.d.ts +6 -0
- package/dist/src/tools/trackerTools.test.js +97 -0
- package/dist/src/tools/trackerTools.test.js.map +1 -0
- package/dist/src/utils/approvalModeUtils.d.ts +14 -0
- package/dist/src/utils/approvalModeUtils.js +35 -0
- package/dist/src/utils/approvalModeUtils.js.map +1 -0
- package/dist/src/utils/approvalModeUtils.test.d.ts +6 -0
- package/dist/src/utils/approvalModeUtils.test.js +36 -0
- package/dist/src/utils/approvalModeUtils.test.js.map +1 -0
- package/dist/src/utils/cache.d.ts +63 -0
- package/dist/src/utils/cache.js +103 -0
- package/dist/src/utils/cache.js.map +1 -0
- package/dist/src/utils/cache.test.d.ts +6 -0
- package/dist/src/utils/cache.test.js +158 -0
- package/dist/src/utils/cache.test.js.map +1 -0
- package/dist/src/utils/checkpointUtils.d.ts +2 -2
- package/dist/src/utils/compatibility.d.ts +41 -0
- package/dist/src/utils/compatibility.js +112 -0
- package/dist/src/utils/compatibility.js.map +1 -0
- package/dist/src/utils/compatibility.test.d.ts +6 -0
- package/dist/src/utils/compatibility.test.js +233 -0
- package/dist/src/utils/compatibility.test.js.map +1 -0
- package/dist/src/utils/envExpansion.d.ts +18 -0
- package/dist/src/utils/envExpansion.js +46 -0
- package/dist/src/utils/envExpansion.js.map +1 -0
- package/dist/src/utils/envExpansion.test.d.ts +6 -0
- package/dist/src/utils/envExpansion.test.js +110 -0
- package/dist/src/utils/envExpansion.test.js.map +1 -0
- package/dist/src/utils/errors_timeout.test.d.ts +6 -0
- package/dist/src/utils/errors_timeout.test.js +40 -0
- package/dist/src/utils/errors_timeout.test.js.map +1 -0
- package/dist/src/utils/fetch.test.d.ts +6 -0
- package/dist/src/utils/fetch.test.js +206 -0
- package/dist/src/utils/fetch.test.js.map +1 -0
- package/dist/src/utils/markdownUtils.d.ts +22 -0
- package/dist/src/utils/markdownUtils.js +126 -0
- package/dist/src/utils/markdownUtils.js.map +1 -0
- package/dist/src/utils/markdownUtils.test.d.ts +6 -0
- package/dist/src/utils/markdownUtils.test.js +107 -0
- package/dist/src/utils/markdownUtils.test.js.map +1 -0
- package/dist/src/utils/oauth-flow.d.ts +105 -0
- package/dist/src/utils/oauth-flow.js +370 -0
- package/dist/src/utils/oauth-flow.js.map +1 -0
- package/dist/src/utils/oauth-flow.test.d.ts +6 -0
- package/dist/src/utils/oauth-flow.test.js +360 -0
- package/dist/src/utils/oauth-flow.test.js.map +1 -0
- package/dist/src/utils/sessionUtils.d.ts +14 -0
- package/dist/src/utils/sessionUtils.js +122 -0
- package/dist/src/utils/sessionUtils.js.map +1 -0
- package/dist/src/utils/sessionUtils.test.d.ts +1 -0
- package/dist/src/utils/sessionUtils.test.js +171 -0
- package/dist/src/utils/sessionUtils.test.js.map +1 -0
- package/dist/src/voice/responseFormatter.d.ts +38 -0
- package/dist/src/voice/responseFormatter.js +130 -0
- package/dist/src/voice/responseFormatter.js.map +1 -0
- package/dist/src/voice/responseFormatter.test.d.ts +6 -0
- package/dist/src/voice/responseFormatter.test.js +214 -0
- package/dist/src/voice/responseFormatter.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/docs/CONTRIBUTING.md +0 -555
- package/dist/src/agents/executor.d.ts +0 -114
- package/dist/src/agents/executor.js +0 -779
- package/dist/src/agents/executor.js.map +0 -1
- package/dist/src/agents/executor.test.js +0 -1362
- package/dist/src/agents/executor.test.js.map +0 -1
- package/dist/src/agents/invocation.d.ts +0 -46
- package/dist/src/agents/invocation.js +0 -102
- package/dist/src/agents/invocation.js.map +0 -1
- package/dist/src/agents/invocation.test.js +0 -215
- package/dist/src/agents/invocation.test.js.map +0 -1
- package/dist/src/core/subagent.d.ts +0 -236
- package/dist/src/core/subagent.js +0 -482
- package/dist/src/core/subagent.js.map +0 -1
- package/dist/src/core/subagent.test.js +0 -530
- package/dist/src/core/subagent.test.js.map +0 -1
- package/dist/src/tools/smart-edit.d.ts +0 -78
- package/dist/src/tools/smart-edit.js +0 -717
- package/dist/src/tools/smart-edit.js.map +0 -1
- package/dist/src/tools/smart-edit.test.js +0 -592
- package/dist/src/tools/smart-edit.test.js.map +0 -1
- /package/dist/src/{agents/executor.test.d.ts → policy/workspace-policy.test.d.ts} +0 -0
- /package/dist/src/{agents/invocation.test.d.ts → safety/conseca/conseca.test.d.ts} +0 -0
- /package/dist/src/{core/subagent.test.d.ts → safety/conseca/integration.test.d.ts} +0 -0
- /package/dist/src/{tools/smart-edit.test.d.ts → safety/conseca/policy-enforcer.test.d.ts} +0 -0
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
# Policy engine
|
|
2
|
+
|
|
3
|
+
The Gemini CLI includes a powerful policy engine that provides fine-grained
|
|
4
|
+
control over tool execution. It allows users and administrators to define rules
|
|
5
|
+
that determine whether a tool call should be allowed, denied, or require user
|
|
6
|
+
confirmation.
|
|
7
|
+
|
|
8
|
+
## Quick start
|
|
9
|
+
|
|
10
|
+
To create your first policy:
|
|
11
|
+
|
|
12
|
+
1. **Create the policy directory** if it doesn't exist:
|
|
13
|
+
|
|
14
|
+
**macOS/Linux**
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
mkdir -p ~/.gemini/policies
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**Windows (PowerShell)**
|
|
21
|
+
|
|
22
|
+
```powershell
|
|
23
|
+
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.gemini\policies"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
2. **Create a new policy file** (e.g., `~/.gemini/policies/my-rules.toml`). You
|
|
27
|
+
can use any filename ending in `.toml`; all such files in this directory
|
|
28
|
+
will be loaded and combined:
|
|
29
|
+
```toml
|
|
30
|
+
[[rule]]
|
|
31
|
+
toolName = "run_shell_command"
|
|
32
|
+
commandPrefix = "git status"
|
|
33
|
+
decision = "allow"
|
|
34
|
+
priority = 100
|
|
35
|
+
```
|
|
36
|
+
3. **Run a command** that triggers the policy (e.g., ask Gemini CLI to
|
|
37
|
+
`git status`). The tool will now execute automatically without prompting for
|
|
38
|
+
confirmation.
|
|
39
|
+
|
|
40
|
+
## Core concepts
|
|
41
|
+
|
|
42
|
+
The policy engine operates on a set of rules. Each rule is a combination of
|
|
43
|
+
conditions and a resulting decision. When a large language model wants to
|
|
44
|
+
execute a tool, the policy engine evaluates all rules to find the
|
|
45
|
+
highest-priority rule that matches the tool call.
|
|
46
|
+
|
|
47
|
+
A rule consists of the following main components:
|
|
48
|
+
|
|
49
|
+
- **Conditions**: Criteria that a tool call must meet for the rule to apply.
|
|
50
|
+
This can include the tool's name, the arguments provided to it, or the current
|
|
51
|
+
approval mode.
|
|
52
|
+
- **Decision**: The action to take if the rule matches (`allow`, `deny`, or
|
|
53
|
+
`ask_user`).
|
|
54
|
+
- **Priority**: A number that determines the rule's precedence. Higher numbers
|
|
55
|
+
win.
|
|
56
|
+
|
|
57
|
+
For example, this rule will ask for user confirmation before executing any `git`
|
|
58
|
+
command.
|
|
59
|
+
|
|
60
|
+
```toml
|
|
61
|
+
[[rule]]
|
|
62
|
+
toolName = "run_shell_command"
|
|
63
|
+
commandPrefix = "git "
|
|
64
|
+
decision = "ask_user"
|
|
65
|
+
priority = 100
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Conditions
|
|
69
|
+
|
|
70
|
+
Conditions are the criteria that a tool call must meet for a rule to apply. The
|
|
71
|
+
primary conditions are the tool's name and its arguments.
|
|
72
|
+
|
|
73
|
+
#### Tool Name
|
|
74
|
+
|
|
75
|
+
The `toolName` in the rule must match the name of the tool being called.
|
|
76
|
+
|
|
77
|
+
- **Wildcards**: You can use wildcards to match multiple tools.
|
|
78
|
+
- `*`: Matches **any tool** (built-in or MCP).
|
|
79
|
+
- `mcp_server_*`: Matches any tool from a specific MCP server.
|
|
80
|
+
- `mcp_*_toolName`: Matches a specific tool name across **all** MCP servers.
|
|
81
|
+
- `mcp_*`: Matches **any tool from any MCP server**.
|
|
82
|
+
|
|
83
|
+
> **Recommendation:** While FQN wildcards are supported, the recommended
|
|
84
|
+
> approach for MCP tools is to use the `mcpName` field in your TOML rules. See
|
|
85
|
+
> [Special syntax for MCP tools](#special-syntax-for-mcp-tools).
|
|
86
|
+
|
|
87
|
+
#### Arguments pattern
|
|
88
|
+
|
|
89
|
+
If `argsPattern` is specified, the tool's arguments are converted to a stable
|
|
90
|
+
JSON string, which is then tested against the provided regular expression. If
|
|
91
|
+
the arguments don't match the pattern, the rule does not apply.
|
|
92
|
+
|
|
93
|
+
### Decisions
|
|
94
|
+
|
|
95
|
+
There are three possible decisions a rule can enforce:
|
|
96
|
+
|
|
97
|
+
- `allow`: The tool call is executed automatically without user interaction.
|
|
98
|
+
- `deny`: The tool call is blocked and is not executed. For global rules (those
|
|
99
|
+
without an `argsPattern`), tools that are denied are **completely excluded
|
|
100
|
+
from the model's memory**. This means the model will not even see the tool as
|
|
101
|
+
an option, which is more secure and saves context window space.
|
|
102
|
+
- `ask_user`: The user is prompted to approve or deny the tool call. (In
|
|
103
|
+
non-interactive mode, this is treated as `deny`.)
|
|
104
|
+
|
|
105
|
+
> **Note:** The `deny` decision is the recommended way to exclude tools. The
|
|
106
|
+
> legacy `tools.exclude` setting in `settings.json` is deprecated in favor of
|
|
107
|
+
> policy rules with a `deny` decision.
|
|
108
|
+
|
|
109
|
+
### Priority system and tiers
|
|
110
|
+
|
|
111
|
+
The policy engine uses a sophisticated priority system to resolve conflicts when
|
|
112
|
+
multiple rules match a single tool call. The core principle is simple: **the
|
|
113
|
+
rule with the highest priority wins**.
|
|
114
|
+
|
|
115
|
+
To provide a clear hierarchy, policies are organized into three tiers. Each tier
|
|
116
|
+
has a designated number that forms the base of the final priority calculation.
|
|
117
|
+
|
|
118
|
+
| Tier | Base | Description |
|
|
119
|
+
| :-------- | :--- | :------------------------------------------------------------------------- |
|
|
120
|
+
| Default | 1 | Built-in policies that ship with the Gemini CLI. |
|
|
121
|
+
| Extension | 2 | Policies defined in extensions. |
|
|
122
|
+
| Workspace | 3 | Policies defined in the current workspace's configuration directory. |
|
|
123
|
+
| User | 4 | Custom policies defined by the user. |
|
|
124
|
+
| Admin | 5 | Policies managed by an administrator (e.g., in an enterprise environment). |
|
|
125
|
+
|
|
126
|
+
Within a TOML policy file, you assign a priority value from **0 to 999**. The
|
|
127
|
+
engine transforms this into a final priority using the following formula:
|
|
128
|
+
|
|
129
|
+
`final_priority = tier_base + (toml_priority / 1000)`
|
|
130
|
+
|
|
131
|
+
This system guarantees that:
|
|
132
|
+
|
|
133
|
+
- Admin policies always override User, Workspace, and Default policies.
|
|
134
|
+
- User policies override Workspace and Default policies.
|
|
135
|
+
- Workspace policies override Default policies.
|
|
136
|
+
- You can still order rules within a single tier with fine-grained control.
|
|
137
|
+
|
|
138
|
+
For example:
|
|
139
|
+
|
|
140
|
+
- A `priority: 50` rule in a Default policy file becomes `1.050`.
|
|
141
|
+
- A `priority: 10` rule in a Workspace policy policy file becomes `2.010`.
|
|
142
|
+
- A `priority: 100` rule in a User policy file becomes `3.100`.
|
|
143
|
+
- A `priority: 20` rule in an Admin policy file becomes `4.020`.
|
|
144
|
+
|
|
145
|
+
### Approval modes
|
|
146
|
+
|
|
147
|
+
Approval modes allow the policy engine to apply different sets of rules based on
|
|
148
|
+
the CLI's operational mode. A rule can be associated with one or more modes
|
|
149
|
+
(e.g., `yolo`, `autoEdit`, `plan`). The rule will only be active if the CLI is
|
|
150
|
+
running in one of its specified modes. If a rule has no modes specified, it is
|
|
151
|
+
always active.
|
|
152
|
+
|
|
153
|
+
- `default`: The standard interactive mode where most write tools require
|
|
154
|
+
confirmation.
|
|
155
|
+
- `autoEdit`: Optimized for automated code editing; some write tools may be
|
|
156
|
+
auto-approved.
|
|
157
|
+
- `plan`: A strict, read-only mode for research and design. See
|
|
158
|
+
[Customizing Plan Mode Policies](../cli/plan-mode.md#customizing-policies).
|
|
159
|
+
- `yolo`: A mode where all tools are auto-approved (use with extreme caution).
|
|
160
|
+
|
|
161
|
+
## Rule matching
|
|
162
|
+
|
|
163
|
+
When a tool call is made, the engine checks it against all active rules,
|
|
164
|
+
starting from the highest priority. The first rule that matches determines the
|
|
165
|
+
outcome.
|
|
166
|
+
|
|
167
|
+
A rule matches a tool call if all of its conditions are met:
|
|
168
|
+
|
|
169
|
+
1. **Tool name**: The `toolName` in the rule must match the name of the tool
|
|
170
|
+
being called.
|
|
171
|
+
- **Wildcards**: You can use wildcards like `*`, `mcp_server_*`, or
|
|
172
|
+
`mcp_*_toolName` to match multiple tools. See [Tool Name](#tool-name) for
|
|
173
|
+
details.
|
|
174
|
+
2. **Arguments pattern**: If `argsPattern` is specified, the tool's arguments
|
|
175
|
+
are converted to a stable JSON string, which is then tested against the
|
|
176
|
+
provided regular expression. If the arguments don't match the pattern, the
|
|
177
|
+
rule does not apply.
|
|
178
|
+
|
|
179
|
+
## Configuration
|
|
180
|
+
|
|
181
|
+
Policies are defined in `.toml` files. The CLI loads these files from Default,
|
|
182
|
+
User, and (if configured) Admin directories.
|
|
183
|
+
|
|
184
|
+
### Policy locations
|
|
185
|
+
|
|
186
|
+
| Tier | Type | Location |
|
|
187
|
+
| :------------ | :----- | :---------------------------------------- |
|
|
188
|
+
| **User** | Custom | `~/.gemini/policies/*.toml` |
|
|
189
|
+
| **Workspace** | Custom | `$WORKSPACE_ROOT/.gemini/policies/*.toml` |
|
|
190
|
+
| **Admin** | System | _See below (OS specific)_ |
|
|
191
|
+
|
|
192
|
+
#### System-wide policies (Admin)
|
|
193
|
+
|
|
194
|
+
Administrators can enforce system-wide policies (Tier 3) that override all user
|
|
195
|
+
and default settings. These policies must be placed in specific, secure
|
|
196
|
+
directories:
|
|
197
|
+
|
|
198
|
+
| OS | Policy Directory Path |
|
|
199
|
+
| :---------- | :------------------------------------------------ |
|
|
200
|
+
| **Linux** | `/etc/gemini-cli/policies` |
|
|
201
|
+
| **macOS** | `/Library/Application Support/GeminiCli/policies` |
|
|
202
|
+
| **Windows** | `C:\ProgramData\gemini-cli\policies` |
|
|
203
|
+
|
|
204
|
+
**Security Requirements:**
|
|
205
|
+
|
|
206
|
+
To prevent privilege escalation, the CLI enforces strict security checks on
|
|
207
|
+
admin directories. If checks fail, system policies are **ignored**.
|
|
208
|
+
|
|
209
|
+
- **Linux / macOS:** Must be owned by `root` (UID 0) and NOT writable by group
|
|
210
|
+
or others (e.g., `chmod 755`).
|
|
211
|
+
- **Windows:** Must be in `C:\ProgramData`. Standard users (`Users`, `Everyone`)
|
|
212
|
+
must NOT have `Write`, `Modify`, or `Full Control` permissions. _Tip: If you
|
|
213
|
+
see a security warning, use the folder properties to remove write permissions
|
|
214
|
+
for non-admin groups. You may need to "Disable inheritance" in Advanced
|
|
215
|
+
Security Settings._
|
|
216
|
+
|
|
217
|
+
### TOML rule schema
|
|
218
|
+
|
|
219
|
+
Here is a breakdown of the fields available in a TOML policy rule:
|
|
220
|
+
|
|
221
|
+
```toml
|
|
222
|
+
[[rule]]
|
|
223
|
+
# A unique name for the tool, or an array of names.
|
|
224
|
+
toolName = "run_shell_command"
|
|
225
|
+
|
|
226
|
+
# (Optional) The name of a subagent. If provided, the rule only applies to tool calls
|
|
227
|
+
# made by this specific subagent.
|
|
228
|
+
subagent = "generalist"
|
|
229
|
+
|
|
230
|
+
# (Optional) The name of an MCP server. Can be combined with toolName
|
|
231
|
+
# to form a composite FQN internally like "mcp_mcpName_toolName".
|
|
232
|
+
mcpName = "my-custom-server"
|
|
233
|
+
|
|
234
|
+
# (Optional) Metadata hints provided by the tool. A rule matches if all
|
|
235
|
+
# key-value pairs provided here are present in the tool's annotations.
|
|
236
|
+
toolAnnotations = { readOnlyHint = true }
|
|
237
|
+
|
|
238
|
+
# (Optional) A regex to match against the tool's arguments.
|
|
239
|
+
argsPattern = '"command":"(git|npm)'
|
|
240
|
+
|
|
241
|
+
# (Optional) A string or array of strings that a shell command must start with.
|
|
242
|
+
# This is syntactic sugar for `toolName = "run_shell_command"` and an `argsPattern`.
|
|
243
|
+
commandPrefix = "git "
|
|
244
|
+
|
|
245
|
+
# (Optional) A regex to match against the entire shell command.
|
|
246
|
+
# This is also syntactic sugar for `toolName = "run_shell_command"`.
|
|
247
|
+
# Note: This pattern is tested against the JSON representation of the arguments (e.g., `{"command":"<your_command>"}`).
|
|
248
|
+
# Because it prepends `"command":"`, it effectively matches from the start of the command.
|
|
249
|
+
# Anchors like `^` or `$` apply to the full JSON string, so `^` should usually be avoided here.
|
|
250
|
+
# You cannot use commandPrefix and commandRegex in the same rule.
|
|
251
|
+
commandRegex = "git (commit|push)"
|
|
252
|
+
|
|
253
|
+
# The decision to take. Must be "allow", "deny", or "ask_user".
|
|
254
|
+
decision = "ask_user"
|
|
255
|
+
|
|
256
|
+
# The priority of the rule, from 0 to 999.
|
|
257
|
+
priority = 10
|
|
258
|
+
|
|
259
|
+
# (Optional) A custom message to display when a tool call is denied by this rule.
|
|
260
|
+
# This message is returned to the model and user, useful for explaining *why* it was denied.
|
|
261
|
+
deny_message = "Deletion is permanent"
|
|
262
|
+
|
|
263
|
+
# (Optional) An array of approval modes where this rule is active.
|
|
264
|
+
modes = ["autoEdit"]
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Using arrays (lists)
|
|
268
|
+
|
|
269
|
+
To apply the same rule to multiple tools or command prefixes, you can provide an
|
|
270
|
+
array of strings for the `toolName` and `commandPrefix` fields.
|
|
271
|
+
|
|
272
|
+
**Example:**
|
|
273
|
+
|
|
274
|
+
This single rule will apply to both the `write_file` and `replace` tools.
|
|
275
|
+
|
|
276
|
+
```toml
|
|
277
|
+
[[rule]]
|
|
278
|
+
toolName = ["write_file", "replace"]
|
|
279
|
+
decision = "ask_user"
|
|
280
|
+
priority = 10
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Special syntax for `run_shell_command`
|
|
284
|
+
|
|
285
|
+
To simplify writing policies for `run_shell_command`, you can use
|
|
286
|
+
`commandPrefix` or `commandRegex` instead of the more complex `argsPattern`.
|
|
287
|
+
|
|
288
|
+
- `commandPrefix`: Matches if the `command` argument starts with the given
|
|
289
|
+
string.
|
|
290
|
+
- `commandRegex`: Matches if the `command` argument matches the given regular
|
|
291
|
+
expression.
|
|
292
|
+
|
|
293
|
+
**Example:**
|
|
294
|
+
|
|
295
|
+
This rule will ask for user confirmation before executing any `git` command.
|
|
296
|
+
|
|
297
|
+
```toml
|
|
298
|
+
[[rule]]
|
|
299
|
+
toolName = "run_shell_command"
|
|
300
|
+
commandPrefix = "git "
|
|
301
|
+
decision = "ask_user"
|
|
302
|
+
priority = 100
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### Special syntax for MCP tools
|
|
306
|
+
|
|
307
|
+
You can create rules that target tools from Model Context Protocol (MCP) servers
|
|
308
|
+
using the `mcpName` field. **This is the recommended approach** for defining MCP
|
|
309
|
+
policies, as it is much more robust than manually writing Fully Qualified Names
|
|
310
|
+
(FQNs) or string wildcards.
|
|
311
|
+
|
|
312
|
+
> **Warning:** Do not use underscores (`_`) in your MCP server names (e.g., use
|
|
313
|
+
> `my-server` rather than `my_server`). The policy parser splits Fully Qualified
|
|
314
|
+
> Names (`mcp_server_tool`) on the _first_ underscore following the `mcp_`
|
|
315
|
+
> prefix. If your server name contains an underscore, the parser will
|
|
316
|
+
> misinterpret the server identity, which can cause wildcard rules and security
|
|
317
|
+
> policies to fail silently.
|
|
318
|
+
|
|
319
|
+
**1. Targeting a specific tool on a server**
|
|
320
|
+
|
|
321
|
+
Combine `mcpName` and `toolName` to target a single operation.
|
|
322
|
+
|
|
323
|
+
```toml
|
|
324
|
+
# Allows the `search` tool on the `my-jira-server` MCP
|
|
325
|
+
[[rule]]
|
|
326
|
+
mcpName = "my-jira-server"
|
|
327
|
+
toolName = "search"
|
|
328
|
+
decision = "allow"
|
|
329
|
+
priority = 200
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
**2. Targeting all tools on a specific server**
|
|
333
|
+
|
|
334
|
+
Specify only the `mcpName` to apply a rule to every tool provided by that
|
|
335
|
+
server.
|
|
336
|
+
|
|
337
|
+
```toml
|
|
338
|
+
# Denies all tools from the `untrusted-server` MCP
|
|
339
|
+
[[rule]]
|
|
340
|
+
mcpName = "untrusted-server"
|
|
341
|
+
decision = "deny"
|
|
342
|
+
priority = 500
|
|
343
|
+
deny_message = "This server is not trusted by the admin."
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
**3. Targeting all MCP servers**
|
|
347
|
+
|
|
348
|
+
Use `mcpName = "*"` to create a rule that applies to **all** tools from **any**
|
|
349
|
+
registered MCP server. This is useful for setting category-wide defaults.
|
|
350
|
+
|
|
351
|
+
```toml
|
|
352
|
+
# Ask user for any tool call from any MCP server
|
|
353
|
+
[[rule]]
|
|
354
|
+
mcpName = "*"
|
|
355
|
+
decision = "ask_user"
|
|
356
|
+
priority = 10
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
**4. Targeting a tool name across all servers**
|
|
360
|
+
|
|
361
|
+
Use `mcpName = "*"` with a specific `toolName` to target that operation
|
|
362
|
+
regardless of which server provides it.
|
|
363
|
+
|
|
364
|
+
```toml
|
|
365
|
+
# Allow the `search` tool across all connected MCP servers
|
|
366
|
+
[[rule]]
|
|
367
|
+
mcpName = "*"
|
|
368
|
+
toolName = "search"
|
|
369
|
+
decision = "allow"
|
|
370
|
+
priority = 50
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
## Default policies
|
|
374
|
+
|
|
375
|
+
The Gemini CLI ships with a set of default policies to provide a safe
|
|
376
|
+
out-of-the-box experience.
|
|
377
|
+
|
|
378
|
+
- **Read-only tools** (like `read_file`, `glob`) are generally **allowed**.
|
|
379
|
+
- **Agent delegation** defaults to **`ask_user`** to ensure remote agents can
|
|
380
|
+
prompt for confirmation, but local sub-agent actions are executed silently and
|
|
381
|
+
checked individually.
|
|
382
|
+
- **Write tools** (like `write_file`, `run_shell_command`) default to
|
|
383
|
+
**`ask_user`**.
|
|
384
|
+
- In **`yolo`** mode, a high-priority rule allows all tools.
|
|
385
|
+
- In **`autoEdit`** mode, rules allow certain write operations to happen without
|
|
386
|
+
prompting.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Tools reference
|
|
2
|
+
|
|
3
|
+
Gemini CLI uses tools to interact with your local environment, access
|
|
4
|
+
information, and perform actions on your behalf. These tools extend the model's
|
|
5
|
+
capabilities beyond text generation, letting it read files, execute commands,
|
|
6
|
+
and search the web.
|
|
7
|
+
|
|
8
|
+
## How to use Gemini CLI's tools
|
|
9
|
+
|
|
10
|
+
Tools are generally invoked automatically by Gemini CLI when it needs to perform
|
|
11
|
+
an action. However, you can also trigger specific tools manually using shorthand
|
|
12
|
+
syntax.
|
|
13
|
+
|
|
14
|
+
### Automatic execution and security
|
|
15
|
+
|
|
16
|
+
When the model wants to use a tool, Gemini CLI evaluates the request against its
|
|
17
|
+
security policies.
|
|
18
|
+
|
|
19
|
+
- **User confirmation:** You must manually approve tools that modify files or
|
|
20
|
+
execute shell commands (mutators). The CLI shows you a diff or the exact
|
|
21
|
+
command before you confirm.
|
|
22
|
+
- **Sandboxing:** You can run tool executions in secure, containerized
|
|
23
|
+
environments to isolate changes from your host system. For more details, see
|
|
24
|
+
the [Sandboxing](../cli/sandbox.md) guide.
|
|
25
|
+
- **Trusted folders:** You can configure which directories allow the model to
|
|
26
|
+
use system tools. For more details, see the
|
|
27
|
+
[Trusted folders](../cli/trusted-folders.md) guide.
|
|
28
|
+
|
|
29
|
+
Review confirmation prompts carefully before allowing a tool to execute.
|
|
30
|
+
|
|
31
|
+
### How to use manually-triggered tools
|
|
32
|
+
|
|
33
|
+
You can directly trigger key tools using special syntax in your prompt:
|
|
34
|
+
|
|
35
|
+
- **[File access](../tools/file-system.md#read_many_files) (`@`):** Use the `@`
|
|
36
|
+
symbol followed by a file or directory path to include its content in your
|
|
37
|
+
prompt. This triggers the `read_many_files` tool.
|
|
38
|
+
- **[Shell commands](../tools/shell.md) (`!`):** Use the `!` symbol followed by
|
|
39
|
+
a system command to execute it directly. This triggers the `run_shell_command`
|
|
40
|
+
tool.
|
|
41
|
+
|
|
42
|
+
## How to manage tools
|
|
43
|
+
|
|
44
|
+
Using built-in commands, you can inspect available tools and configure how they
|
|
45
|
+
behave.
|
|
46
|
+
|
|
47
|
+
### Tool discovery
|
|
48
|
+
|
|
49
|
+
Use the `/tools` command to see what tools are currently active in your session.
|
|
50
|
+
|
|
51
|
+
- **`/tools`**: Lists all registered tools with their display names.
|
|
52
|
+
- **`/tools desc`**: Lists all tools with their full descriptions.
|
|
53
|
+
|
|
54
|
+
This is especially useful for verifying that
|
|
55
|
+
[MCP servers](../tools/mcp-server.md) or custom tools are loaded correctly.
|
|
56
|
+
|
|
57
|
+
### Tool configuration
|
|
58
|
+
|
|
59
|
+
You can enable, disable, or configure specific tools in your settings. For
|
|
60
|
+
example, you can set a specific pager for shell commands or configure the
|
|
61
|
+
browser used for web searches. See the [Settings](../cli/settings.md) guide for
|
|
62
|
+
details.
|
|
63
|
+
|
|
64
|
+
## Available tools
|
|
65
|
+
|
|
66
|
+
The following table lists all available tools, categorized by their primary
|
|
67
|
+
function.
|
|
68
|
+
|
|
69
|
+
| Category | Tool | Kind | Description |
|
|
70
|
+
| :---------- | :----------------------------------------------- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
71
|
+
| Execution | [`run_shell_command`](../tools/shell.md) | `Execute` | Executes arbitrary shell commands. Supports interactive sessions and background processes. Requires manual confirmation.<br><br>**Parameters:** `command`, `description`, `dir_path`, `is_background` |
|
|
72
|
+
| File System | [`glob`](../tools/file-system.md) | `Search` | Finds files matching specific glob patterns across the workspace.<br><br>**Parameters:** `pattern`, `dir_path`, `case_sensitive`, `respect_git_ignore`, `respect_gemini_ignore` |
|
|
73
|
+
| File System | [`grep_search`](../tools/file-system.md) | `Search` | Searches for a regular expression pattern within file contents. Legacy alias: `search_file_content`.<br><br>**Parameters:** `pattern`, `dir_path`, `include`, `exclude_pattern`, `names_only`, `max_matches_per_file`, `total_max_matches` |
|
|
74
|
+
| File System | [`list_directory`](../tools/file-system.md) | `Read` | Lists the names of files and subdirectories within a specified path.<br><br>**Parameters:** `dir_path`, `ignore`, `file_filtering_options` |
|
|
75
|
+
| File System | [`read_file`](../tools/file-system.md) | `Read` | Reads the content of a specific file. Supports text, images, audio, and PDF.<br><br>**Parameters:** `file_path`, `start_line`, `end_line` |
|
|
76
|
+
| File System | [`read_many_files`](../tools/file-system.md) | `Read` | Reads and concatenates content from multiple files. Often triggered by the `@` symbol in your prompt.<br><br>**Parameters:** `include`, `exclude`, `recursive`, `useDefaultExcludes`, `file_filtering_options` |
|
|
77
|
+
| File System | [`replace`](../tools/file-system.md) | `Edit` | Performs precise text replacement within a file. Requires manual confirmation.<br><br>**Parameters:** `file_path`, `instruction`, `old_string`, `new_string`, `allow_multiple` |
|
|
78
|
+
| File System | [`write_file`](../tools/file-system.md) | `Edit` | Creates or overwrites a file with new content. Requires manual confirmation.<br><br>**Parameters:** `file_path`, `content` |
|
|
79
|
+
| Interaction | [`ask_user`](../tools/ask-user.md) | `Communicate` | Requests clarification or missing information via an interactive dialog.<br><br>**Parameters:** `questions` |
|
|
80
|
+
| Interaction | [`write_todos`](../tools/todos.md) | `Other` | Maintains an internal list of subtasks. The model uses this to track its own progress and display it to you.<br><br>**Parameters:** `todos` |
|
|
81
|
+
| Memory | [`activate_skill`](../tools/activate-skill.md) | `Other` | Loads specialized procedural expertise for specific tasks from the `.gemini/skills` directory.<br><br>**Parameters:** `name` |
|
|
82
|
+
| Memory | [`get_internal_docs`](../tools/internal-docs.md) | `Think` | Accesses Gemini CLI's own documentation to provide more accurate answers about its capabilities.<br><br>**Parameters:** `path` |
|
|
83
|
+
| Memory | [`save_memory`](../tools/memory.md) | `Think` | Persists specific facts and project details to your `GEMINI.md` file to retain context.<br><br>**Parameters:** `fact` |
|
|
84
|
+
| Planning | [`enter_plan_mode`](../tools/planning.md) | `Plan` | Switches the CLI to a safe, read-only "Plan Mode" for researching complex changes.<br><br>**Parameters:** `reason` |
|
|
85
|
+
| Planning | [`exit_plan_mode`](../tools/planning.md) | `Plan` | Finalizes a plan, presents it for review, and requests approval to start implementation.<br><br>**Parameters:** `plan` |
|
|
86
|
+
| System | `complete_task` | `Other` | Finalizes a subagent's mission and returns the result to the parent agent. This tool is not available to the user.<br><br>**Parameters:** `result` |
|
|
87
|
+
| Web | [`google_web_search`](../tools/web-search.md) | `Search` | Performs a Google Search to find up-to-date information.<br><br>**Parameters:** `query` |
|
|
88
|
+
| Web | [`web_fetch`](../tools/web-fetch.md) | `Fetch` | Retrieves and processes content from specific URLs. **Warning:** This tool can access local and private network addresses (e.g., localhost), which may pose a security risk if used with untrusted prompts.<br><br>**Parameters:** `prompt` |
|
|
89
|
+
|
|
90
|
+
## Under the hood
|
|
91
|
+
|
|
92
|
+
For developers, the tool system is designed to be extensible and robust. The
|
|
93
|
+
`ToolRegistry` class manages all available tools.
|
|
94
|
+
|
|
95
|
+
You can extend Gemini CLI with custom tools by configuring
|
|
96
|
+
`tools.discoveryCommand` in your settings or by connecting to MCP servers.
|
|
97
|
+
|
|
98
|
+
> **Note:** For a deep dive into the internal Tool API and how to implement your
|
|
99
|
+
> own tools in the codebase, see the `packages/core/src/tools/` directory in
|
|
100
|
+
> GitHub.
|
|
101
|
+
|
|
102
|
+
## Next steps
|
|
103
|
+
|
|
104
|
+
- Learn how to [Set up an MCP server](../tools/mcp-server.md).
|
|
105
|
+
- Explore [Agent Skills](../cli/skills.md) for specialized expertise.
|
|
106
|
+
- See the [Command reference](./commands.md) for slash commands.
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# Frequently asked questions (FAQ)
|
|
2
|
+
|
|
3
|
+
This page provides answers to common questions and solutions to frequent
|
|
4
|
+
problems encountered while using Gemini CLI.
|
|
5
|
+
|
|
6
|
+
## General issues
|
|
7
|
+
|
|
8
|
+
This section addresses common questions about Gemini CLI usage, security, and
|
|
9
|
+
troubleshooting general errors.
|
|
10
|
+
|
|
11
|
+
### Why can't I use third-party software (e.g. Claude Code, OpenClaw, OpenCode) with Gemini CLI?
|
|
12
|
+
|
|
13
|
+
Using third-party software, tools, or services to harvest or piggyback on Gemini
|
|
14
|
+
CLI's OAuth authentication to access our backend services is a direct violation
|
|
15
|
+
of our [applicable terms and policies](tos-privacy.md). Doing so bypasses our
|
|
16
|
+
intended authentication and security structures, and such actions may be grounds
|
|
17
|
+
for immediate suspension or termination of your account. If you would like to
|
|
18
|
+
use a third-party coding agent with Gemini, the supported and secure method is
|
|
19
|
+
to use a Vertex AI or Google AI Studio API key.
|
|
20
|
+
|
|
21
|
+
### Why am I getting an `API error: 429 - Resource exhausted`?
|
|
22
|
+
|
|
23
|
+
This error indicates that you have exceeded your API request limit. The Gemini
|
|
24
|
+
API has rate limits to prevent abuse and ensure fair usage.
|
|
25
|
+
|
|
26
|
+
To resolve this, you can:
|
|
27
|
+
|
|
28
|
+
- **Check your usage:** Review your API usage in the Google AI Studio or your
|
|
29
|
+
Google Cloud project dashboard.
|
|
30
|
+
- **Optimize your prompts:** If you are making many requests in a short period,
|
|
31
|
+
try to batch your prompts or introduce delays between requests.
|
|
32
|
+
- **Request a quota increase:** If you consistently need a higher limit, you can
|
|
33
|
+
request a quota increase from Google.
|
|
34
|
+
|
|
35
|
+
### Why am I getting an `ERR_REQUIRE_ESM` error when running `npm run start`?
|
|
36
|
+
|
|
37
|
+
This error typically occurs in Node.js projects when there is a mismatch between
|
|
38
|
+
CommonJS and ES Modules.
|
|
39
|
+
|
|
40
|
+
This is often due to a misconfiguration in your `package.json` or
|
|
41
|
+
`tsconfig.json`. Ensure that:
|
|
42
|
+
|
|
43
|
+
1. Your `package.json` has `"type": "module"`.
|
|
44
|
+
2. Your `tsconfig.json` has `"module": "NodeNext"` or a compatible setting in
|
|
45
|
+
the `compilerOptions`.
|
|
46
|
+
|
|
47
|
+
If the problem persists, try deleting your `node_modules` directory and
|
|
48
|
+
`package-lock.json` file, and then run `npm install` again.
|
|
49
|
+
|
|
50
|
+
### Why don't I see cached token counts in my stats output?
|
|
51
|
+
|
|
52
|
+
Cached token information is only displayed when cached tokens are being used.
|
|
53
|
+
This feature is available for API key users (Gemini API key or Google Cloud
|
|
54
|
+
Vertex AI) but not for OAuth users (such as Google Personal/Enterprise accounts
|
|
55
|
+
like Google Gmail or Google Workspace, respectively). This is because the Gemini
|
|
56
|
+
Code Assist API does not support cached content creation. You can still view
|
|
57
|
+
your total token usage using the `/stats` command in Gemini CLI.
|
|
58
|
+
|
|
59
|
+
## Installation and updates
|
|
60
|
+
|
|
61
|
+
### How do I update Gemini CLI to the latest version?
|
|
62
|
+
|
|
63
|
+
If you installed it globally via `npm`, update it using the command
|
|
64
|
+
`npm install -g @google/gemini-cli@latest`. If you compiled it from source, pull
|
|
65
|
+
the latest changes from the repository, and then rebuild using the command
|
|
66
|
+
`npm run build`.
|
|
67
|
+
|
|
68
|
+
## Platform-specific issues
|
|
69
|
+
|
|
70
|
+
### Why does the CLI crash on Windows when I run a command like `chmod +x`?
|
|
71
|
+
|
|
72
|
+
Commands like `chmod` are specific to Unix-like operating systems (Linux,
|
|
73
|
+
macOS). They are not available on Windows by default.
|
|
74
|
+
|
|
75
|
+
To resolve this, you can:
|
|
76
|
+
|
|
77
|
+
- **Use Windows-equivalent commands:** Instead of `chmod`, you can use `icacls`
|
|
78
|
+
to modify file permissions on Windows.
|
|
79
|
+
- **Use a compatibility layer:** Tools like Git Bash or Windows Subsystem for
|
|
80
|
+
Linux (WSL) provide a Unix-like environment on Windows where these commands
|
|
81
|
+
will work.
|
|
82
|
+
|
|
83
|
+
## Configuration
|
|
84
|
+
|
|
85
|
+
### How do I configure my `GOOGLE_CLOUD_PROJECT`?
|
|
86
|
+
|
|
87
|
+
You can configure your Google Cloud Project ID using an environment variable.
|
|
88
|
+
|
|
89
|
+
Set the `GOOGLE_CLOUD_PROJECT` environment variable in your shell:
|
|
90
|
+
|
|
91
|
+
**macOS/Linux**
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
export GOOGLE_CLOUD_PROJECT="your-project-id"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Windows (PowerShell)**
|
|
98
|
+
|
|
99
|
+
```powershell
|
|
100
|
+
$env:GOOGLE_CLOUD_PROJECT="your-project-id"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
To make this setting permanent, add this line to your shell's startup file
|
|
104
|
+
(e.g., `~/.bashrc`, `~/.zshrc`).
|
|
105
|
+
|
|
106
|
+
### What is the best way to store my API keys securely?
|
|
107
|
+
|
|
108
|
+
Exposing API keys in scripts or checking them into source control is a security
|
|
109
|
+
risk.
|
|
110
|
+
|
|
111
|
+
To store your API keys securely, you can:
|
|
112
|
+
|
|
113
|
+
- **Use a `.env` file:** Create a `.env` file in your project's `.gemini`
|
|
114
|
+
directory (`.gemini/.env`) and store your keys there. Gemini CLI will
|
|
115
|
+
automatically load these variables.
|
|
116
|
+
- **Use your system's keyring:** For the most secure storage, use your operating
|
|
117
|
+
system's secret management tool (like macOS Keychain, Windows Credential
|
|
118
|
+
Manager, or a secret manager on Linux). You can then have your scripts or
|
|
119
|
+
environment load the key from the secure storage at runtime.
|
|
120
|
+
|
|
121
|
+
### Where are the Gemini CLI configuration and settings files stored?
|
|
122
|
+
|
|
123
|
+
The Gemini CLI configuration is stored in two `settings.json` files:
|
|
124
|
+
|
|
125
|
+
1. In your home directory: `~/.gemini/settings.json`.
|
|
126
|
+
2. In your project's root directory: `./.gemini/settings.json`.
|
|
127
|
+
|
|
128
|
+
Refer to [Gemini CLI Configuration](../reference/configuration.md) for more
|
|
129
|
+
details.
|
|
130
|
+
|
|
131
|
+
## Google AI Pro/Ultra and subscription FAQs
|
|
132
|
+
|
|
133
|
+
### Where can I learn more about my Google AI Pro or Google AI Ultra subscription?
|
|
134
|
+
|
|
135
|
+
To learn more about your Google AI Pro or Google AI Ultra subscription, visit
|
|
136
|
+
**Manage subscription** in your [subscription settings](https://one.google.com).
|
|
137
|
+
|
|
138
|
+
### How do I know if I have higher limits for Google AI Pro or Ultra?
|
|
139
|
+
|
|
140
|
+
If you're subscribed to Google AI Pro or Ultra, you automatically have higher
|
|
141
|
+
limits to Gemini Code Assist and Gemini CLI. These are shared across Gemini CLI
|
|
142
|
+
and agent mode in the IDE. You can confirm you have higher limits by checking if
|
|
143
|
+
you are still subscribed to Google AI Pro or Ultra in your
|
|
144
|
+
[subscription settings](https://one.google.com).
|
|
145
|
+
|
|
146
|
+
### What is the privacy policy for using Gemini Code Assist or Gemini CLI if I've subscribed to Google AI Pro or Ultra?
|
|
147
|
+
|
|
148
|
+
To learn more about your privacy policy and terms of service governed by your
|
|
149
|
+
subscription, visit
|
|
150
|
+
[Gemini Code Assist: Terms of Service and Privacy Policies](https://developers.google.com/gemini-code-assist/resources/privacy-notices).
|
|
151
|
+
|
|
152
|
+
### I've upgraded to Google AI Pro or Ultra but it still says I am hitting quota limits. Is this a bug?
|
|
153
|
+
|
|
154
|
+
The higher limits in your Google AI Pro or Ultra subscription are for Gemini 2.5
|
|
155
|
+
across both Gemini 2.5 Pro and Flash. They are shared quota across Gemini CLI
|
|
156
|
+
and agent mode in Gemini Code Assist IDE extensions. You can learn more about
|
|
157
|
+
quota limits for Gemini CLI, Gemini Code Assist and agent mode in Gemini Code
|
|
158
|
+
Assist at
|
|
159
|
+
[Quotas and limits](https://developers.google.com/gemini-code-assist/resources/quotas).
|
|
160
|
+
|
|
161
|
+
### If I upgrade to higher limits for Gemini CLI and Gemini Code Assist by purchasing a Google AI Pro or Ultra subscription, will Gemini start using my data to improve its machine learning models?
|
|
162
|
+
|
|
163
|
+
Google does not use your data to improve Google's machine learning models if you
|
|
164
|
+
purchase a paid plan. Note: If you decide to remain on the free version of
|
|
165
|
+
Gemini Code Assist, Gemini Code Assist for individuals, you can also opt out of
|
|
166
|
+
using your data to improve Google's machine learning models. See the
|
|
167
|
+
[Gemini Code Assist for individuals privacy notice](https://developers.google.com/gemini-code-assist/resources/privacy-notice-gemini-code-assist-individuals)
|
|
168
|
+
for more information.
|
|
169
|
+
|
|
170
|
+
## Not seeing your question?
|
|
171
|
+
|
|
172
|
+
Search the
|
|
173
|
+
[Gemini CLI Q&A discussions on GitHub](https://github.com/google-gemini/gemini-cli/discussions/categories/q-a)
|
|
174
|
+
or
|
|
175
|
+
[start a new discussion on GitHub](https://github.com/google-gemini/gemini-cli/discussions/new?category=q-a)
|