@google/gemini-cli-core 0.22.0 → 0.23.0-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (342) hide show
  1. package/dist/docs/CONTRIBUTING.md +546 -0
  2. package/dist/docs/architecture.md +80 -0
  3. package/dist/docs/assets/connected_devtools.png +0 -0
  4. package/dist/docs/assets/gemini-screenshot.png +0 -0
  5. package/dist/docs/assets/release_patch.png +0 -0
  6. package/dist/docs/assets/theme-ansi-light.png +0 -0
  7. package/dist/docs/assets/theme-ansi.png +0 -0
  8. package/dist/docs/assets/theme-atom-one.png +0 -0
  9. package/dist/docs/assets/theme-ayu-light.png +0 -0
  10. package/dist/docs/assets/theme-ayu.png +0 -0
  11. package/dist/docs/assets/theme-custom.png +0 -0
  12. package/dist/docs/assets/theme-default-light.png +0 -0
  13. package/dist/docs/assets/theme-default.png +0 -0
  14. package/dist/docs/assets/theme-dracula.png +0 -0
  15. package/dist/docs/assets/theme-github-light.png +0 -0
  16. package/dist/docs/assets/theme-github.png +0 -0
  17. package/dist/docs/assets/theme-google-light.png +0 -0
  18. package/dist/docs/assets/theme-xcode-light.png +0 -0
  19. package/dist/docs/changelogs/index.md +592 -0
  20. package/dist/docs/changelogs/latest.md +225 -0
  21. package/dist/docs/changelogs/preview.md +129 -0
  22. package/dist/docs/changelogs/releases.md +896 -0
  23. package/dist/docs/cli/authentication.md +3 -0
  24. package/dist/docs/cli/checkpointing.md +94 -0
  25. package/dist/docs/cli/commands.md +354 -0
  26. package/dist/docs/cli/configuration.md +780 -0
  27. package/dist/docs/cli/custom-commands.md +315 -0
  28. package/dist/docs/cli/enterprise.md +565 -0
  29. package/dist/docs/cli/gemini-ignore.md +71 -0
  30. package/dist/docs/cli/gemini-md.md +108 -0
  31. package/dist/docs/cli/generation-settings.md +210 -0
  32. package/dist/docs/cli/headless.md +388 -0
  33. package/dist/docs/cli/index.md +63 -0
  34. package/dist/docs/cli/keyboard-shortcuts.md +143 -0
  35. package/dist/docs/cli/model-routing.md +37 -0
  36. package/dist/docs/cli/model.md +62 -0
  37. package/dist/docs/cli/sandbox.md +171 -0
  38. package/dist/docs/cli/session-management.md +158 -0
  39. package/dist/docs/cli/settings.md +112 -0
  40. package/dist/docs/cli/system-prompt.md +93 -0
  41. package/dist/docs/cli/telemetry.md +791 -0
  42. package/dist/docs/cli/themes.md +237 -0
  43. package/dist/docs/cli/token-caching.md +20 -0
  44. package/dist/docs/cli/trusted-folders.md +95 -0
  45. package/dist/docs/cli/tutorials.md +83 -0
  46. package/dist/docs/cli/uninstall.md +47 -0
  47. package/dist/docs/core/index.md +101 -0
  48. package/dist/docs/core/memport.md +244 -0
  49. package/dist/docs/core/policy-engine.md +267 -0
  50. package/dist/docs/core/tools-api.md +131 -0
  51. package/dist/docs/examples/proxy-script.md +83 -0
  52. package/dist/docs/extensions/extension-releasing.md +183 -0
  53. package/dist/docs/extensions/getting-started-extensions.md +245 -0
  54. package/dist/docs/extensions/index.md +293 -0
  55. package/dist/docs/faq.md +154 -0
  56. package/dist/docs/get-started/authentication.md +321 -0
  57. package/dist/docs/get-started/configuration-v1.md +888 -0
  58. package/dist/docs/get-started/configuration.md +1444 -0
  59. package/dist/docs/get-started/deployment.md +143 -0
  60. package/dist/docs/get-started/examples.md +219 -0
  61. package/dist/docs/get-started/gemini-3.md +116 -0
  62. package/dist/docs/get-started/index.md +71 -0
  63. package/dist/docs/get-started/installation.md +141 -0
  64. package/dist/docs/hooks/best-practices.md +806 -0
  65. package/dist/docs/hooks/index.md +665 -0
  66. package/dist/docs/hooks/reference.md +168 -0
  67. package/dist/docs/hooks/writing-hooks.md +1026 -0
  68. package/dist/docs/ide-integration/ide-companion-spec.md +267 -0
  69. package/dist/docs/ide-integration/index.md +202 -0
  70. package/dist/docs/index.md +147 -0
  71. package/dist/docs/integration-tests.md +211 -0
  72. package/dist/docs/issue-and-pr-automation.md +134 -0
  73. package/dist/docs/local-development.md +128 -0
  74. package/dist/docs/mermaid/context.mmd +103 -0
  75. package/dist/docs/mermaid/render-path.mmd +64 -0
  76. package/dist/docs/npm.md +62 -0
  77. package/dist/docs/quota-and-pricing.md +158 -0
  78. package/dist/docs/release-confidence.md +164 -0
  79. package/dist/docs/releases.md +540 -0
  80. package/dist/docs/sidebar.json +297 -0
  81. package/dist/docs/tools/file-system.md +217 -0
  82. package/dist/docs/tools/index.md +95 -0
  83. package/dist/docs/tools/mcp-server.md +1044 -0
  84. package/dist/docs/tools/memory.md +54 -0
  85. package/dist/docs/tools/shell.md +260 -0
  86. package/dist/docs/tools/todos.md +57 -0
  87. package/dist/docs/tools/web-fetch.md +59 -0
  88. package/dist/docs/tools/web-search.md +42 -0
  89. package/dist/docs/tos-privacy.md +96 -0
  90. package/dist/docs/troubleshooting.md +158 -0
  91. package/dist/src/agents/codebase-investigator.d.ts +2 -2
  92. package/dist/src/agents/codebase-investigator.js +4 -3
  93. package/dist/src/agents/codebase-investigator.js.map +1 -1
  94. package/dist/src/agents/delegate-to-agent-tool.js +8 -4
  95. package/dist/src/agents/delegate-to-agent-tool.js.map +1 -1
  96. package/dist/src/agents/delegate-to-agent-tool.test.js +6 -4
  97. package/dist/src/agents/delegate-to-agent-tool.test.js.map +1 -1
  98. package/dist/src/agents/introspection-agent.d.ts +23 -0
  99. package/dist/src/agents/introspection-agent.js +72 -0
  100. package/dist/src/agents/introspection-agent.js.map +1 -0
  101. package/dist/src/agents/introspection-agent.test.js +47 -0
  102. package/dist/src/agents/introspection-agent.test.js.map +1 -0
  103. package/dist/src/agents/{executor.d.ts → local-executor.d.ts} +5 -11
  104. package/dist/src/agents/{executor.js → local-executor.js} +79 -53
  105. package/dist/src/agents/local-executor.js.map +1 -0
  106. package/dist/src/agents/{executor.test.js → local-executor.test.js} +64 -45
  107. package/dist/src/agents/local-executor.test.js.map +1 -0
  108. package/dist/src/agents/{invocation.d.ts → local-invocation.d.ts} +5 -6
  109. package/dist/src/agents/{invocation.js → local-invocation.js} +8 -9
  110. package/dist/src/agents/local-invocation.js.map +1 -0
  111. package/dist/src/agents/local-invocation.test.d.ts +6 -0
  112. package/dist/src/agents/{invocation.test.js → local-invocation.test.js} +18 -17
  113. package/dist/src/agents/local-invocation.test.js.map +1 -0
  114. package/dist/src/agents/registry.d.ts +1 -0
  115. package/dist/src/agents/registry.js +68 -20
  116. package/dist/src/agents/registry.js.map +1 -1
  117. package/dist/src/agents/registry.test.js +113 -1
  118. package/dist/src/agents/registry.test.js.map +1 -1
  119. package/dist/src/agents/remote-invocation.d.ts +21 -0
  120. package/dist/src/agents/remote-invocation.js +31 -0
  121. package/dist/src/agents/remote-invocation.js.map +1 -0
  122. package/dist/src/agents/remote-invocation.test.d.ts +6 -0
  123. package/dist/src/agents/remote-invocation.test.js +35 -0
  124. package/dist/src/agents/remote-invocation.test.js.map +1 -0
  125. package/dist/src/agents/subagent-tool-wrapper.js +7 -3
  126. package/dist/src/agents/subagent-tool-wrapper.js.map +1 -1
  127. package/dist/src/agents/subagent-tool-wrapper.test.js +10 -9
  128. package/dist/src/agents/subagent-tool-wrapper.test.js.map +1 -1
  129. package/dist/src/agents/toml-loader.d.ts +65 -0
  130. package/dist/src/agents/toml-loader.js +176 -0
  131. package/dist/src/agents/toml-loader.js.map +1 -0
  132. package/dist/src/agents/toml-loader.test.d.ts +6 -0
  133. package/dist/src/agents/toml-loader.test.js +190 -0
  134. package/dist/src/agents/toml-loader.test.js.map +1 -0
  135. package/dist/src/agents/types.d.ts +12 -4
  136. package/dist/src/availability/modelAvailabilityService.d.ts +2 -1
  137. package/dist/src/availability/policyHelpers.d.ts +4 -3
  138. package/dist/src/availability/policyHelpers.js +13 -20
  139. package/dist/src/availability/policyHelpers.js.map +1 -1
  140. package/dist/src/availability/policyHelpers.test.js +28 -18
  141. package/dist/src/availability/policyHelpers.test.js.map +1 -1
  142. package/dist/src/code_assist/oauth2.js +1 -1
  143. package/dist/src/code_assist/oauth2.js.map +1 -1
  144. package/dist/src/code_assist/oauth2.test.js +6 -8
  145. package/dist/src/code_assist/oauth2.test.js.map +1 -1
  146. package/dist/src/code_assist/server.d.ts +4 -1
  147. package/dist/src/code_assist/server.js +50 -7
  148. package/dist/src/code_assist/server.js.map +1 -1
  149. package/dist/src/code_assist/server.test.js +177 -27
  150. package/dist/src/code_assist/server.test.js.map +1 -1
  151. package/dist/src/code_assist/telemetry.d.ts +14 -0
  152. package/dist/src/code_assist/telemetry.js +156 -0
  153. package/dist/src/code_assist/telemetry.js.map +1 -0
  154. package/dist/src/code_assist/telemetry.test.d.ts +6 -0
  155. package/dist/src/code_assist/telemetry.test.js +300 -0
  156. package/dist/src/code_assist/telemetry.test.js.map +1 -0
  157. package/dist/src/code_assist/types.d.ts +52 -1
  158. package/dist/src/code_assist/types.js +21 -0
  159. package/dist/src/code_assist/types.js.map +1 -1
  160. package/dist/src/config/config.d.ts +10 -13
  161. package/dist/src/config/config.js +32 -32
  162. package/dist/src/config/config.js.map +1 -1
  163. package/dist/src/config/config.test.js +72 -19
  164. package/dist/src/config/config.test.js.map +1 -1
  165. package/dist/src/config/flashFallback.test.js +0 -37
  166. package/dist/src/config/flashFallback.test.js.map +1 -1
  167. package/dist/src/config/storage.d.ts +2 -0
  168. package/dist/src/config/storage.js +6 -0
  169. package/dist/src/config/storage.js.map +1 -1
  170. package/dist/src/config/storage.test.js +8 -0
  171. package/dist/src/config/storage.test.js.map +1 -1
  172. package/dist/src/core/baseLlmClient.js +44 -43
  173. package/dist/src/core/baseLlmClient.js.map +1 -1
  174. package/dist/src/core/baseLlmClient.test.js +12 -19
  175. package/dist/src/core/baseLlmClient.test.js.map +1 -1
  176. package/dist/src/core/client.js +23 -35
  177. package/dist/src/core/client.js.map +1 -1
  178. package/dist/src/core/client.test.js +32 -65
  179. package/dist/src/core/client.test.js.map +1 -1
  180. package/dist/src/core/clientHookTriggers.js +2 -2
  181. package/dist/src/core/clientHookTriggers.js.map +1 -1
  182. package/dist/src/core/contentGenerator.test.js +0 -6
  183. package/dist/src/core/contentGenerator.test.js.map +1 -1
  184. package/dist/src/core/coreToolHookTriggers.js +3 -3
  185. package/dist/src/core/coreToolHookTriggers.js.map +1 -1
  186. package/dist/src/core/geminiChat.js +21 -71
  187. package/dist/src/core/geminiChat.js.map +1 -1
  188. package/dist/src/core/geminiChat.test.js +16 -92
  189. package/dist/src/core/geminiChat.test.js.map +1 -1
  190. package/dist/src/core/geminiChatHookTriggers.js +3 -3
  191. package/dist/src/core/geminiChatHookTriggers.js.map +1 -1
  192. package/dist/src/core/geminiChat_network_retry.test.js +4 -6
  193. package/dist/src/core/geminiChat_network_retry.test.js.map +1 -1
  194. package/dist/src/core/prompts.test.js +0 -2
  195. package/dist/src/core/prompts.test.js.map +1 -1
  196. package/dist/src/core/sessionHookTriggers.js +3 -3
  197. package/dist/src/core/sessionHookTriggers.js.map +1 -1
  198. package/dist/src/core/turn.d.ts +1 -0
  199. package/dist/src/core/turn.js +4 -12
  200. package/dist/src/core/turn.js.map +1 -1
  201. package/dist/src/core/turn.test.js +0 -5
  202. package/dist/src/core/turn.test.js.map +1 -1
  203. package/dist/src/fallback/handler.test.js +0 -21
  204. package/dist/src/fallback/handler.test.js.map +1 -1
  205. package/dist/src/generated/git-commit.d.ts +2 -2
  206. package/dist/src/generated/git-commit.js +2 -2
  207. package/dist/src/generated/git-commit.js.map +1 -1
  208. package/dist/src/hooks/hookEventHandler.js +10 -4
  209. package/dist/src/hooks/hookEventHandler.js.map +1 -1
  210. package/dist/src/hooks/hookEventHandler.test.js +47 -0
  211. package/dist/src/hooks/hookEventHandler.test.js.map +1 -1
  212. package/dist/src/hooks/hookPlanner.js +3 -1
  213. package/dist/src/hooks/hookPlanner.js.map +1 -1
  214. package/dist/src/hooks/hookPlanner.test.js +61 -0
  215. package/dist/src/hooks/hookPlanner.test.js.map +1 -1
  216. package/dist/src/hooks/hookRegistry.d.ts +1 -1
  217. package/dist/src/hooks/hookRegistry.js +2 -2
  218. package/dist/src/hooks/hookRegistry.js.map +1 -1
  219. package/dist/src/hooks/hookRegistry.test.js +73 -0
  220. package/dist/src/hooks/hookRegistry.test.js.map +1 -1
  221. package/dist/src/hooks/hookRunner.js +14 -10
  222. package/dist/src/hooks/hookRunner.js.map +1 -1
  223. package/dist/src/hooks/hookRunner.test.js +81 -33
  224. package/dist/src/hooks/hookRunner.test.js.map +1 -1
  225. package/dist/src/hooks/types.d.ts +2 -0
  226. package/dist/src/hooks/types.js.map +1 -1
  227. package/dist/src/index.d.ts +2 -0
  228. package/dist/src/index.js +2 -0
  229. package/dist/src/index.js.map +1 -1
  230. package/dist/src/mcp/oauth-provider.js +6 -2
  231. package/dist/src/mcp/oauth-provider.js.map +1 -1
  232. package/dist/src/mcp/oauth-provider.test.js +4 -1
  233. package/dist/src/mcp/oauth-provider.test.js.map +1 -1
  234. package/dist/src/mcp/oauth-utils.d.ts +8 -1
  235. package/dist/src/mcp/oauth-utils.js +30 -1
  236. package/dist/src/mcp/oauth-utils.js.map +1 -1
  237. package/dist/src/mcp/oauth-utils.test.js +42 -0
  238. package/dist/src/mcp/oauth-utils.test.js.map +1 -1
  239. package/dist/src/routing/strategies/fallbackStrategy.js +0 -3
  240. package/dist/src/routing/strategies/fallbackStrategy.js.map +1 -1
  241. package/dist/src/routing/strategies/fallbackStrategy.test.js +0 -6
  242. package/dist/src/routing/strategies/fallbackStrategy.test.js.map +1 -1
  243. package/dist/src/services/contextManager.d.ts +5 -11
  244. package/dist/src/services/contextManager.js +20 -17
  245. package/dist/src/services/contextManager.js.map +1 -1
  246. package/dist/src/services/contextManager.test.js +40 -41
  247. package/dist/src/services/contextManager.test.js.map +1 -1
  248. package/dist/src/services/loopDetectionService.js +2 -1
  249. package/dist/src/services/loopDetectionService.js.map +1 -1
  250. package/dist/src/services/loopDetectionService.test.js +14 -8
  251. package/dist/src/services/loopDetectionService.test.js.map +1 -1
  252. package/dist/src/services/modelConfig.integration.test.js +1 -1
  253. package/dist/src/services/modelConfig.integration.test.js.map +1 -1
  254. package/dist/src/services/shellExecutionService.js +18 -2
  255. package/dist/src/services/shellExecutionService.js.map +1 -1
  256. package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +4 -2
  257. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +25 -0
  258. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
  259. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +32 -1
  260. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -1
  261. package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +5 -1
  262. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +12 -1
  263. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
  264. package/dist/src/telemetry/loggers.js +1 -0
  265. package/dist/src/telemetry/loggers.js.map +1 -1
  266. package/dist/src/telemetry/loggers.test.js +37 -2
  267. package/dist/src/telemetry/loggers.test.js.map +1 -1
  268. package/dist/src/telemetry/sdk.js +2 -2
  269. package/dist/src/telemetry/sdk.js.map +1 -1
  270. package/dist/src/tools/confirmation-policy.test.d.ts +6 -0
  271. package/dist/src/tools/confirmation-policy.test.js +152 -0
  272. package/dist/src/tools/confirmation-policy.test.js.map +1 -0
  273. package/dist/src/tools/edit.js +5 -1
  274. package/dist/src/tools/edit.js.map +1 -1
  275. package/dist/src/tools/get-internal-docs.d.ts +27 -0
  276. package/dist/src/tools/get-internal-docs.js +129 -0
  277. package/dist/src/tools/get-internal-docs.js.map +1 -0
  278. package/dist/src/tools/get-internal-docs.test.d.ts +6 -0
  279. package/dist/src/tools/get-internal-docs.test.js +56 -0
  280. package/dist/src/tools/get-internal-docs.test.js.map +1 -0
  281. package/dist/src/tools/ripGrep.d.ts +1 -0
  282. package/dist/src/tools/ripGrep.js +16 -4
  283. package/dist/src/tools/ripGrep.js.map +1 -1
  284. package/dist/src/tools/ripGrep.test.js +55 -0
  285. package/dist/src/tools/ripGrep.test.js.map +1 -1
  286. package/dist/src/tools/smart-edit.js +5 -1
  287. package/dist/src/tools/smart-edit.js.map +1 -1
  288. package/dist/src/tools/tool-names.d.ts +14 -0
  289. package/dist/src/tools/tool-names.js +55 -0
  290. package/dist/src/tools/tool-names.js.map +1 -1
  291. package/dist/src/tools/tool-names.test.d.ts +6 -0
  292. package/dist/src/tools/tool-names.test.js +43 -0
  293. package/dist/src/tools/tool-names.test.js.map +1 -0
  294. package/dist/src/tools/tool-registry.d.ts +0 -1
  295. package/dist/src/tools/tool-registry.js +1 -1
  296. package/dist/src/tools/tool-registry.js.map +1 -1
  297. package/dist/src/tools/tool-registry.test.js +2 -1
  298. package/dist/src/tools/tool-registry.test.js.map +1 -1
  299. package/dist/src/tools/web-fetch.js +5 -1
  300. package/dist/src/tools/web-fetch.js.map +1 -1
  301. package/dist/src/tools/write-file.js +5 -1
  302. package/dist/src/tools/write-file.js.map +1 -1
  303. package/dist/src/utils/checkpointUtils.js +1 -1
  304. package/dist/src/utils/checkpointUtils.js.map +1 -1
  305. package/dist/src/utils/checkpointUtils.test.js +1 -1
  306. package/dist/src/utils/checkpointUtils.test.js.map +1 -1
  307. package/dist/src/utils/editCorrector.js +1 -1
  308. package/dist/src/utils/editCorrector.js.map +1 -1
  309. package/dist/src/utils/editCorrector.test.js +2 -2
  310. package/dist/src/utils/editCorrector.test.js.map +1 -1
  311. package/dist/src/utils/environmentContext.d.ts +1 -0
  312. package/dist/src/utils/environmentContext.js +4 -0
  313. package/dist/src/utils/environmentContext.js.map +1 -1
  314. package/dist/src/utils/environmentContext.test.js +2 -0
  315. package/dist/src/utils/environmentContext.test.js.map +1 -1
  316. package/dist/src/utils/events.d.ts +3 -18
  317. package/dist/src/utils/events.js +0 -9
  318. package/dist/src/utils/events.js.map +1 -1
  319. package/dist/src/utils/geminiIgnoreParser.d.ts +11 -0
  320. package/dist/src/utils/geminiIgnoreParser.js +20 -0
  321. package/dist/src/utils/geminiIgnoreParser.js.map +1 -1
  322. package/dist/src/utils/geminiIgnoreParser.test.js +48 -0
  323. package/dist/src/utils/geminiIgnoreParser.test.js.map +1 -1
  324. package/dist/src/utils/generateContentResponseUtilities.d.ts +1 -0
  325. package/dist/src/utils/generateContentResponseUtilities.js +10 -0
  326. package/dist/src/utils/generateContentResponseUtilities.js.map +1 -1
  327. package/dist/src/utils/generateContentResponseUtilities.test.js +59 -2
  328. package/dist/src/utils/generateContentResponseUtilities.test.js.map +1 -1
  329. package/dist/src/utils/memoryDiscovery.js +1 -1
  330. package/dist/src/utils/memoryDiscovery.js.map +1 -1
  331. package/dist/src/utils/memoryDiscovery.test.js +3 -1
  332. package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
  333. package/dist/src/utils/shell-utils.js +25 -4
  334. package/dist/src/utils/shell-utils.js.map +1 -1
  335. package/dist/tsconfig.tsbuildinfo +1 -1
  336. package/package.json +1 -6
  337. package/dist/src/agents/executor.js.map +0 -1
  338. package/dist/src/agents/executor.test.js.map +0 -1
  339. package/dist/src/agents/invocation.js.map +0 -1
  340. package/dist/src/agents/invocation.test.js.map +0 -1
  341. /package/dist/src/agents/{executor.test.d.ts → introspection-agent.test.d.ts} +0 -0
  342. /package/dist/src/agents/{invocation.test.d.ts → local-executor.test.d.ts} +0 -0
