@google/gemini-cli-core 0.21.0-nightly.20251218.739c02bd6 → 0.21.0-nightly.20251220.41a1a3eed
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/google-gemini-cli-core-0.21.0-nightly.20251219.70696e364.tgz +0 -0
- package/dist/src/agents/delegate-to-agent-tool.test.js +1 -0
- 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.d.ts +6 -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/local-executor.d.ts +0 -6
- package/dist/src/agents/local-executor.js +73 -47
- package/dist/src/agents/local-executor.js.map +1 -1
- package/dist/src/agents/local-executor.test.d.ts +1 -7
- package/dist/src/agents/local-executor.test.js +27 -9
- package/dist/src/agents/local-executor.test.js.map +1 -1
- package/dist/src/agents/registry.d.ts +1 -0
- package/dist/src/agents/registry.js +51 -7
- package/dist/src/agents/registry.js.map +1 -1
- package/dist/src/agents/registry.test.js +112 -1
- package/dist/src/agents/registry.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/availability/modelAvailabilityService.d.ts +2 -1
- package/dist/src/config/config.d.ts +9 -0
- package/dist/src/config/config.js +29 -0
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +59 -1
- package/dist/src/config/config.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/client.js +8 -4
- package/dist/src/core/client.js.map +1 -1
- package/dist/src/core/client.test.js +20 -0
- 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/coreToolHookTriggers.js +3 -3
- package/dist/src/core/coreToolHookTriggers.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/sessionHookTriggers.js +3 -3
- package/dist/src/core/sessionHookTriggers.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 +40 -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/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/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/shellExecutionService.js +18 -2
- package/dist/src/services/shellExecutionService.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/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/utils/environmentContext.js +3 -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 -2
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/googleQuotaErrors.js +20 -0
- package/dist/src/utils/googleQuotaErrors.js.map +1 -1
- package/dist/src/utils/googleQuotaErrors.test.js +53 -2
- package/dist/src/utils/googleQuotaErrors.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.21.0-nightly.20251216.bb0c0d8ee.tgz +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Gemini CLI settings (`/settings` command)
|
|
2
|
+
|
|
3
|
+
Control your Gemini CLI experience with the `/settings` command. The `/settings`
|
|
4
|
+
command opens a dialog to view and edit all your Gemini CLI settings, including
|
|
5
|
+
your UI experience, keybindings, and accessibility features.
|
|
6
|
+
|
|
7
|
+
Your Gemini CLI settings are stored in a `settings.json` file. In addition to
|
|
8
|
+
using the `/settings` command, you can also edit them in one of the following
|
|
9
|
+
locations:
|
|
10
|
+
|
|
11
|
+
- **User settings**: `~/.gemini/settings.json`
|
|
12
|
+
- **Workspace settings**: `your-project/.gemini/settings.json`
|
|
13
|
+
|
|
14
|
+
Note: Workspace settings override user settings.
|
|
15
|
+
|
|
16
|
+
## Settings reference
|
|
17
|
+
|
|
18
|
+
Here is a list of all the available settings, grouped by category and ordered as
|
|
19
|
+
they appear in the UI.
|
|
20
|
+
|
|
21
|
+
### General
|
|
22
|
+
|
|
23
|
+
| UI Label | Setting | Description | Default |
|
|
24
|
+
| ------------------------------- | ---------------------------------- | ---------------------------------------------------------------------------- | ----------- |
|
|
25
|
+
| Preview Features (e.g., models) | `general.previewFeatures` | Enable preview features (e.g., preview models). | `false` |
|
|
26
|
+
| Vim Mode | `general.vimMode` | Enable Vim keybindings. | `false` |
|
|
27
|
+
| Disable Auto Update | `general.disableAutoUpdate` | Disable automatic updates. | `false` |
|
|
28
|
+
| Enable Prompt Completion | `general.enablePromptCompletion` | Enable AI-powered prompt completion suggestions while typing. | `false` |
|
|
29
|
+
| Debug Keystroke Logging | `general.debugKeystrokeLogging` | Enable debug logging of keystrokes to the console. | `false` |
|
|
30
|
+
| Session Retention | `general.sessionRetention` | Settings for automatic session cleanup. This feature is disabled by default. | `undefined` |
|
|
31
|
+
| Enable Session Cleanup | `general.sessionRetention.enabled` | Enable automatic session cleanup. | `false` |
|
|
32
|
+
|
|
33
|
+
### Output
|
|
34
|
+
|
|
35
|
+
| UI Label | Setting | Description | Default |
|
|
36
|
+
| ------------- | --------------- | ------------------------------------------------------ | ------- |
|
|
37
|
+
| Output Format | `output.format` | The format of the CLI output. Can be `text` or `json`. | `text` |
|
|
38
|
+
|
|
39
|
+
### UI
|
|
40
|
+
|
|
41
|
+
| UI Label | Setting | Description | Default |
|
|
42
|
+
| ------------------------------ | ---------------------------------------- | -------------------------------------------------------------------- | ------- |
|
|
43
|
+
| Hide Window Title | `ui.hideWindowTitle` | Hide the window title bar. | `false` |
|
|
44
|
+
| Show Status in Title | `ui.showStatusInTitle` | Show Gemini CLI status and thoughts in the terminal window title. | `false` |
|
|
45
|
+
| Hide Tips | `ui.hideTips` | Hide helpful tips in the UI. | `false` |
|
|
46
|
+
| Hide Banner | `ui.hideBanner` | Hide the application banner. | `false` |
|
|
47
|
+
| Hide Context Summary | `ui.hideContextSummary` | Hide the context summary (GEMINI.md, MCP servers) above the input. | `false` |
|
|
48
|
+
| Hide CWD | `ui.footer.hideCWD` | Hide the current working directory path in the footer. | `false` |
|
|
49
|
+
| Hide Sandbox Status | `ui.footer.hideSandboxStatus` | Hide the sandbox status indicator in the footer. | `false` |
|
|
50
|
+
| Hide Model Info | `ui.footer.hideModelInfo` | Hide the model name and context usage in the footer. | `false` |
|
|
51
|
+
| Hide Context Window Percentage | `ui.footer.hideContextPercentage` | Hides the context window remaining percentage. | `true` |
|
|
52
|
+
| Hide Footer | `ui.hideFooter` | Hide the footer from the UI. | `false` |
|
|
53
|
+
| Show Memory Usage | `ui.showMemoryUsage` | Display memory usage information in the UI. | `false` |
|
|
54
|
+
| Show Line Numbers | `ui.showLineNumbers` | Show line numbers in the chat. | `false` |
|
|
55
|
+
| Show Citations | `ui.showCitations` | Show citations for generated text in the chat. | `false` |
|
|
56
|
+
| Use Full Width | `ui.useFullWidth` | Use the entire width of the terminal for output. | `true` |
|
|
57
|
+
| Use Alternate Screen Buffer | `ui.useAlternateBuffer` | Use an alternate screen buffer for the UI, preserving shell history. | `true` |
|
|
58
|
+
| Disable Loading Phrases | `ui.accessibility.disableLoadingPhrases` | Disable loading phrases for accessibility. | `false` |
|
|
59
|
+
| Screen Reader Mode | `ui.accessibility.screenReader` | Render output in plain-text to be more screen reader accessible. | `false` |
|
|
60
|
+
|
|
61
|
+
### IDE
|
|
62
|
+
|
|
63
|
+
| UI Label | Setting | Description | Default |
|
|
64
|
+
| -------- | ------------- | ---------------------------- | ------- |
|
|
65
|
+
| IDE Mode | `ide.enabled` | Enable IDE integration mode. | `false` |
|
|
66
|
+
|
|
67
|
+
### Model
|
|
68
|
+
|
|
69
|
+
| UI Label | Setting | Description | Default |
|
|
70
|
+
| ----------------------- | ---------------------------- | -------------------------------------------------------------------------------------- | ------- |
|
|
71
|
+
| Max Session Turns | `model.maxSessionTurns` | Maximum number of user/model/tool turns to keep in a session. -1 means unlimited. | `-1` |
|
|
72
|
+
| Compression Threshold | `model.compressionThreshold` | The fraction of context usage at which to trigger context compression (e.g. 0.2, 0.3). | `0.2` |
|
|
73
|
+
| Skip Next Speaker Check | `model.skipNextSpeakerCheck` | Skip the next speaker check. | `true` |
|
|
74
|
+
|
|
75
|
+
### Context
|
|
76
|
+
|
|
77
|
+
| UI Label | Setting | Description | Default |
|
|
78
|
+
| ------------------------------------ | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
|
79
|
+
| Memory Discovery Max Dirs | `context.discoveryMaxDirs` | Maximum number of directories to search for memory. | `200` |
|
|
80
|
+
| Load Memory From Include Directories | `context.loadMemoryFromIncludeDirectories` | Controls how /memory refresh loads GEMINI.md files. When true, include directories are scanned; when false, only the current directory is used. | `false` |
|
|
81
|
+
| Respect .gitignore | `context.fileFiltering.respectGitIgnore` | Respect .gitignore files when searching. | `true` |
|
|
82
|
+
| Respect .geminiignore | `context.fileFiltering.respectGeminiIgnore` | Respect .geminiignore files when searching. | `true` |
|
|
83
|
+
| Enable Recursive File Search | `context.fileFiltering.enableRecursiveFileSearch` | Enable recursive file search functionality when completing @ references in the prompt. | `true` |
|
|
84
|
+
| Disable Fuzzy Search | `context.fileFiltering.disableFuzzySearch` | Disable fuzzy search when searching for files. | `false` |
|
|
85
|
+
|
|
86
|
+
### Tools
|
|
87
|
+
|
|
88
|
+
| UI Label | Setting | Description | Default |
|
|
89
|
+
| -------------------------------- | ------------------------------------ | --------------------------------------------------------------------------------------------------------------- | ------- |
|
|
90
|
+
| Enable Interactive Shell | `tools.shell.enableInteractiveShell` | Use node-pty for an interactive shell experience. Fallback to child_process still applies. | `true` |
|
|
91
|
+
| Show Color | `tools.shell.showColor` | Show color in shell output. | `false` |
|
|
92
|
+
| Auto Accept | `tools.autoAccept` | Automatically accept and execute tool calls that are considered safe (e.g., read-only operations). | `false` |
|
|
93
|
+
| Use Ripgrep | `tools.useRipgrep` | Use ripgrep for file content search instead of the fallback implementation. Provides faster search performance. | `true` |
|
|
94
|
+
| Enable Tool Output Truncation | `tools.enableToolOutputTruncation` | Enable truncation of large tool outputs. | `true` |
|
|
95
|
+
| Tool Output Truncation Threshold | `tools.truncateToolOutputThreshold` | Truncate tool output if it is larger than this many characters. Set to -1 to disable. | `10000` |
|
|
96
|
+
| Tool Output Truncation Lines | `tools.truncateToolOutputLines` | The number of lines to keep when truncating tool output. | `100` |
|
|
97
|
+
| Enable Message Bus Integration | `tools.enableMessageBusIntegration` | Enable policy-based tool confirmation via message bus integration. | `true` |
|
|
98
|
+
|
|
99
|
+
### Security
|
|
100
|
+
|
|
101
|
+
| UI Label | Setting | Description | Default |
|
|
102
|
+
| -------------------------- | ------------------------------ | -------------------------------------------------- | ------- |
|
|
103
|
+
| Disable YOLO Mode | `security.disableYoloMode` | Disable YOLO mode, even if enabled by a flag. | `false` |
|
|
104
|
+
| Blocks extensions from Git | `security.blockGitExtensions` | Blocks installing and loading extensions from Git. | `false` |
|
|
105
|
+
| Folder Trust | `security.folderTrust.enabled` | Setting to track whether Folder trust is enabled. | `false` |
|
|
106
|
+
|
|
107
|
+
### Experimental
|
|
108
|
+
|
|
109
|
+
| UI Label | Setting | Description | Default |
|
|
110
|
+
| ----------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------ | ------- |
|
|
111
|
+
| Enable Codebase Investigator | `experimental.codebaseInvestigatorSettings.enabled` | Enable the Codebase Investigator agent. | `true` |
|
|
112
|
+
| Codebase Investigator Max Num Turns | `experimental.codebaseInvestigatorSettings.maxNumTurns` | Maximum number of turns for the Codebase Investigator agent. | `10` |
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# System Prompt Override (GEMINI_SYSTEM_MD)
|
|
2
|
+
|
|
3
|
+
The core system instructions that guide Gemini CLI can be completely replaced
|
|
4
|
+
with your own Markdown file. This feature is controlled via the
|
|
5
|
+
`GEMINI_SYSTEM_MD` environment variable.
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
The `GEMINI_SYSTEM_MD` variable instructs the CLI to use an external Markdown
|
|
10
|
+
file for its system prompt, completely overriding the built-in default. This is
|
|
11
|
+
a full replacement, not a merge. If you use a custom file, none of the original
|
|
12
|
+
core instructions will apply unless you include them yourself.
|
|
13
|
+
|
|
14
|
+
This feature is intended for advanced users who need to enforce strict,
|
|
15
|
+
project-specific behavior or create a customized persona.
|
|
16
|
+
|
|
17
|
+
> Tip: You can export the current default system prompt to a file first, review
|
|
18
|
+
> it, and then selectively modify or replace it (see
|
|
19
|
+
> [“Export the default prompt”](#export-the-default-prompt-recommended)).
|
|
20
|
+
|
|
21
|
+
## How to enable
|
|
22
|
+
|
|
23
|
+
You can set the environment variable temporarily in your shell, or persist it
|
|
24
|
+
via a `.gemini/.env` file. See
|
|
25
|
+
[Persisting Environment Variables](../get-started/authentication.md#persisting-environment-variables).
|
|
26
|
+
|
|
27
|
+
- Use the project default path (`.gemini/system.md`):
|
|
28
|
+
- `GEMINI_SYSTEM_MD=true` or `GEMINI_SYSTEM_MD=1`
|
|
29
|
+
- The CLI reads `./.gemini/system.md` (relative to your current project
|
|
30
|
+
directory).
|
|
31
|
+
|
|
32
|
+
- Use a custom file path:
|
|
33
|
+
- `GEMINI_SYSTEM_MD=/absolute/path/to/my-system.md`
|
|
34
|
+
- Relative paths are supported and resolved from the current working
|
|
35
|
+
directory.
|
|
36
|
+
- Tilde expansion is supported (e.g., `~/my-system.md`).
|
|
37
|
+
|
|
38
|
+
- Disable the override (use built‑in prompt):
|
|
39
|
+
- `GEMINI_SYSTEM_MD=false` or `GEMINI_SYSTEM_MD=0` or unset the variable.
|
|
40
|
+
|
|
41
|
+
If the override is enabled but the target file does not exist, the CLI will
|
|
42
|
+
error with: `missing system prompt file '<path>'`.
|
|
43
|
+
|
|
44
|
+
## Quick examples
|
|
45
|
+
|
|
46
|
+
- One‑off session using a project file:
|
|
47
|
+
- `GEMINI_SYSTEM_MD=1 gemini`
|
|
48
|
+
- Persist for a project using `.gemini/.env`:
|
|
49
|
+
- Create `.gemini/system.md`, then add to `.gemini/.env`:
|
|
50
|
+
- `GEMINI_SYSTEM_MD=1`
|
|
51
|
+
- Use a custom file under your home directory:
|
|
52
|
+
- `GEMINI_SYSTEM_MD=~/prompts/SYSTEM.md gemini`
|
|
53
|
+
|
|
54
|
+
## UI indicator
|
|
55
|
+
|
|
56
|
+
When `GEMINI_SYSTEM_MD` is active, the CLI shows a `|⌐■_■|` indicator in the UI
|
|
57
|
+
to signal custom system‑prompt mode.
|
|
58
|
+
|
|
59
|
+
## Export the default prompt (recommended)
|
|
60
|
+
|
|
61
|
+
Before overriding, export the current default prompt so you can review required
|
|
62
|
+
safety and workflow rules.
|
|
63
|
+
|
|
64
|
+
- Write the built‑in prompt to the project default path:
|
|
65
|
+
- `GEMINI_WRITE_SYSTEM_MD=1 gemini`
|
|
66
|
+
- Or write to a custom path:
|
|
67
|
+
- `GEMINI_WRITE_SYSTEM_MD=~/prompts/DEFAULT_SYSTEM.md gemini`
|
|
68
|
+
|
|
69
|
+
This creates the file and writes the current built‑in system prompt to it.
|
|
70
|
+
|
|
71
|
+
## Best practices: SYSTEM.md vs GEMINI.md
|
|
72
|
+
|
|
73
|
+
- SYSTEM.md (firmware):
|
|
74
|
+
- Non‑negotiable operational rules: safety, tool‑use protocols, approvals, and
|
|
75
|
+
mechanics that keep the CLI reliable.
|
|
76
|
+
- Stable across tasks and projects (or per project when needed).
|
|
77
|
+
- GEMINI.md (strategy):
|
|
78
|
+
- Persona, goals, methodologies, and project/domain context.
|
|
79
|
+
- Evolves per task; relies on SYSTEM.md for safe execution.
|
|
80
|
+
|
|
81
|
+
Keep SYSTEM.md minimal but complete for safety and tool operation. Keep
|
|
82
|
+
GEMINI.md focused on high‑level guidance and project specifics.
|
|
83
|
+
|
|
84
|
+
## Troubleshooting
|
|
85
|
+
|
|
86
|
+
- Error: `missing system prompt file '…'`
|
|
87
|
+
- Ensure the referenced path exists and is readable.
|
|
88
|
+
- For `GEMINI_SYSTEM_MD=1|true`, create `./.gemini/system.md` in your project.
|
|
89
|
+
- Override not taking effect
|
|
90
|
+
- Confirm the variable is loaded (use `.gemini/.env` or export in your shell).
|
|
91
|
+
- Paths are resolved from the current working directory; try an absolute path.
|
|
92
|
+
- Restore defaults
|
|
93
|
+
- Unset `GEMINI_SYSTEM_MD` or set it to `0`/`false`.
|