@google/gemini-cli-core 0.41.0-nightly.20260427.g42587de73 → 0.41.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/changelogs/preview.md +168 -18
- package/dist/docs/cli/sandbox.md +162 -45
- package/dist/docs/reference/configuration.md +13 -7
- package/dist/src/availability/policyCatalog.js +1 -1
- package/dist/src/availability/policyCatalog.js.map +1 -1
- package/dist/src/availability/policyCatalog.test.js +1 -1
- package/dist/src/availability/policyCatalog.test.js.map +1 -1
- package/dist/src/code_assist/server.js +16 -0
- package/dist/src/code_assist/server.js.map +1 -1
- package/dist/src/code_assist/server.test.js +18 -0
- package/dist/src/code_assist/server.test.js.map +1 -1
- package/dist/src/config/defaultModelConfigs.js +7 -7
- package/dist/src/config/defaultModelConfigs.js.map +1 -1
- package/dist/src/config/models.js +9 -3
- package/dist/src/config/models.js.map +1 -1
- package/dist/src/config/models.test.js +14 -0
- package/dist/src/config/models.test.js.map +1 -1
- package/dist/src/context/config/configLoader.d.ts +1 -2
- package/dist/src/context/config/configLoader.js +12 -7
- package/dist/src/context/config/configLoader.js.map +1 -1
- package/dist/src/context/config/configLoader.test.js +8 -12
- package/dist/src/context/config/configLoader.test.js.map +1 -1
- package/dist/src/context/config/profiles.d.ts +7 -1
- package/dist/src/context/config/profiles.js +46 -5
- package/dist/src/context/config/profiles.js.map +1 -1
- package/dist/src/context/contextManager.js +5 -3
- package/dist/src/context/contextManager.js.map +1 -1
- package/dist/src/context/eventBus.d.ts +7 -0
- package/dist/src/context/eventBus.js +6 -0
- package/dist/src/context/eventBus.js.map +1 -1
- package/dist/src/context/graph/builtinBehaviors.js +3 -3
- package/dist/src/context/graph/builtinBehaviors.js.map +1 -1
- package/dist/src/context/graph/mapper.d.ts +4 -2
- package/dist/src/context/graph/mapper.js +15 -3
- package/dist/src/context/graph/mapper.js.map +1 -1
- package/dist/src/context/graph/toGraph.d.ts +13 -2
- package/dist/src/context/graph/toGraph.js +88 -32
- package/dist/src/context/graph/toGraph.js.map +1 -1
- package/dist/src/context/historyObserver.d.ts +1 -0
- package/dist/src/context/historyObserver.js +25 -26
- package/dist/src/context/historyObserver.js.map +1 -1
- package/dist/src/context/initializer.d.ts +9 -0
- package/dist/src/context/initializer.js +75 -0
- package/dist/src/context/initializer.js.map +1 -0
- package/dist/src/context/pipeline/contextWorkingBuffer.js +12 -6
- package/dist/src/context/pipeline/contextWorkingBuffer.js.map +1 -1
- package/dist/src/context/pipeline/contextWorkingBuffer.test.js +1 -1
- package/dist/src/context/pipeline/environmentImpl.d.ts +3 -2
- package/dist/src/context/pipeline/environmentImpl.js +6 -3
- package/dist/src/context/pipeline/environmentImpl.js.map +1 -1
- package/dist/src/context/pipeline/environmentImpl.test.js +1 -1
- package/dist/src/context/pipeline/environmentImpl.test.js.map +1 -1
- package/dist/src/context/pipeline/orchestrator.js +5 -0
- package/dist/src/context/pipeline/orchestrator.js.map +1 -1
- package/dist/src/context/processors/toolMaskingProcessor.js +21 -5
- package/dist/src/context/processors/toolMaskingProcessor.js.map +1 -1
- package/dist/src/context/processors/toolMaskingProcessor.test.js +22 -0
- package/dist/src/context/processors/toolMaskingProcessor.test.js.map +1 -1
- package/dist/src/context/system-tests/lifecycle.golden.test.js +5 -0
- package/dist/src/context/system-tests/lifecycle.golden.test.js.map +1 -1
- package/dist/src/context/system-tests/simulationHarness.js +1 -1
- package/dist/src/context/system-tests/simulationHarness.js.map +1 -1
- package/dist/src/context/testing/contextTestUtils.js +7 -3
- package/dist/src/context/testing/contextTestUtils.js.map +1 -1
- package/dist/src/context/tracer.js +3 -1
- package/dist/src/context/tracer.js.map +1 -1
- package/dist/src/context/tracer.test.js +4 -2
- package/dist/src/context/tracer.test.js.map +1 -1
- package/dist/src/context/utils/contextTokenCalculator.d.ts +2 -1
- package/dist/src/context/utils/contextTokenCalculator.js +13 -11
- package/dist/src/context/utils/contextTokenCalculator.js.map +1 -1
- package/dist/src/core/client.d.ts +1 -0
- package/dist/src/core/client.js +6 -1
- package/dist/src/core/client.js.map +1 -1
- package/dist/src/core/geminiChat.d.ts +2 -1
- package/dist/src/core/geminiChat.js +72 -20
- package/dist/src/core/geminiChat.js.map +1 -1
- package/dist/src/core/geminiChat.test.js +1 -0
- package/dist/src/core/geminiChat.test.js.map +1 -1
- package/dist/src/core/geminiChat_network_retry.test.js +1 -0
- package/dist/src/core/geminiChat_network_retry.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/generated/git-commit.js.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/prompts/snippets.js +2 -1
- package/dist/src/prompts/snippets.js.map +1 -1
- package/dist/src/prompts/snippets.legacy.js +2 -1
- package/dist/src/prompts/snippets.legacy.js.map +1 -1
- package/dist/src/utils/fsErrorMessages.js +4 -0
- package/dist/src/utils/fsErrorMessages.js.map +1 -1
- package/dist/src/utils/fsErrorMessages.test.js +21 -0
- package/dist/src/utils/fsErrorMessages.test.js.map +1 -1
- package/dist/src/utils/tokenCalculation.d.ts +2 -2
- package/dist/src/utils/tokenCalculation.js +15 -14
- package/dist/src/utils/tokenCalculation.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/google-gemini-cli-core-0.41.0-nightly.20260423.gaa05b4583.tgz +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Preview release: v0.
|
|
1
|
+
# Preview release: v0.40.0-preview.3
|
|
2
2
|
|
|
3
|
-
Released: April
|
|
3
|
+
Released: April 24, 2026
|
|
4
4
|
|
|
5
5
|
Our preview release includes the latest, new, and experimental features. This
|
|
6
6
|
release may not be as stable as our [latest weekly release](latest.md).
|
|
@@ -13,24 +13,174 @@ npm install -g @google/gemini-cli@preview
|
|
|
13
13
|
|
|
14
14
|
## Highlights
|
|
15
15
|
|
|
16
|
-
- **
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- **
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- **
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
issues for a smoother terminal experience.
|
|
16
|
+
- **Ripgrep Binary Bundling:** Ripgrep binaries are now bundled into the Single
|
|
17
|
+
Executable Application (SEA), enabling grep functionality in offline
|
|
18
|
+
environments.
|
|
19
|
+
- **MCP Resource Tools:** New core tools added to list and read MCP (Model
|
|
20
|
+
Context Protocol) resources, expanding the agent's ability to interact with
|
|
21
|
+
MCP servers.
|
|
22
|
+
- **Local Model Setup:** Introduced a streamlined `gemini gemma` command for
|
|
23
|
+
easier local model setup and integration.
|
|
24
|
+
- **Prompt-Driven Memory Management:** Refactored memory management into a
|
|
25
|
+
prompt-driven, four-tier system and integrated `skill-creator` for robust
|
|
26
|
+
skill extraction.
|
|
27
|
+
- **Enhanced UI and Accessibility:** Added support for OSC 777 terminal
|
|
28
|
+
notifications and GitHub colorblind themes for better user feedback and
|
|
29
|
+
accessibility.
|
|
31
30
|
|
|
32
31
|
## What's Changed
|
|
33
32
|
|
|
33
|
+
- update FatalUntrustedWorkspaceError message to include doc link by @ehedlund
|
|
34
|
+
in [#25874](https://github.com/google-gemini/gemini-cli/pull/25874)
|
|
35
|
+
- feat(core): enhance shell command validation and add core tools allowlist by
|
|
36
|
+
@galz10 in [#25720](https://github.com/google-gemini/gemini-cli/pull/25720)
|
|
37
|
+
- feat(cli): secure .env loading and enforce workspace trust in headless mode by
|
|
38
|
+
@ehedlund in [#25814](https://github.com/google-gemini/gemini-cli/pull/25814)
|
|
39
|
+
- chore(release): bump version to 0.40.0-nightly.20260414.g5b1f7375a by
|
|
40
|
+
@gemini-cli-robot in
|
|
41
|
+
[#25420](https://github.com/google-gemini/gemini-cli/pull/25420)
|
|
42
|
+
- Fix(core): retry additional OpenSSL 3.x SSL errors during streaming (#16075)
|
|
43
|
+
by @rcleveng in
|
|
44
|
+
[#25187](https://github.com/google-gemini/gemini-cli/pull/25187)
|
|
45
|
+
- fix(core): prevent YOLO mode from being downgraded by @galz10 in
|
|
46
|
+
[#25341](https://github.com/google-gemini/gemini-cli/pull/25341)
|
|
47
|
+
- feat: bundle ripgrep binaries into SEA for offline support by @scidomino in
|
|
48
|
+
[#25342](https://github.com/google-gemini/gemini-cli/pull/25342)
|
|
49
|
+
- Changelog for v0.39.0-preview.0 by @gemini-cli-robot in
|
|
50
|
+
[#25417](https://github.com/google-gemini/gemini-cli/pull/25417)
|
|
51
|
+
- feat(test): add large conversation scenario for performance test by
|
|
52
|
+
@cynthialong0-0 in
|
|
53
|
+
[#25331](https://github.com/google-gemini/gemini-cli/pull/25331)
|
|
54
|
+
- improve(core): require recurrence evidence before extracting skills by
|
|
55
|
+
@SandyTao520 in
|
|
56
|
+
[#25147](https://github.com/google-gemini/gemini-cli/pull/25147)
|
|
57
|
+
- test(evals): add subagent delegation evaluation tests by @anj-s in
|
|
58
|
+
[#24619](https://github.com/google-gemini/gemini-cli/pull/24619)
|
|
59
|
+
- feat: add github colorblind themes by @Z1xus in
|
|
60
|
+
[#15504](https://github.com/google-gemini/gemini-cli/pull/15504)
|
|
61
|
+
- fix(core): honor GOOGLE_GEMINI_BASE_URL and GOOGLE_VERTEX_BASE_URL by
|
|
62
|
+
@chrisjcthomas in
|
|
63
|
+
[#25357](https://github.com/google-gemini/gemini-cli/pull/25357)
|
|
64
|
+
- fix(cli): clean up slash command IDE listeners by @jasonmatthewsuhari in
|
|
65
|
+
[#24397](https://github.com/google-gemini/gemini-cli/pull/24397)
|
|
66
|
+
- Changelog for v0.38.0 by @gemini-cli-robot in
|
|
67
|
+
[#25470](https://github.com/google-gemini/gemini-cli/pull/25470)
|
|
68
|
+
- fix(evals): update eval tests for invoke_agent telemetry and project-scoped
|
|
69
|
+
memory by @SandyTao520 in
|
|
70
|
+
[#25502](https://github.com/google-gemini/gemini-cli/pull/25502)
|
|
71
|
+
- Changelog for v0.38.1 by @gemini-cli-robot in
|
|
72
|
+
[#25476](https://github.com/google-gemini/gemini-cli/pull/25476)
|
|
73
|
+
- feat(core): integrate skill-creator into skill extraction agent by
|
|
74
|
+
@SandyTao520 in
|
|
75
|
+
[#25421](https://github.com/google-gemini/gemini-cli/pull/25421)
|
|
76
|
+
- feat(cli): provide default post-submit prompt for skill command by @ruomengz
|
|
77
|
+
in [#25327](https://github.com/google-gemini/gemini-cli/pull/25327)
|
|
78
|
+
- feat(core): add tools to list and read MCP resources by @ruomengz in
|
|
79
|
+
[#25395](https://github.com/google-gemini/gemini-cli/pull/25395)
|
|
80
|
+
- fix(evals): add typecheck coverage for evals, integration-tests, and
|
|
81
|
+
memory-tests by @SandyTao520 in
|
|
82
|
+
[#25480](https://github.com/google-gemini/gemini-cli/pull/25480)
|
|
83
|
+
- Use OSC 777 for terminal notifications by @jackyliuxx in
|
|
84
|
+
[#25300](https://github.com/google-gemini/gemini-cli/pull/25300)
|
|
85
|
+
- fix(extensions): fix bundling for examples by @abhipatel12 in
|
|
86
|
+
[#25542](https://github.com/google-gemini/gemini-cli/pull/25542)
|
|
87
|
+
- fix(cli): reset plan session state on /clear by @jasonmatthewsuhari in
|
|
88
|
+
[#25515](https://github.com/google-gemini/gemini-cli/pull/25515)
|
|
89
|
+
- feat(core): add .mdx support to get-internal-docs tool by @g-samroberts in
|
|
90
|
+
[#25090](https://github.com/google-gemini/gemini-cli/pull/25090)
|
|
91
|
+
- docs(policy): mention that workspace policies are broken by @6112 in
|
|
92
|
+
[#24367](https://github.com/google-gemini/gemini-cli/pull/24367)
|
|
93
|
+
- fix(core): allow explicit write permissions to override governance file
|
|
94
|
+
protections in sandboxes by @galz10 in
|
|
95
|
+
[#25338](https://github.com/google-gemini/gemini-cli/pull/25338)
|
|
96
|
+
- feat(sandbox): resolve custom seatbelt profiles from $HOME/.gemini first by
|
|
97
|
+
@mvanhorn in [#25427](https://github.com/google-gemini/gemini-cli/pull/25427)
|
|
98
|
+
- Reduce blank lines. by @gundermanc in
|
|
99
|
+
[#25563](https://github.com/google-gemini/gemini-cli/pull/25563)
|
|
100
|
+
- fix(ui): revert preview theme on dialog unmount by @JayadityaGit in
|
|
101
|
+
[#22542](https://github.com/google-gemini/gemini-cli/pull/22542)
|
|
102
|
+
- fix(core): fix ShellExecutionConfig spread and add ProjectRegistry save
|
|
103
|
+
backoff by @mahimashanware in
|
|
104
|
+
[#25382](https://github.com/google-gemini/gemini-cli/pull/25382)
|
|
105
|
+
- feat(core): Disable topic updates for subagents by @gundermanc in
|
|
106
|
+
[#25567](https://github.com/google-gemini/gemini-cli/pull/25567)
|
|
107
|
+
- feat(core): enable topic update narration by default and promote to general by
|
|
108
|
+
@gundermanc in
|
|
109
|
+
[#25586](https://github.com/google-gemini/gemini-cli/pull/25586)
|
|
110
|
+
- docs: migrate installation and authentication to mdx with tabbed layouts by
|
|
111
|
+
@g-samroberts in
|
|
112
|
+
[#25155](https://github.com/google-gemini/gemini-cli/pull/25155)
|
|
113
|
+
- feat(config): split memoryManager flag into autoMemory by @SandyTao520 in
|
|
114
|
+
[#25601](https://github.com/google-gemini/gemini-cli/pull/25601)
|
|
115
|
+
- fix(core): allow Cloud Shell users to use PRO_MODEL_NO_ACCESS experiment by
|
|
116
|
+
@sehoon38 in [#25702](https://github.com/google-gemini/gemini-cli/pull/25702)
|
|
117
|
+
- fix(cli): round slow render latency to avoid opentelemetry float warning by
|
|
118
|
+
@scidomino in [#25709](https://github.com/google-gemini/gemini-cli/pull/25709)
|
|
119
|
+
- docs(tracker): introduce experimental task tracker feature by @anj-s in
|
|
120
|
+
[#24556](https://github.com/google-gemini/gemini-cli/pull/24556)
|
|
121
|
+
- docs(cli): fix inconsistent system.md casing in system prompt docs by @Bodlux
|
|
122
|
+
in [#25414](https://github.com/google-gemini/gemini-cli/pull/25414)
|
|
123
|
+
- feat(cli): add streamlined `gemini gemma` local model setup by @Samee24 in
|
|
124
|
+
[#25498](https://github.com/google-gemini/gemini-cli/pull/25498)
|
|
125
|
+
- Changelog for v0.38.2 by @gemini-cli-robot in
|
|
126
|
+
[#25593](https://github.com/google-gemini/gemini-cli/pull/25593)
|
|
127
|
+
- Fix: Disallow overriding IDE stdio via workspace .env (RCE) by @M0nd0R in
|
|
128
|
+
[#25022](https://github.com/google-gemini/gemini-cli/pull/25022)
|
|
129
|
+
- feat(test): refactor the memory usage test to use metrics from CLI process
|
|
130
|
+
instead of test runner by @cynthialong0-0 in
|
|
131
|
+
[#25708](https://github.com/google-gemini/gemini-cli/pull/25708)
|
|
132
|
+
- feat(vertex): add settings for Vertex AI request routing by @gordonhwc in
|
|
133
|
+
[#25513](https://github.com/google-gemini/gemini-cli/pull/25513)
|
|
134
|
+
- Fix/allow for session persistence by @ahsanfarooq210 in
|
|
135
|
+
[#25176](https://github.com/google-gemini/gemini-cli/pull/25176)
|
|
136
|
+
- Allow dots on GEMINI_API_KEY by @DKbyo in
|
|
137
|
+
[#25497](https://github.com/google-gemini/gemini-cli/pull/25497)
|
|
138
|
+
- feat(telemetry): add flag for enabling traces specifically by @spencer426 in
|
|
139
|
+
[#25343](https://github.com/google-gemini/gemini-cli/pull/25343)
|
|
140
|
+
- fix(core): resolve nested plan directory duplication and relative path
|
|
141
|
+
policies by @mahimashanware in
|
|
142
|
+
[#25138](https://github.com/google-gemini/gemini-cli/pull/25138)
|
|
143
|
+
- feat: detect new files in @ recommendations with watcher based updates by
|
|
144
|
+
@prassamin in [#25256](https://github.com/google-gemini/gemini-cli/pull/25256)
|
|
145
|
+
- fix(cli): use newline in shell command wrapping to avoid breaking heredocs by
|
|
146
|
+
@cocosheng-g in
|
|
147
|
+
[#25537](https://github.com/google-gemini/gemini-cli/pull/25537)
|
|
148
|
+
- fix(cli): ensure theme dialog labels are rendered for all themes by
|
|
149
|
+
@JayadityaGit in
|
|
150
|
+
[#24599](https://github.com/google-gemini/gemini-cli/pull/24599)
|
|
151
|
+
- fix(core): disable detached mode in Bun to prevent immediate SIGHUP of child
|
|
152
|
+
processes by @euxaristia in
|
|
153
|
+
[#22620](https://github.com/google-gemini/gemini-cli/pull/22620)
|
|
154
|
+
- feat: add /new as alias for /clear and refine command description by @ved015
|
|
155
|
+
in [#17865](https://github.com/google-gemini/gemini-cli/pull/17865)
|
|
156
|
+
- fix(cli): start auto memory in ACP sessions by @jasonmatthewsuhari in
|
|
157
|
+
[#25626](https://github.com/google-gemini/gemini-cli/pull/25626)
|
|
158
|
+
- fix(core): remove duplicate initialize call on agents refreshed by
|
|
159
|
+
@adamfweidman in
|
|
160
|
+
[#25670](https://github.com/google-gemini/gemini-cli/pull/25670)
|
|
161
|
+
- test(e2e): default integration tests to Flash Preview by @SandyTao520 in
|
|
162
|
+
[#25753](https://github.com/google-gemini/gemini-cli/pull/25753)
|
|
163
|
+
- refactor(memory): replace MemoryManagerAgent with prompt-driven memory editing
|
|
164
|
+
across four tiers by @SandyTao520 in
|
|
165
|
+
[#25716](https://github.com/google-gemini/gemini-cli/pull/25716)
|
|
166
|
+
- fix(cli): fix "/clear (new)" command by @mini2s in
|
|
167
|
+
[#25801](https://github.com/google-gemini/gemini-cli/pull/25801)
|
|
168
|
+
- fix(core): use dynamic CLI version for IDE client instead of hardcoded '1.0.0'
|
|
169
|
+
by @thekishandev in
|
|
170
|
+
[#24414](https://github.com/google-gemini/gemini-cli/pull/24414)
|
|
171
|
+
- fix(core): handle line endings in ignore file parsing by @xoma-zver in
|
|
172
|
+
[#23895](https://github.com/google-gemini/gemini-cli/pull/23895)
|
|
173
|
+
- Fix/command injection shell by @Famous077 in
|
|
174
|
+
[#24170](https://github.com/google-gemini/gemini-cli/pull/24170)
|
|
175
|
+
- fix(ui): removed background color for input by @devr0306 in
|
|
176
|
+
[#25339](https://github.com/google-gemini/gemini-cli/pull/25339)
|
|
177
|
+
- fix(devtools): reduce memory usage and defer connection by @SandyTao520 in
|
|
178
|
+
[#24496](https://github.com/google-gemini/gemini-cli/pull/24496)
|
|
179
|
+
- fix(core): support jsonl session logs in memory and summary services by
|
|
180
|
+
@SandyTao520 in
|
|
181
|
+
[#25816](https://github.com/google-gemini/gemini-cli/pull/25816)
|
|
182
|
+
- fix(release): exclude ripgrep binaries from npm tarballs by @SandyTao520 in
|
|
183
|
+
[#25841](https://github.com/google-gemini/gemini-cli/pull/25841)
|
|
34
184
|
- refactor(plan): simplify policy priorities and consolidate read-only rules by
|
|
35
185
|
@ruomengz in [#24849](https://github.com/google-gemini/gemini-cli/pull/24849)
|
|
36
186
|
- feat(test-utils): add memory usage integration test harness by @sripasg in
|
|
@@ -254,4 +404,4 @@ npm install -g @google/gemini-cli@preview
|
|
|
254
404
|
[#25336](https://github.com/google-gemini/gemini-cli/pull/25336)
|
|
255
405
|
|
|
256
406
|
**Full Changelog**:
|
|
257
|
-
https://github.com/google-gemini/gemini-cli/compare/v0.38.0-preview.0...v0.
|
|
407
|
+
https://github.com/google-gemini/gemini-cli/compare/v0.38.0-preview.0...v0.40.0-preview.3
|
package/dist/docs/cli/sandbox.md
CHANGED
|
@@ -31,6 +31,53 @@ The benefits of sandboxing include:
|
|
|
31
31
|
- **Safety**: Reduce risk when working with untrusted code or experimental
|
|
32
32
|
commands.
|
|
33
33
|
|
|
34
|
+
## Quickstart
|
|
35
|
+
|
|
36
|
+
You can enable sandboxing using a command flag, environment variable, or
|
|
37
|
+
configuration file.
|
|
38
|
+
|
|
39
|
+
### Using the command flag
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
gemini -s -p "analyze the code structure"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Using an environment variable
|
|
46
|
+
|
|
47
|
+
**macOS/Linux**
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
export GEMINI_SANDBOX=true
|
|
51
|
+
gemini -p "run the test suite"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Windows (PowerShell)**
|
|
55
|
+
|
|
56
|
+
```powershell
|
|
57
|
+
$env:GEMINI_SANDBOX="true"
|
|
58
|
+
gemini -p "run the test suite"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Configuring via settings.json
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"tools": {
|
|
66
|
+
"sandbox": "docker"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Configuration
|
|
72
|
+
|
|
73
|
+
Enable sandboxing using one of the following methods (in order of precedence):
|
|
74
|
+
|
|
75
|
+
1. **Command flag**: `-s` or `--sandbox`
|
|
76
|
+
2. **Environment variable**:
|
|
77
|
+
`GEMINI_SANDBOX=true|docker|podman|sandbox-exec|runsc|lxc`
|
|
78
|
+
3. **Settings file**: `"sandbox": true` in the `tools` object of your
|
|
79
|
+
`settings.json` file (for example, `{"tools": {"sandbox": true}}`).
|
|
80
|
+
|
|
34
81
|
## Sandboxing methods
|
|
35
82
|
|
|
36
83
|
Your ideal method of sandboxing may differ depending on your platform and your
|
|
@@ -43,12 +90,92 @@ Lightweight, built-in sandboxing using `sandbox-exec`.
|
|
|
43
90
|
**Default profile**: `permissive-open` - restricts writes outside project
|
|
44
91
|
directory but allows most other operations.
|
|
45
92
|
|
|
93
|
+
Built-in profiles (set via `SEATBELT_PROFILE` env var):
|
|
94
|
+
|
|
95
|
+
- `permissive-open` (default): Write restrictions, network allowed
|
|
96
|
+
- `permissive-proxied`: Write restrictions, network via proxy
|
|
97
|
+
- `restrictive-open`: Strict restrictions, network allowed
|
|
98
|
+
- `restrictive-proxied`: Strict restrictions, network via proxy
|
|
99
|
+
- `strict-open`: Read and write restrictions, network allowed
|
|
100
|
+
- `strict-proxied`: Read and write restrictions, network via proxy
|
|
101
|
+
|
|
46
102
|
### 2. Container-based (Docker/Podman)
|
|
47
103
|
|
|
48
|
-
Cross-platform sandboxing with complete process isolation
|
|
104
|
+
Cross-platform sandboxing with complete process isolation using container
|
|
105
|
+
technology. By default, it uses the `ghcr.io/google/gemini-cli:latest` image.
|
|
106
|
+
|
|
107
|
+
**Prerequisites:**
|
|
108
|
+
|
|
109
|
+
- Docker or Podman must be installed and running on your system.
|
|
110
|
+
|
|
111
|
+
**How it works (Workspace directory):**
|
|
49
112
|
|
|
50
|
-
|
|
51
|
-
|
|
113
|
+
Inside the sandbox container, your current working directory is mounted at the
|
|
114
|
+
**exact same absolute path** as it is on your host machine. For example, if you
|
|
115
|
+
run the CLI from `/Users/you/project` on your host machine, the sandbox will
|
|
116
|
+
mount your local project folder and operate within `/Users/you/project` inside
|
|
117
|
+
the container. This allows the AI to seamlessly read and modify your project
|
|
118
|
+
files while remaining isolated from the rest of your system.
|
|
119
|
+
|
|
120
|
+
**Quick setup:**
|
|
121
|
+
|
|
122
|
+
To enable Docker sandboxing, run Gemini CLI with the sandbox flag and specify
|
|
123
|
+
Docker as the provider:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Using the environment variable (Recommended)
|
|
127
|
+
export GEMINI_SANDBOX=docker
|
|
128
|
+
gemini -p "build the project"
|
|
129
|
+
|
|
130
|
+
# Or configure it permanently in your settings.json
|
|
131
|
+
# {"tools": {"sandbox": "docker"}}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Customizing the Sandbox Image:**
|
|
135
|
+
|
|
136
|
+
If your project requires specific dependencies, you can specify a custom image
|
|
137
|
+
name or have Gemini CLI build one for you automatically. You can use any Docker
|
|
138
|
+
or Podman image as your sandbox, provided it has standard shell utilities (like
|
|
139
|
+
`bash`) available.
|
|
140
|
+
|
|
141
|
+
**Option A: Using an existing custom image (e.g., Artifact Registry)**
|
|
142
|
+
|
|
143
|
+
To configure a custom image that is hosted on a registry (or built locally),
|
|
144
|
+
update your `settings.json` to use an object for the sandbox configuration, or
|
|
145
|
+
set the `GEMINI_SANDBOX_IMAGE` environment variable.
|
|
146
|
+
|
|
147
|
+
_Example: Configuring via `settings.json`_
|
|
148
|
+
|
|
149
|
+
```json
|
|
150
|
+
{
|
|
151
|
+
"tools": {
|
|
152
|
+
"sandbox": {
|
|
153
|
+
"command": "docker",
|
|
154
|
+
"image": "us-central1-docker.pkg.dev/my-project/my-repo/my-custom-sandbox:latest"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
_Example: Configuring via environment variable_
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
export GEMINI_SANDBOX_IMAGE="us-central1-docker.pkg.dev/my-project/my-repo/my-custom-sandbox:latest"
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Option B: Building a local custom image automatically**
|
|
167
|
+
|
|
168
|
+
If you prefer to define your environment as code, you can provide a Dockerfile
|
|
169
|
+
and Gemini CLI will build the image automatically.
|
|
170
|
+
|
|
171
|
+
1. Create a `.gemini/sandbox.Dockerfile` in your project root.
|
|
172
|
+
2. Ensure you have the `gh` CLI installed and authenticated (if you are using
|
|
173
|
+
the default `ghcr.io/google/gemini-cli` image as a base).
|
|
174
|
+
3. Run your command with the `BUILD_SANDBOX` environment variable set:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
BUILD_SANDBOX=1 GEMINI_SANDBOX=docker gemini -p "run my custom build"
|
|
178
|
+
```
|
|
52
179
|
|
|
53
180
|
### 3. Windows Native Sandbox (Windows only)
|
|
54
181
|
|
|
@@ -188,59 +315,49 @@ This mechanism ensures you don't have to manually re-run commands with more
|
|
|
188
315
|
permissive sandbox settings, while still maintaining control over what the AI
|
|
189
316
|
can access.
|
|
190
317
|
|
|
191
|
-
|
|
318
|
+
### Including files outside the workspace
|
|
192
319
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
320
|
+
By default, the sandbox only has access to the current project workspace. If you
|
|
321
|
+
need the sandbox to have permission to operate on certain files or directories
|
|
322
|
+
from the local file system outside of the project workspace, you can mount them
|
|
323
|
+
using the `SANDBOX_MOUNTS` environment variable.
|
|
197
324
|
|
|
198
|
-
|
|
325
|
+
Provide a comma-separated list of mount definitions in the format
|
|
326
|
+
`from:to:opts`. If `to` is omitted, it defaults to the same path as `from`. If
|
|
327
|
+
`opts` is omitted, it defaults to `ro` (read-only). Note that the `from` path
|
|
328
|
+
must be an absolute path.
|
|
199
329
|
|
|
200
|
-
**
|
|
330
|
+
**Example**:
|
|
201
331
|
|
|
202
332
|
```bash
|
|
203
|
-
export
|
|
204
|
-
gemini -p "run the test suite"
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
**Windows (PowerShell)**
|
|
208
|
-
|
|
209
|
-
```powershell
|
|
210
|
-
$env:GEMINI_SANDBOX="true"
|
|
211
|
-
gemini -p "run the test suite"
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
**Configure in settings.json**
|
|
215
|
-
|
|
216
|
-
```json
|
|
217
|
-
{
|
|
218
|
-
"tools": {
|
|
219
|
-
"sandbox": "docker"
|
|
220
|
-
}
|
|
221
|
-
}
|
|
333
|
+
export SANDBOX_MOUNTS="/path/on/host:/path/in/container:rw,/another/path:ro"
|
|
222
334
|
```
|
|
223
335
|
|
|
224
|
-
##
|
|
336
|
+
## Running inside a Docker container
|
|
225
337
|
|
|
226
|
-
|
|
338
|
+
If you are running Gemini CLI itself from within an official or custom Docker
|
|
339
|
+
container and want to enable sandboxing, you must share the host's Docker socket
|
|
340
|
+
and ensure your workspace paths align.
|
|
227
341
|
|
|
228
|
-
1.
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
342
|
+
1. **Mount the Docker socket**: Map `/var/run/docker.sock` so the CLI can spawn
|
|
343
|
+
sibling sandbox containers via the host's Docker daemon.
|
|
344
|
+
2. **Align workspace paths**: The path to your workspace inside the container
|
|
345
|
+
must exactly match the absolute path on the host. Because the sandbox
|
|
346
|
+
container is spawned by the host's Docker daemon, it resolves volume mounts
|
|
347
|
+
against the host file system.
|
|
233
348
|
|
|
234
|
-
|
|
349
|
+
**Example**:
|
|
235
350
|
|
|
236
|
-
|
|
351
|
+
```bash
|
|
352
|
+
docker run -it \
|
|
353
|
+
-v /var/run/docker.sock:/var/run/docker.sock \
|
|
354
|
+
-v /absolute/path/on/host/project:/absolute/path/on/host/project \
|
|
355
|
+
-w /absolute/path/on/host/project \
|
|
356
|
+
-e GEMINI_SANDBOX=docker \
|
|
357
|
+
ghcr.io/google/gemini-cli:latest
|
|
358
|
+
```
|
|
237
359
|
|
|
238
|
-
|
|
239
|
-
- `permissive-proxied`: Write restrictions, network via proxy
|
|
240
|
-
- `restrictive-open`: Strict restrictions, network allowed
|
|
241
|
-
- `restrictive-proxied`: Strict restrictions, network via proxy
|
|
242
|
-
- `strict-open`: Read and write restrictions, network allowed
|
|
243
|
-
- `strict-proxied`: Read and write restrictions, network via proxy
|
|
360
|
+
## Advanced settings
|
|
244
361
|
|
|
245
362
|
### Custom sandbox flags
|
|
246
363
|
|
|
@@ -279,7 +396,7 @@ export SANDBOX_FLAGS="--flag1 --flag2=value"
|
|
|
279
396
|
$env:SANDBOX_FLAGS="--flag1 --flag2=value"
|
|
280
397
|
```
|
|
281
398
|
|
|
282
|
-
|
|
399
|
+
### Linux UID/GID handling
|
|
283
400
|
|
|
284
401
|
The sandbox automatically handles user permissions on Linux. Override these
|
|
285
402
|
permissions with:
|
|
@@ -1191,7 +1191,7 @@ their corresponding top-level category object in your `settings.json` file.
|
|
|
1191
1191
|
},
|
|
1192
1192
|
"stateTransitions": {
|
|
1193
1193
|
"terminal": "terminal",
|
|
1194
|
-
"transient": "
|
|
1194
|
+
"transient": "sticky_retry",
|
|
1195
1195
|
"not_found": "terminal",
|
|
1196
1196
|
"unknown": "terminal"
|
|
1197
1197
|
}
|
|
@@ -1207,7 +1207,7 @@ their corresponding top-level category object in your `settings.json` file.
|
|
|
1207
1207
|
},
|
|
1208
1208
|
"stateTransitions": {
|
|
1209
1209
|
"terminal": "terminal",
|
|
1210
|
-
"transient": "
|
|
1210
|
+
"transient": "sticky_retry",
|
|
1211
1211
|
"not_found": "terminal",
|
|
1212
1212
|
"unknown": "terminal"
|
|
1213
1213
|
}
|
|
@@ -1224,7 +1224,7 @@ their corresponding top-level category object in your `settings.json` file.
|
|
|
1224
1224
|
},
|
|
1225
1225
|
"stateTransitions": {
|
|
1226
1226
|
"terminal": "terminal",
|
|
1227
|
-
"transient": "
|
|
1227
|
+
"transient": "sticky_retry",
|
|
1228
1228
|
"not_found": "terminal",
|
|
1229
1229
|
"unknown": "terminal"
|
|
1230
1230
|
}
|
|
@@ -1240,7 +1240,7 @@ their corresponding top-level category object in your `settings.json` file.
|
|
|
1240
1240
|
},
|
|
1241
1241
|
"stateTransitions": {
|
|
1242
1242
|
"terminal": "terminal",
|
|
1243
|
-
"transient": "
|
|
1243
|
+
"transient": "sticky_retry",
|
|
1244
1244
|
"not_found": "terminal",
|
|
1245
1245
|
"unknown": "terminal"
|
|
1246
1246
|
}
|
|
@@ -1257,7 +1257,7 @@ their corresponding top-level category object in your `settings.json` file.
|
|
|
1257
1257
|
},
|
|
1258
1258
|
"stateTransitions": {
|
|
1259
1259
|
"terminal": "terminal",
|
|
1260
|
-
"transient": "
|
|
1260
|
+
"transient": "sticky_retry",
|
|
1261
1261
|
"not_found": "terminal",
|
|
1262
1262
|
"unknown": "terminal"
|
|
1263
1263
|
}
|
|
@@ -1272,7 +1272,7 @@ their corresponding top-level category object in your `settings.json` file.
|
|
|
1272
1272
|
},
|
|
1273
1273
|
"stateTransitions": {
|
|
1274
1274
|
"terminal": "terminal",
|
|
1275
|
-
"transient": "
|
|
1275
|
+
"transient": "sticky_retry",
|
|
1276
1276
|
"not_found": "terminal",
|
|
1277
1277
|
"unknown": "terminal"
|
|
1278
1278
|
}
|
|
@@ -1288,7 +1288,7 @@ their corresponding top-level category object in your `settings.json` file.
|
|
|
1288
1288
|
},
|
|
1289
1289
|
"stateTransitions": {
|
|
1290
1290
|
"terminal": "terminal",
|
|
1291
|
-
"transient": "
|
|
1291
|
+
"transient": "sticky_retry",
|
|
1292
1292
|
"not_found": "terminal",
|
|
1293
1293
|
"unknown": "terminal"
|
|
1294
1294
|
}
|
|
@@ -1846,6 +1846,12 @@ their corresponding top-level category object in your `settings.json` file.
|
|
|
1846
1846
|
- **Default:** `true`
|
|
1847
1847
|
- **Requires restart:** Yes
|
|
1848
1848
|
|
|
1849
|
+
- **`experimental.stressTestProfile`** (boolean):
|
|
1850
|
+
- **Description:** Significantly lowers token limits to force early garbage
|
|
1851
|
+
collection and distillation for testing purposes.
|
|
1852
|
+
- **Default:** `false`
|
|
1853
|
+
- **Requires restart:** Yes
|
|
1854
|
+
|
|
1849
1855
|
- **`experimental.autoMemory`** (boolean):
|
|
1850
1856
|
- **Description:** Automatically extract reusable skills from past sessions in
|
|
1851
1857
|
the background. Review results with /memory inbox.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policyCatalog.js","sourceRoot":"","sources":["../../../src/availability/policyCatalog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,EACL,+BAA+B,EAC/B,0BAA0B,EAC1B,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,YAAY,GACb,MAAM,qBAAqB,CAAC;AAiB7B,MAAM,eAAe,GAAyB;IAC5C,QAAQ,EAAE,QAAQ;IAClB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,QAAQ;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAyB;IAClD,QAAQ,EAAE,QAAQ;IAClB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,QAAQ;CAClB,CAAC;AAEF,MAAM,aAAa,GAAwB;IACzC,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"policyCatalog.js","sourceRoot":"","sources":["../../../src/availability/policyCatalog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,EACL,+BAA+B,EAC/B,0BAA0B,EAC1B,oBAAoB,EACpB,0BAA0B,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E,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE;QAC1D,gBAAgB,EAAE;YAChB,GAAG,aAAa;YAChB,GAAG,CAAC,MAAM,CAAC,gBAAgB,IAAI,EAAE,CAAC;SACnC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,MAAmB;IACtC,OAAO;QACL,GAAG,MAAM;QACT,OAAO,EAAE,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE;QAC9B,gBAAgB,EAAE,EAAE,GAAG,MAAM,CAAC,gBAAgB,EAAE;KACjD,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,KAAuB;IACzC,OAAO,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -41,7 +41,7 @@ describe('policyCatalog', () => {
|
|
|
41
41
|
it('marks preview transients as sticky retries', () => {
|
|
42
42
|
const [previewPolicy] = getModelPolicyChain({ previewEnabled: true });
|
|
43
43
|
expect(previewPolicy.model).toBe(PREVIEW_GEMINI_MODEL);
|
|
44
|
-
expect(previewPolicy.stateTransitions.transient).toBe('
|
|
44
|
+
expect(previewPolicy.stateTransitions.transient).toBe('sticky_retry');
|
|
45
45
|
});
|
|
46
46
|
it('applies default actions and state transitions for unspecified kinds', () => {
|
|
47
47
|
const [previewPolicy] = getModelPolicyChain({ previewEnabled: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policyCatalog.test.js","sourceRoot":"","sources":["../../../src/availability/policyCatalog.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,qCAAqC,EACrC,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,qBAAqB,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E,IAAI,EAAE;SAC1D,CAAC;QACF,MAAM,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CACnD,mCAAmC,CACpC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC9D,MAAM,MAAM,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QAC7C,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/C,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9C,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1D,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -134,6 +134,13 @@ export class CodeAssistServer {
|
|
|
134
134
|
currentTier: { id: UserTierId.STANDARD },
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
|
+
else if (isPermissionDeniedError(e) &&
|
|
138
|
+
req.cloudaicompanionProject === 'cloudshell-gca') {
|
|
139
|
+
throw new Error('Access to the default Cloud Shell Gemini project was denied.\n' +
|
|
140
|
+
'Please set your own Google Cloud project by running:\n' +
|
|
141
|
+
'gcloud config set project [PROJECT_ID]\n' +
|
|
142
|
+
'or setting export GOOGLE_CLOUD_PROJECT=...');
|
|
143
|
+
}
|
|
137
144
|
else {
|
|
138
145
|
throw e;
|
|
139
146
|
}
|
|
@@ -341,4 +348,13 @@ function isVpcScAffectedUser(error) {
|
|
|
341
348
|
}
|
|
342
349
|
return false;
|
|
343
350
|
}
|
|
351
|
+
function isPermissionDeniedError(error) {
|
|
352
|
+
return (!!error &&
|
|
353
|
+
typeof error === 'object' &&
|
|
354
|
+
'response' in error &&
|
|
355
|
+
!!error.response &&
|
|
356
|
+
typeof error.response === 'object' &&
|
|
357
|
+
'status' in error.response &&
|
|
358
|
+
error.response.status === 403);
|
|
359
|
+
}
|
|
344
360
|
//# sourceMappingURL=server.js.map
|