@@ -0,0 +1,237 @@
1
+ # Themes
2
+
3
+ Gemini CLI supports a variety of themes to customize its color scheme and
4
+ appearance. You can change the theme to suit your preferences via the `/theme`
5
+ command or `"theme":` configuration setting.
6
+
7
+ ## Available themes
8
+
9
+ Gemini CLI comes with a selection of pre-defined themes, which you can list
10
+ using the `/theme` command within Gemini CLI:
11
+
12
+ - **Dark themes:**
13
+ - `ANSI`
14
+ - `Atom One`
15
+ - `Ayu`
16
+ - `Default`
17
+ - `Dracula`
18
+ - `GitHub`
19
+ - **Light themes:**
20
+ - `ANSI Light`
21
+ - `Ayu Light`
22
+ - `Default Light`
23
+ - `GitHub Light`
24
+ - `Google Code`
25
+ - `Xcode`
26
+
27
+ ### Changing themes
28
+
29
+ 1. Enter `/theme` into Gemini CLI.
30
+ 2. A dialog or selection prompt appears, listing the available themes.
31
+ 3. Using the arrow keys, select a theme. Some interfaces might offer a live
32
+ preview or highlight as you select.
33
+ 4. Confirm your selection to apply the theme.
34
+
35
+ **Note:** If a theme is defined in your `settings.json` file (either by name or
36
+ by a file path), you must remove the `"theme"` setting from the file before you
37
+ can change the theme using the `/theme` command.
38
+
39
+ ### Theme persistence
40
+
41
+ Selected themes are saved in Gemini CLI's
42
+ [configuration](../get-started/configuration.md) so your preference is
43
+ remembered across sessions.
44
+
45
+ ---
46
+
47
+ ## Custom color themes
48
+
49
+ Gemini CLI allows you to create your own custom color themes by specifying them
50
+ in your `settings.json` file. This gives you full control over the color palette
51
+ used in the CLI.
52
+
53
+ ### How to define a custom theme
54
+
55
+ Add a `customThemes` block to your user, project, or system `settings.json`
56
+ file. Each custom theme is defined as an object with a unique name and a set of
57
+ color keys. For example:
58
+
59
+ ```json
60
+ {
61
+ "ui": {
62
+ "customThemes": {
63
+ "MyCustomTheme": {
64
+ "name": "MyCustomTheme",
65
+ "type": "custom",
66
+ "Background": "#181818",
67
+ ...
68
+ }
69
+ }
70
+ }
71
+ }
72
+ ```
73
+
74
+ **Color keys:**
75
+
76
+ - `Background`
77
+ - `Foreground`
78
+ - `LightBlue`
79
+ - `AccentBlue`
80
+ - `AccentPurple`
81
+ - `AccentCyan`
82
+ - `AccentGreen`
83
+ - `AccentYellow`
84
+ - `AccentRed`
85
+ - `Comment`
86
+ - `Gray`
87
+ - `DiffAdded` (optional, for added lines in diffs)
88
+ - `DiffRemoved` (optional, for removed lines in diffs)
89
+ - `DiffModified` (optional, for modified lines in diffs)
90
+
91
+ You can also override individual UI text roles by adding a nested `text` object.
92
+ This object supports the keys `primary`, `secondary`, `link`, `accent`, and
93
+ `response`. When `text.response` is provided it takes precedence over
94
+ `text.primary` for rendering model responses in chat.
95
+
96
+ **Required properties:**
97
+
98
+ - `name` (must match the key in the `customThemes` object and be a string)
99
+ - `type` (must be the string `"custom"`)
100
+ - `Background`
101
+ - `Foreground`
102
+ - `LightBlue`
103
+ - `AccentBlue`
104
+ - `AccentPurple`
105
+ - `AccentCyan`
106
+ - `AccentGreen`
107
+ - `AccentYellow`
108
+ - `AccentRed`
109
+ - `Comment`
110
+ - `Gray`
111
+
112
+ You can use either hex codes (e.g., `#FF0000`) **or** standard CSS color names
113
+ (e.g., `coral`, `teal`, `blue`) for any color value. See
114
+ [CSS color names](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#color_keywords)
115
+ for a full list of supported names.
116
+
117
+ You can define multiple custom themes by adding more entries to the
118
+ `customThemes` object.
119
+
120
+ ### Loading themes from a file
121
+
122
+ In addition to defining custom themes in `settings.json`, you can also load a
123
+ theme directly from a JSON file by specifying the file path in your
124
+ `settings.json`. This is useful for sharing themes or keeping them separate from
125
+ your main configuration.
126
+
127
+ To load a theme from a file, set the `theme` property in your `settings.json` to
128
+ the path of your theme file:
129
+
130
+ ```json
131
+ {
132
+ "ui": {
133
+ "theme": "/path/to/your/theme.json"
134
+ }
135
+ }
136
+ ```
137
+
138
+ The theme file must be a valid JSON file that follows the same structure as a
139
+ custom theme defined in `settings.json`.
140
+
141
+ **Example `my-theme.json`:**
142
+
143
+ ```json
144
+ {
145
+ "name": "My File Theme",
146
+ "type": "custom",
147
+ "Background": "#282A36",
148
+ "Foreground": "#F8F8F2",
149
+ "LightBlue": "#82AAFF",
150
+ "AccentBlue": "#61AFEF",
151
+ "AccentPurple": "#BD93F9",
152
+ "AccentCyan": "#8BE9FD",
153
+ "AccentGreen": "#50FA7B",
154
+ "AccentYellow": "#F1FA8C",
155
+ "AccentRed": "#FF5555",
156
+ "Comment": "#6272A4",
157
+ "Gray": "#ABB2BF",
158
+ "DiffAdded": "#A6E3A1",
159
+ "DiffRemoved": "#F38BA8",
160
+ "DiffModified": "#89B4FA",
161
+ "GradientColors": ["#4796E4", "#847ACE", "#C3677F"]
162
+ }
163
+ ```
164
+
165
+ **Security note:** For your safety, Gemini CLI will only load theme files that
166
+ are located within your home directory. If you attempt to load a theme from
167
+ outside your home directory, a warning will be displayed and the theme will not
168
+ be loaded. This is to prevent loading potentially malicious theme files from
169
+ untrusted sources.
170
+
171
+ ### Example custom theme
172
+
173
+ <img src="../assets/theme-custom.png" alt="Custom theme example" width="600" />
174
+
175
+ ### Using your custom theme
176
+
177
+ - Select your custom theme using the `/theme` command in Gemini CLI. Your custom
178
+ theme will appear in the theme selection dialog.
179
+ - Or, set it as the default by adding `"theme": "MyCustomTheme"` to the `ui`
180
+ object in your `settings.json`.
181
+ - Custom themes can be set at the user, project, or system level, and follow the
182
+ same [configuration precedence](../get-started/configuration.md) as other
183
+ settings.
184
+
185
+ ---
186
+
187
+ ## Dark themes
188
+
189
+ ### ANSI
190
+
191
+ <img src="/assets/theme-ansi.png" alt="ANSI theme" width="600" />
192
+
193
+ ### Atom OneDark
194
+
195
+ <img src="/assets/theme-atom-one.png" alt="Atom One theme" width="600">
196
+
197
+ ### Ayu
198
+
199
+ <img src="/assets/theme-ayu.png" alt="Ayu theme" width="600">
200
+
201
+ ### Default
202
+
203
+ <img src="/assets/theme-default.png" alt="Default theme" width="600">
204
+
205
+ ### Dracula
206
+
207
+ <img src="/assets/theme-dracula.png" alt="Dracula theme" width="600">
208
+
209
+ ### GitHub
210
+
211
+ <img src="/assets/theme-github.png" alt="GitHub theme" width="600">
212
+
213
+ ## Light themes
214
+
215
+ ### ANSI Light
216
+
217
+ <img src="/assets/theme-ansi-light.png" alt="ANSI Light theme" width="600">
218
+
219
+ ### Ayu Light
220
+
221
+ <img src="/assets/theme-ayu-light.png" alt="Ayu Light theme" width="600">
222
+
223
+ ### Default Light
224
+
225
+ <img src="/assets/theme-default-light.png" alt="Default Light theme" width="600">
226
+
227
+ ### GitHub Light
228
+
229
+ <img src="/assets/theme-github-light.png" alt="GitHub Light theme" width="600">
230
+
231
+ ### Google Code
232
+
233
+ <img src="/assets/theme-google-light.png" alt="Google Code theme" width="600">
234
+
235
+ ### Xcode
236
+
237
+ <img src="/assets/theme-xcode-light.png" alt="Xcode Light theme" width="600">
@@ -0,0 +1,20 @@
1
+ # Token caching and cost optimization
2
+
3
+ Gemini CLI automatically optimizes API costs through token caching when using
4
+ API key authentication (Gemini API key or Vertex AI). This feature reuses
5
+ previous system instructions and context to reduce the number of tokens
6
+ processed in subsequent requests.
7
+
8
+ **Token caching is available for:**
9
+
10
+ - API key users (Gemini API key)
11
+ - Vertex AI users (with project and location setup)
12
+
13
+ **Token caching is not available for:**
14
+
15
+ - OAuth users (Google Personal/Enterprise accounts) - the Code Assist API does
16
+ not support cached content creation at this time
17
+
18
+ You can view your token usage and cached token savings using the `/stats`
19
+ command. When cached tokens are available, they will be displayed in the stats
20
+ output.
@@ -0,0 +1,95 @@
1
+ # Trusted Folders
2
+
3
+ The Trusted Folders feature is a security setting that gives you control over
4
+ which projects can use the full capabilities of the Gemini CLI. It prevents
5
+ potentially malicious code from running by asking you to approve a folder before
6
+ the CLI loads any project-specific configurations from it.
7
+
8
+ ## Enabling the feature
9
+
10
+ The Trusted Folders feature is **disabled by default**. To use it, you must
11
+ first enable it in your settings.
12
+
13
+ Add the following to your user `settings.json` file:
14
+
15
+ ```json
16
+ {
17
+ "security": {
18
+ "folderTrust": {
19
+ "enabled": true
20
+ }
21
+ }
22
+ }
23
+ ```
24
+
25
+ ## How it works: The trust dialog
26
+
27
+ Once the feature is enabled, the first time you run the Gemini CLI from a
28
+ folder, a dialog will automatically appear, prompting you to make a choice:
29
+
30
+ - **Trust folder**: Grants full trust to the current folder (e.g.,
31
+ `my-project`).
32
+ - **Trust parent folder**: Grants trust to the parent directory (e.g.,
33
+ `safe-projects`), which automatically trusts all of its subdirectories as
34
+ well. This is useful if you keep all your safe projects in one place.
35
+ - **Don't trust**: Marks the folder as untrusted. The CLI will operate in a
36
+ restricted "safe mode."
37
+
38
+ Your choice is saved in a central file (`~/.gemini/trustedFolders.json`), so you
39
+ will only be asked once per folder.
40
+
41
+ ## Why trust matters: The impact of an untrusted workspace
42
+
43
+ When a folder is **untrusted**, the Gemini CLI runs in a restricted "safe mode"
44
+ to protect you. In this mode, the following features are disabled:
45
+
46
+ 1. **Workspace settings are ignored**: The CLI will **not** load the
47
+ `.gemini/settings.json` file from the project. This prevents the loading of
48
+ custom tools and other potentially dangerous configurations.
49
+
50
+ 2. **Environment variables are ignored**: The CLI will **not** load any `.env`
51
+ files from the project.
52
+
53
+ 3. **Extension management is restricted**: You **cannot install, update, or
54
+ uninstall** extensions.
55
+
56
+ 4. **Tool auto-acceptance is disabled**: You will always be prompted before any
57
+ tool is run, even if you have auto-acceptance enabled globally.
58
+
59
+ 5. **Automatic memory loading is disabled**: The CLI will not automatically
60
+ load files into context from directories specified in local settings.
61
+
62
+ 6. **MCP servers do not connect**: The CLI will not attempt to connect to any
63
+ [Model Context Protocol (MCP)](../tools/mcp-server.md) servers.
64
+
65
+ 7. **Custom commands are not loaded**: The CLI will not load any custom
66
+ commands from .toml files, including both project-specific and global user
67
+ commands.
68
+
69
+ Granting trust to a folder unlocks the full functionality of the Gemini CLI for
70
+ that workspace.
71
+
72
+ ## Managing your trust settings
73
+
74
+ If you need to change a decision or see all your settings, you have a couple of
75
+ options:
76
+
77
+ - **Change the current folder's trust**: Run the `/permissions` command from
78
+ within the CLI. This will bring up the same interactive dialog, allowing you
79
+ to change the trust level for the current folder.
80
+
81
+ - **View all trust rules**: To see a complete list of all your trusted and
82
+ untrusted folder rules, you can inspect the contents of the
83
+ `~/.gemini/trustedFolders.json` file in your home directory.
84
+
85
+ ## The trust check process (advanced)
86
+
87
+ For advanced users, it's helpful to know the exact order of operations for how
88
+ trust is determined:
89
+
90
+ 1. **IDE trust signal**: If you are using the
91
+ [IDE Integration](../ide-integration/index.md), the CLI first asks the IDE
92
+ if the workspace is trusted. The IDE's response takes highest priority.
93
+
94
+ 2. **Local trust file**: If the IDE is not connected, the CLI checks the
95
+ central `~/.gemini/trustedFolders.json` file.
@@ -0,0 +1,83 @@
1
+ # Tutorials
2
+
3
+ This page contains tutorials for interacting with Gemini CLI.
4
+
5
+ ## Setting up a Model Context Protocol (MCP) server
6
+
7
+ > [!CAUTION] Before using a third-party MCP server, ensure you trust its source
8
+ > and understand the tools it provides. Your use of third-party servers is at
9
+ > your own risk.
10
+
11
+ This tutorial demonstrates how to set up an MCP server, using the
12
+ [GitHub MCP server](https://github.com/github/github-mcp-server) as an example.
13
+ The GitHub MCP server provides tools for interacting with GitHub repositories,
14
+ such as creating issues and commenting on pull requests.
15
+
16
+ ### Prerequisites
17
+
18
+ Before you begin, ensure you have the following installed and configured:
19
+
20
+ - **Docker:** Install and run [Docker].
21
+ - **GitHub Personal Access Token (PAT):** Create a new [classic] or
22
+ [fine-grained] PAT with the necessary scopes.
23
+
24
+ [Docker]: https://www.docker.com/
25
+ [classic]: https://github.com/settings/tokens/new
26
+ [fine-grained]: https://github.com/settings/personal-access-tokens/new
27
+
28
+ ### Guide
29
+
30
+ #### Configure the MCP server in `settings.json`
31
+
32
+ In your project's root directory, create or open the
33
+ [`.gemini/settings.json` file](../get-started/configuration.md). Within the
34
+ file, add the `mcpServers` configuration block, which provides instructions for
35
+ how to launch the GitHub MCP server.
36
+
37
+ ```json
38
+ {
39
+ "mcpServers": {
40
+ "github": {
41
+ "command": "docker",
42
+ "args": [
43
+ "run",
44
+ "-i",
45
+ "--rm",
46
+ "-e",
47
+ "GITHUB_PERSONAL_ACCESS_TOKEN",
48
+ "ghcr.io/github/github-mcp-server"
49
+ ],
50
+ "env": {
51
+ "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}"
52
+ }
53
+ }
54
+ }
55
+ }
56
+ ```
57
+
58
+ #### Set your GitHub token
59
+
60
+ > [!CAUTION] Using a broadly scoped personal access token that has access to
61
+ > personal and private repositories can lead to information from the private
62
+ > repository being leaked into the public repository. We recommend using a
63
+ > fine-grained access token that doesn't share access to both public and private
64
+ > repositories.
65
+
66
+ Use an environment variable to store your GitHub PAT:
67
+
68
+ ```bash
69
+ GITHUB_PERSONAL_ACCESS_TOKEN="pat_YourActualGitHubTokenHere"
70
+ ```
71
+
72
+ Gemini CLI uses this value in the `mcpServers` configuration that you defined in
73
+ the `settings.json` file.
74
+
75
+ #### Launch Gemini CLI and verify the connection
76
+
77
+ When you launch Gemini CLI, it automatically reads your configuration and
78
+ launches the GitHub MCP server in the background. You can then use natural
79
+ language prompts to ask Gemini CLI to perform GitHub actions. For example:
80
+
81
+ ```bash
82
+ "get all open issues assigned to me in the 'foo/bar' repo and prioritize them"
83
+ ```
@@ -0,0 +1,47 @@
1
+ # Uninstalling the CLI
2
+
3
+ Your uninstall method depends on how you ran the CLI. Follow the instructions
4
+ for either npx or a global npm installation.
5
+
6
+ ## Method 1: Using npx
7
+
8
+ npx runs packages from a temporary cache without a permanent installation. To
9
+ "uninstall" the CLI, you must clear this cache, which will remove gemini-cli and
10
+ any other packages previously executed with npx.
11
+
12
+ The npx cache is a directory named `_npx` inside your main npm cache folder. You
13
+ can find your npm cache path by running `npm config get cache`.
14
+
15
+ **For macOS / Linux**
16
+
17
+ ```bash
18
+ # The path is typically ~/.npm/_npx
19
+ rm -rf "$(npm config get cache)/_npx"
20
+ ```
21
+
22
+ **For Windows**
23
+
24
+ _Command Prompt_
25
+
26
+ ```cmd
27
+ :: The path is typically %LocalAppData%\npm-cache\_npx
28
+ rmdir /s /q "%LocalAppData%\npm-cache\_npx"
29
+ ```
30
+
31
+ _PowerShell_
32
+
33
+ ```powershell
34
+ # The path is typically $env:LocalAppData\npm-cache\_npx
35
+ Remove-Item -Path (Join-Path $env:LocalAppData "npm-cache\_npx") -Recurse -Force
36
+ ```
37
+
38
+ ## Method 2: Using npm (global install)
39
+
40
+ If you installed the CLI globally (e.g., `npm install -g @google/gemini-cli`),
41
+ use the `npm uninstall` command with the `-g` flag to remove it.
42
+
43
+ ```bash
44
+ npm uninstall -g @google/gemini-cli
45
+ ```
46
+
47
+ This command completely removes the package from your system.
@@ -0,0 +1,101 @@
1
+ # Gemini CLI core
2
+
3
+ Gemini CLI's core package (`packages/core`) is the backend portion of Gemini
4
+ CLI, handling communication with the Gemini API, managing tools, and processing
5
+ requests sent from `packages/cli`. For a general overview of Gemini CLI, see the
6
+ [main documentation page](../index.md).
7
+
8
+ ## Navigating this section
9
+
10
+ - **[Core tools API](./tools-api.md):** Information on how tools are defined,
11
+ registered, and used by the core.
12
+ - **[Memory Import Processor](./memport.md):** Documentation for the modular
13
+ GEMINI.md import feature using @file.md syntax.
14
+ - **[Policy Engine](./policy-engine.md):** Use the Policy Engine for
15
+ fine-grained control over tool execution.
16
+
17
+ ## Role of the core
18
+
19
+ While the `packages/cli` portion of Gemini CLI provides the user interface,
20
+ `packages/core` is responsible for:
21
+
22
+ - **Gemini API interaction:** Securely communicating with the Google Gemini API,
23
+ sending user prompts, and receiving model responses.
24
+ - **Prompt engineering:** Constructing effective prompts for the Gemini model,
25
+ potentially incorporating conversation history, tool definitions, and
26
+ instructional context from `GEMINI.md` files.
27
+ - **Tool management & orchestration:**
28
+ - Registering available tools (e.g., file system tools, shell command
29
+ execution).
30
+ - Interpreting tool use requests from the Gemini model.
31
+ - Executing the requested tools with the provided arguments.
32
+ - Returning tool execution results to the Gemini model for further processing.
33
+ - **Session and state management:** Keeping track of the conversation state,
34
+ including history and any relevant context required for coherent interactions.
35
+ - **Configuration:** Managing core-specific configurations, such as API key
36
+ access, model selection, and tool settings.
37
+
38
+ ## Security considerations
39
+
40
+ The core plays a vital role in security:
41
+
42
+ - **API key management:** It handles the `GEMINI_API_KEY` and ensures it's used
43
+ securely when communicating with the Gemini API.
44
+ - **Tool execution:** When tools interact with the local system (e.g.,
45
+ `run_shell_command`), the core (and its underlying tool implementations) must
46
+ do so with appropriate caution, often involving sandboxing mechanisms to
47
+ prevent unintended modifications.
48
+
49
+ ## Chat history compression
50
+
51
+ To ensure that long conversations don't exceed the token limits of the Gemini
52
+ model, the core includes a chat history compression feature.
53
+
54
+ When a conversation approaches the token limit for the configured model, the
55
+ core automatically compresses the conversation history before sending it to the
56
+ model. This compression is designed to be lossless in terms of the information
57
+ conveyed, but it reduces the overall number of tokens used.
58
+
59
+ You can find the token limits for each model in the
60
+ [Google AI documentation](https://ai.google.dev/gemini-api/docs/models).
61
+
62
+ ## Model fallback
63
+
64
+ Gemini CLI includes a model fallback mechanism to ensure that you can continue
65
+ to use the CLI even if the default "pro" model is rate-limited.
66
+
67
+ If you are using the default "pro" model and the CLI detects that you are being
68
+ rate-limited, it automatically switches to the "flash" model for the current
69
+ session. This allows you to continue working without interruption.
70
+
71
+ ## File discovery service
72
+
73
+ The file discovery service is responsible for finding files in the project that
74
+ are relevant to the current context. It is used by the `@` command and other
75
+ tools that need to access files.
76
+
77
+ ## Memory discovery service
78
+
79
+ The memory discovery service is responsible for finding and loading the
80
+ `GEMINI.md` files that provide context to the model. It searches for these files
81
+ in a hierarchical manner, starting from the current working directory and moving
82
+ up to the project root and the user's home directory. It also searches in
83
+ subdirectories.
84
+
85
+ This allows you to have global, project-level, and component-level context
86
+ files, which are all combined to provide the model with the most relevant
87
+ information.
88
+
89
+ You can use the [`/memory` command](../cli/commands.md) to `show`, `add`, and
90
+ `refresh` the content of loaded `GEMINI.md` files.
91
+
92
+ ## Citations
93
+
94
+ When Gemini finds it is reciting text from a source it appends the citation to
95
+ the output. It is enabled by default but can be disabled with the
96
+ ui.showCitations setting.
97
+
98
+ - When proposing an edit the citations display before giving the user the option
99
+ to accept.
100
+ - Citations are always shown at the end of the model’s turn.
101
+ - We deduplicate citations and display them in alphabetical order.