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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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/hooks/hookEventHandler.js +10 -4
  208. package/dist/src/hooks/hookEventHandler.js.map +1 -1
  209. package/dist/src/hooks/hookEventHandler.test.js +47 -0
  210. package/dist/src/hooks/hookEventHandler.test.js.map +1 -1
  211. package/dist/src/hooks/hookPlanner.js +3 -1
  212. package/dist/src/hooks/hookPlanner.js.map +1 -1
  213. package/dist/src/hooks/hookPlanner.test.js +61 -0
  214. package/dist/src/hooks/hookPlanner.test.js.map +1 -1
  215. package/dist/src/hooks/hookRegistry.d.ts +1 -1
  216. package/dist/src/hooks/hookRegistry.js +2 -2
  217. package/dist/src/hooks/hookRegistry.js.map +1 -1
  218. package/dist/src/hooks/hookRegistry.test.js +73 -0
  219. package/dist/src/hooks/hookRegistry.test.js.map +1 -1
  220. package/dist/src/hooks/hookRunner.js +14 -10
  221. package/dist/src/hooks/hookRunner.js.map +1 -1
  222. package/dist/src/hooks/hookRunner.test.js +81 -33
  223. package/dist/src/hooks/hookRunner.test.js.map +1 -1
  224. package/dist/src/hooks/types.d.ts +2 -0
  225. package/dist/src/hooks/types.js.map +1 -1
  226. package/dist/src/index.d.ts +2 -0
  227. package/dist/src/index.js +2 -0
  228. package/dist/src/index.js.map +1 -1
  229. package/dist/src/mcp/oauth-provider.js +6 -2
  230. package/dist/src/mcp/oauth-provider.js.map +1 -1
  231. package/dist/src/mcp/oauth-provider.test.js +4 -1
  232. package/dist/src/mcp/oauth-provider.test.js.map +1 -1
  233. package/dist/src/mcp/oauth-utils.d.ts +8 -1
  234. package/dist/src/mcp/oauth-utils.js +30 -1
  235. package/dist/src/mcp/oauth-utils.js.map +1 -1
  236. package/dist/src/mcp/oauth-utils.test.js +42 -0
  237. package/dist/src/mcp/oauth-utils.test.js.map +1 -1
  238. package/dist/src/routing/strategies/fallbackStrategy.js +0 -3
  239. package/dist/src/routing/strategies/fallbackStrategy.js.map +1 -1
  240. package/dist/src/routing/strategies/fallbackStrategy.test.js +0 -6
  241. package/dist/src/routing/strategies/fallbackStrategy.test.js.map +1 -1
  242. package/dist/src/services/contextManager.d.ts +5 -11
  243. package/dist/src/services/contextManager.js +20 -17
  244. package/dist/src/services/contextManager.js.map +1 -1
  245. package/dist/src/services/contextManager.test.js +40 -41
  246. package/dist/src/services/contextManager.test.js.map +1 -1
  247. package/dist/src/services/loopDetectionService.js +2 -1
  248. package/dist/src/services/loopDetectionService.js.map +1 -1
  249. package/dist/src/services/loopDetectionService.test.js +14 -8
  250. package/dist/src/services/loopDetectionService.test.js.map +1 -1
  251. package/dist/src/services/modelConfig.integration.test.js +1 -1
  252. package/dist/src/services/modelConfig.integration.test.js.map +1 -1
  253. package/dist/src/services/shellExecutionService.js +18 -2
  254. package/dist/src/services/shellExecutionService.js.map +1 -1
  255. package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +4 -2
  256. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +25 -0
  257. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
  258. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +32 -1
  259. package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -1
  260. package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +5 -1
  261. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +12 -1
  262. package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
  263. package/dist/src/telemetry/loggers.js +1 -0
  264. package/dist/src/telemetry/loggers.js.map +1 -1
  265. package/dist/src/telemetry/loggers.test.js +37 -2
  266. package/dist/src/telemetry/loggers.test.js.map +1 -1
  267. package/dist/src/telemetry/sdk.js +2 -2
  268. package/dist/src/telemetry/sdk.js.map +1 -1
  269. package/dist/src/tools/confirmation-policy.test.d.ts +6 -0
  270. package/dist/src/tools/confirmation-policy.test.js +152 -0
  271. package/dist/src/tools/confirmation-policy.test.js.map +1 -0
  272. package/dist/src/tools/edit.js +5 -1
  273. package/dist/src/tools/edit.js.map +1 -1
  274. package/dist/src/tools/get-internal-docs.d.ts +27 -0
  275. package/dist/src/tools/get-internal-docs.js +129 -0
  276. package/dist/src/tools/get-internal-docs.js.map +1 -0
  277. package/dist/src/tools/get-internal-docs.test.d.ts +6 -0
  278. package/dist/src/tools/get-internal-docs.test.js +56 -0
  279. package/dist/src/tools/get-internal-docs.test.js.map +1 -0
  280. package/dist/src/tools/ripGrep.d.ts +1 -0
  281. package/dist/src/tools/ripGrep.js +16 -4
  282. package/dist/src/tools/ripGrep.js.map +1 -1
  283. package/dist/src/tools/ripGrep.test.js +55 -0
  284. package/dist/src/tools/ripGrep.test.js.map +1 -1
  285. package/dist/src/tools/smart-edit.js +5 -1
  286. package/dist/src/tools/smart-edit.js.map +1 -1
  287. package/dist/src/tools/tool-names.d.ts +14 -0
  288. package/dist/src/tools/tool-names.js +55 -0
  289. package/dist/src/tools/tool-names.js.map +1 -1
  290. package/dist/src/tools/tool-names.test.d.ts +6 -0
  291. package/dist/src/tools/tool-names.test.js +43 -0
  292. package/dist/src/tools/tool-names.test.js.map +1 -0
  293. package/dist/src/tools/tool-registry.d.ts +0 -1
  294. package/dist/src/tools/tool-registry.js +1 -1
  295. package/dist/src/tools/tool-registry.js.map +1 -1
  296. package/dist/src/tools/tool-registry.test.js +2 -1
  297. package/dist/src/tools/tool-registry.test.js.map +1 -1
  298. package/dist/src/tools/web-fetch.js +5 -1
  299. package/dist/src/tools/web-fetch.js.map +1 -1
  300. package/dist/src/tools/write-file.js +5 -1
  301. package/dist/src/tools/write-file.js.map +1 -1
  302. package/dist/src/utils/checkpointUtils.js +1 -1
  303. package/dist/src/utils/checkpointUtils.js.map +1 -1
  304. package/dist/src/utils/checkpointUtils.test.js +1 -1
  305. package/dist/src/utils/checkpointUtils.test.js.map +1 -1
  306. package/dist/src/utils/editCorrector.js +1 -1
  307. package/dist/src/utils/editCorrector.js.map +1 -1
  308. package/dist/src/utils/editCorrector.test.js +2 -2
  309. package/dist/src/utils/editCorrector.test.js.map +1 -1
  310. package/dist/src/utils/environmentContext.d.ts +1 -0
  311. package/dist/src/utils/environmentContext.js +4 -0
  312. package/dist/src/utils/environmentContext.js.map +1 -1
  313. package/dist/src/utils/environmentContext.test.js +2 -0
  314. package/dist/src/utils/environmentContext.test.js.map +1 -1
  315. package/dist/src/utils/events.d.ts +3 -18
  316. package/dist/src/utils/events.js +0 -9
  317. package/dist/src/utils/events.js.map +1 -1
  318. package/dist/src/utils/geminiIgnoreParser.d.ts +11 -0
  319. package/dist/src/utils/geminiIgnoreParser.js +20 -0
  320. package/dist/src/utils/geminiIgnoreParser.js.map +1 -1
  321. package/dist/src/utils/geminiIgnoreParser.test.js +48 -0
  322. package/dist/src/utils/geminiIgnoreParser.test.js.map +1 -1
  323. package/dist/src/utils/generateContentResponseUtilities.d.ts +1 -0
  324. package/dist/src/utils/generateContentResponseUtilities.js +10 -0
  325. package/dist/src/utils/generateContentResponseUtilities.js.map +1 -1
  326. package/dist/src/utils/generateContentResponseUtilities.test.js +59 -2
  327. package/dist/src/utils/generateContentResponseUtilities.test.js.map +1 -1
  328. package/dist/src/utils/memoryDiscovery.js +1 -1
  329. package/dist/src/utils/memoryDiscovery.js.map +1 -1
  330. package/dist/src/utils/memoryDiscovery.test.js +3 -1
  331. package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
  332. package/dist/src/utils/shell-utils.js +25 -4
  333. package/dist/src/utils/shell-utils.js.map +1 -1
  334. package/dist/tsconfig.tsbuildinfo +1 -1
  335. package/package.json +1 -6
  336. package/dist/google-gemini-cli-core-0.22.0-preview.2.tgz +0 -0
  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,3 @@
1
+ # Authentication setup
2
+
3
+ See: [Getting Started - Authentication Setup](../get-started/authentication.md).
@@ -0,0 +1,94 @@
1
+ # Checkpointing
2
+
3
+ The Gemini CLI includes a Checkpointing feature that automatically saves a
4
+ snapshot of your project's state before any file modifications are made by
5
+ AI-powered tools. This allows you to safely experiment with and apply code
6
+ changes, knowing you can instantly revert back to the state before the tool was
7
+ run.
8
+
9
+ ## How it works
10
+
11
+ When you approve a tool that modifies the file system (like `write_file` or
12
+ `replace`), the CLI automatically creates a "checkpoint." This checkpoint
13
+ includes:
14
+
15
+ 1. **A Git snapshot:** A commit is made in a special, shadow Git repository
16
+ located in your home directory (`~/.gemini/history/<project_hash>`). This
17
+ snapshot captures the complete state of your project files at that moment.
18
+ It does **not** interfere with your own project's Git repository.
19
+ 2. **Conversation history:** The entire conversation you've had with the agent
20
+ up to that point is saved.
21
+ 3. **The tool call:** The specific tool call that was about to be executed is
22
+ also stored.
23
+
24
+ If you want to undo the change or simply go back, you can use the `/restore`
25
+ command. Restoring a checkpoint will:
26
+
27
+ - Revert all files in your project to the state captured in the snapshot.
28
+ - Restore the conversation history in the CLI.
29
+ - Re-propose the original tool call, allowing you to run it again, modify it, or
30
+ simply ignore it.
31
+
32
+ All checkpoint data, including the Git snapshot and conversation history, is
33
+ stored locally on your machine. The Git snapshot is stored in the shadow
34
+ repository while the conversation history and tool calls are saved in a JSON
35
+ file in your project's temporary directory, typically located at
36
+ `~/.gemini/tmp/<project_hash>/checkpoints`.
37
+
38
+ ## Enabling the feature
39
+
40
+ The Checkpointing feature is disabled by default. To enable it, you need to edit
41
+ your `settings.json` file.
42
+
43
+ > **Note:** The `--checkpointing` command-line flag was removed in version
44
+ > 0.11.0. Checkpointing can now only be enabled through the `settings.json`
45
+ > configuration file.
46
+
47
+ Add the following key to your `settings.json`:
48
+
49
+ ```json
50
+ {
51
+ "general": {
52
+ "checkpointing": {
53
+ "enabled": true
54
+ }
55
+ }
56
+ }
57
+ ```
58
+
59
+ ## Using the `/restore` command
60
+
61
+ Once enabled, checkpoints are created automatically. To manage them, you use the
62
+ `/restore` command.
63
+
64
+ ### List available checkpoints
65
+
66
+ To see a list of all saved checkpoints for the current project, simply run:
67
+
68
+ ```
69
+ /restore
70
+ ```
71
+
72
+ The CLI will display a list of available checkpoint files. These file names are
73
+ typically composed of a timestamp, the name of the file being modified, and the
74
+ name of the tool that was about to be run (e.g.,
75
+ `2025-06-22T10-00-00_000Z-my-file.txt-write_file`).
76
+
77
+ ### Restore a specific checkpoint
78
+
79
+ To restore your project to a specific checkpoint, use the checkpoint file from
80
+ the list:
81
+
82
+ ```
83
+ /restore <checkpoint_file>
84
+ ```
85
+
86
+ For example:
87
+
88
+ ```
89
+ /restore 2025-06-22T10-00-00_000Z-my-file.txt-write_file
90
+ ```
91
+
92
+ After running the command, your files and conversation will be immediately
93
+ restored to the state they were in when the checkpoint was created, and the
94
+ original tool prompt will reappear.
@@ -0,0 +1,354 @@
1
+ # CLI commands
2
+
3
+ Gemini CLI supports several built-in commands to help you manage your session,
4
+ customize the interface, and control its behavior. These commands are prefixed
5
+ with a forward slash (`/`), an at symbol (`@`), or an exclamation mark (`!`).
6
+
7
+ ## Slash commands (`/`)
8
+
9
+ Slash commands provide meta-level control over the CLI itself.
10
+
11
+ ### Built-in Commands
12
+
13
+ - **`/bug`**
14
+ - **Description:** File an issue about Gemini CLI. By default, the issue is
15
+ filed within the GitHub repository for Gemini CLI. The string you enter
16
+ after `/bug` will become the headline for the bug being filed. The default
17
+ `/bug` behavior can be modified using the `advanced.bugCommand` setting in
18
+ your `.gemini/settings.json` files.
19
+
20
+ - **`/chat`**
21
+ - **Description:** Save and resume conversation history for branching
22
+ conversation state interactively, or resuming a previous state from a later
23
+ session.
24
+ - **Sub-commands:**
25
+ - **`save`**
26
+ - **Description:** Saves the current conversation history. You must add a
27
+ `<tag>` for identifying the conversation state.
28
+ - **Usage:** `/chat save <tag>`
29
+ - **Details on checkpoint location:** The default locations for saved chat
30
+ checkpoints are:
31
+ - Linux/macOS: `~/.gemini/tmp/<project_hash>/`
32
+ - Windows: `C:\Users\<YourUsername>\.gemini\tmp\<project_hash>\`
33
+ - **Behavior:** Chats are saved into a project-specific directory,
34
+ determined by where you run the CLI. Consequently, saved chats are
35
+ only accessible when working within that same project.
36
+ - **Note:** These checkpoints are for manually saving and resuming
37
+ conversation states. For automatic checkpoints created before file
38
+ modifications, see the
39
+ [Checkpointing documentation](../cli/checkpointing.md).
40
+ - **`resume`**
41
+ - **Description:** Resumes a conversation from a previous save.
42
+ - **Usage:** `/chat resume <tag>`
43
+ - **Note:** You can only resume chats that were saved within the current
44
+ project. To resume a chat from a different project, you must run the
45
+ Gemini CLI from that project's directory.
46
+ - **`list`**
47
+ - **Description:** Lists available tags for chat state resumption.
48
+ - **Note:** This command only lists chats saved within the current
49
+ project. Because chat history is project-scoped, chats saved in other
50
+ project directories will not be displayed.
51
+ - **`delete`**
52
+ - **Description:** Deletes a saved conversation checkpoint.
53
+ - **Usage:** `/chat delete <tag>`
54
+ - **`share`**
55
+ - **Description** Writes the current conversation to a provided Markdown
56
+ or JSON file.
57
+ - **Usage** `/chat share file.md` or `/chat share file.json`. If no
58
+ filename is provided, then the CLI will generate one.
59
+
60
+ - **`/clear`**
61
+ - **Description:** Clear the terminal screen, including the visible session
62
+ history and scrollback within the CLI. The underlying session data (for
63
+ history recall) might be preserved depending on the exact implementation,
64
+ but the visual display is cleared.
65
+ - **Keyboard shortcut:** Press **Ctrl+L** at any time to perform a clear
66
+ action.
67
+
68
+ - **`/compress`**
69
+ - **Description:** Replace the entire chat context with a summary. This saves
70
+ on tokens used for future tasks while retaining a high level summary of what
71
+ has happened.
72
+
73
+ - **`/copy`**
74
+ - **Description:** Copies the last output produced by Gemini CLI to your
75
+ clipboard, for easy sharing or reuse.
76
+ - **Note:** This command requires platform-specific clipboard tools to be
77
+ installed.
78
+ - On Linux, it requires `xclip` or `xsel`. You can typically install them
79
+ using your system's package manager.
80
+ - On macOS, it requires `pbcopy`, and on Windows, it requires `clip`. These
81
+ tools are typically pre-installed on their respective systems.
82
+
83
+ - **`/directory`** (or **`/dir`**)
84
+ - **Description:** Manage workspace directories for multi-directory support.
85
+ - **Sub-commands:**
86
+ - **`add`**:
87
+ - **Description:** Add a directory to the workspace. The path can be
88
+ absolute or relative to the current working directory. Moreover, the
89
+ reference from home directory is supported as well.
90
+ - **Usage:** `/directory add <path1>,<path2>`
91
+ - **Note:** Disabled in restrictive sandbox profiles. If you're using
92
+ that, use `--include-directories` when starting the session instead.
93
+ - **`show`**:
94
+ - **Description:** Display all directories added by `/directory add` and
95
+ `--include-directories`.
96
+ - **Usage:** `/directory show`
97
+
98
+ - **`/editor`**
99
+ - **Description:** Open a dialog for selecting supported editors.
100
+
101
+ - **`/extensions`**
102
+ - **Description:** Lists all active extensions in the current Gemini CLI
103
+ session. See [Gemini CLI Extensions](../extensions/index.md).
104
+
105
+ - **`/help`** (or **`/?`**)
106
+ - **Description:** Display help information about Gemini CLI, including
107
+ available commands and their usage.
108
+
109
+ - **`/mcp`**
110
+ - **Description:** Manage configured Model Context Protocol (MCP) servers.
111
+ - **Sub-commands:**
112
+ - **`list`** or **`ls`**:
113
+ - **Description:** List configured MCP servers and tools. This is the
114
+ default action if no subcommand is specified.
115
+ - **`desc`**
116
+ - **Description:** List configured MCP servers and tools with
117
+ descriptions.
118
+ - **`schema`**:
119
+ - **Description:** List configured MCP servers and tools with descriptions
120
+ and schemas.
121
+ - **`auth`**:
122
+ - **Description:** Authenticate with an OAuth-enabled MCP server.
123
+ - **Usage:** `/mcp auth <server-name>`
124
+ - **Details:** If `<server-name>` is provided, it initiates the OAuth flow
125
+ for that server. If no server name is provided, it lists all configured
126
+ servers that support OAuth authentication.
127
+ - **`refresh`**:
128
+ - **Description:** Restarts all MCP servers and re-discovers their
129
+ available tools.
130
+
131
+ - [**`/model`**](./model.md)
132
+ - **Description:** Opens a dialog to choose your Gemini model.
133
+
134
+ - **`/memory`**
135
+ - **Description:** Manage the AI's instructional context (hierarchical memory
136
+ loaded from `GEMINI.md` files).
137
+ - **Sub-commands:**
138
+ - **`add`**:
139
+ - **Description:** Adds the following text to the AI's memory. Usage:
140
+ `/memory add <text to remember>`
141
+ - **`show`**:
142
+ - **Description:** Display the full, concatenated content of the current
143
+ hierarchical memory that has been loaded from all `GEMINI.md` files.
144
+ This lets you inspect the instructional context being provided to the
145
+ Gemini model.
146
+ - **`refresh`**:
147
+ - **Description:** Reload the hierarchical instructional memory from all
148
+ `GEMINI.md` files found in the configured locations (global,
149
+ project/ancestors, and sub-directories). This command updates the model
150
+ with the latest `GEMINI.md` content.
151
+ - **`list`**:
152
+ - **Description:** Lists the paths of the GEMINI.md files in use for
153
+ hierarchical memory.
154
+ - **Note:** For more details on how `GEMINI.md` files contribute to
155
+ hierarchical memory, see the
156
+ [CLI Configuration documentation](../get-started/configuration.md).
157
+
158
+ - **`/restore`**
159
+ - **Description:** Restores the project files to the state they were in just
160
+ before a tool was executed. This is particularly useful for undoing file
161
+ edits made by a tool. If run without a tool call ID, it will list available
162
+ checkpoints to restore from.
163
+ - **Usage:** `/restore [tool_call_id]`
164
+ - **Note:** Only available if checkpointing is configured via
165
+ [settings](../get-started/configuration.md). See
166
+ [Checkpointing documentation](../cli/checkpointing.md) for more details.
167
+ - **`/resume`**
168
+ - **Description:** Browse and resume previous conversation sessions. Opens an
169
+ interactive session browser where you can search, filter, and select from
170
+ automatically saved conversations.
171
+ - **Features:**
172
+ - **Session Browser:** Interactive interface showing all saved sessions with
173
+ timestamps, message counts, and first user message for context
174
+ - **Search:** Use `/` to search through conversation content across all
175
+ sessions
176
+ - **Sorting:** Sort sessions by date or message count
177
+ - **Management:** Delete unwanted sessions directly from the browser
178
+ - **Resume:** Select any session to resume and continue the conversation
179
+ - **Note:** All conversations are automatically saved as you chat - no manual
180
+ saving required. See [Session Management](../cli/session-management.md) for
181
+ complete details.
182
+
183
+ - [**`/settings`**](./settings.md)
184
+ - **Description:** Open the settings editor to view and modify Gemini CLI
185
+ settings.
186
+ - **Details:** This command provides a user-friendly interface for changing
187
+ settings that control the behavior and appearance of Gemini CLI. It is
188
+ equivalent to manually editing the `.gemini/settings.json` file, but with
189
+ validation and guidance to prevent errors. See the
190
+ [settings documentation](./settings.md) for a full list of available
191
+ settings.
192
+ - **Usage:** Simply run `/settings` and the editor will open. You can then
193
+ browse or search for specific settings, view their current values, and
194
+ modify them as desired. Changes to some settings are applied immediately,
195
+ while others require a restart.
196
+
197
+ - **`/stats`**
198
+ - **Description:** Display detailed statistics for the current Gemini CLI
199
+ session, including token usage, cached token savings (when available), and
200
+ session duration. Note: Cached token information is only displayed when
201
+ cached tokens are being used, which occurs with API key authentication but
202
+ not with OAuth authentication at this time.
203
+
204
+ - [**`/theme`**](./themes.md)
205
+ - **Description:** Open a dialog that lets you change the visual theme of
206
+ Gemini CLI.
207
+
208
+ - **`/auth`**
209
+ - **Description:** Open a dialog that lets you change the authentication
210
+ method.
211
+
212
+ - **`/about`**
213
+ - **Description:** Show version info. Please share this information when
214
+ filing issues.
215
+
216
+ - [**`/tools`**](../tools/index.md)
217
+ - **Description:** Display a list of tools that are currently available within
218
+ Gemini CLI.
219
+ - **Usage:** `/tools [desc]`
220
+ - **Sub-commands:**
221
+ - **`desc`** or **`descriptions`**:
222
+ - **Description:** Show detailed descriptions of each tool, including each
223
+ tool's name with its full description as provided to the model.
224
+ - **`nodesc`** or **`nodescriptions`**:
225
+ - **Description:** Hide tool descriptions, showing only the tool names.
226
+
227
+ - **`/privacy`**
228
+ - **Description:** Display the Privacy Notice and allow users to select
229
+ whether they consent to the collection of their data for service improvement
230
+ purposes.
231
+
232
+ - **`/quit`** (or **`/exit`**)
233
+ - **Description:** Exit Gemini CLI.
234
+
235
+ - **`/vim`**
236
+ - **Description:** Toggle vim mode on or off. When vim mode is enabled, the
237
+ input area supports vim-style navigation and editing commands in both NORMAL
238
+ and INSERT modes.
239
+ - **Features:**
240
+ - **NORMAL mode:** Navigate with `h`, `j`, `k`, `l`; jump by words with `w`,
241
+ `b`, `e`; go to line start/end with `0`, `$`, `^`; go to specific lines
242
+ with `G` (or `gg` for first line)
243
+ - **INSERT mode:** Standard text input with escape to return to NORMAL mode
244
+ - **Editing commands:** Delete with `x`, change with `c`, insert with `i`,
245
+ `a`, `o`, `O`; complex operations like `dd`, `cc`, `dw`, `cw`
246
+ - **Count support:** Prefix commands with numbers (e.g., `3h`, `5w`, `10G`)
247
+ - **Repeat last command:** Use `.` to repeat the last editing operation
248
+ - **Persistent setting:** Vim mode preference is saved to
249
+ `~/.gemini/settings.json` and restored between sessions
250
+ - **Status indicator:** When enabled, shows `[NORMAL]` or `[INSERT]` in the
251
+ footer
252
+
253
+ - **`/init`**
254
+ - **Description:** To help users easily create a `GEMINI.md` file, this
255
+ command analyzes the current directory and generates a tailored context
256
+ file, making it simpler for them to provide project-specific instructions to
257
+ the Gemini agent.
258
+
259
+ ### Custom commands
260
+
261
+ Custom commands allow you to create personalized shortcuts for your most-used
262
+ prompts. For detailed instructions on how to create, manage, and use them,
263
+ please see the dedicated [Custom Commands documentation](./custom-commands.md).
264
+
265
+ ## Input prompt shortcuts
266
+
267
+ These shortcuts apply directly to the input prompt for text manipulation.
268
+
269
+ - **Undo:**
270
+ - **Keyboard shortcut:** Press **Ctrl+z** to undo the last action in the input
271
+ prompt.
272
+
273
+ - **Redo:**
274
+ - **Keyboard shortcut:** Press **Ctrl+Shift+Z** to redo the last undone action
275
+ in the input prompt.
276
+
277
+ ## At commands (`@`)
278
+
279
+ At commands are used to include the content of files or directories as part of
280
+ your prompt to Gemini. These commands include git-aware filtering.
281
+
282
+ - **`@<path_to_file_or_directory>`**
283
+ - **Description:** Inject the content of the specified file or files into your
284
+ current prompt. This is useful for asking questions about specific code,
285
+ text, or collections of files.
286
+ - **Examples:**
287
+ - `@path/to/your/file.txt Explain this text.`
288
+ - `@src/my_project/ Summarize the code in this directory.`
289
+ - `What is this file about? @README.md`
290
+ - **Details:**
291
+ - If a path to a single file is provided, the content of that file is read.
292
+ - If a path to a directory is provided, the command attempts to read the
293
+ content of files within that directory and any subdirectories.
294
+ - Spaces in paths should be escaped with a backslash (e.g.,
295
+ `@My\ Documents/file.txt`).
296
+ - The command uses the `read_many_files` tool internally. The content is
297
+ fetched and then inserted into your query before being sent to the Gemini
298
+ model.
299
+ - **Git-aware filtering:** By default, git-ignored files (like
300
+ `node_modules/`, `dist/`, `.env`, `.git/`) are excluded. This behavior can
301
+ be changed via the `context.fileFiltering` settings.
302
+ - **File types:** The command is intended for text-based files. While it
303
+ might attempt to read any file, binary files or very large files might be
304
+ skipped or truncated by the underlying `read_many_files` tool to ensure
305
+ performance and relevance. The tool indicates if files were skipped.
306
+ - **Output:** The CLI will show a tool call message indicating that
307
+ `read_many_files` was used, along with a message detailing the status and
308
+ the path(s) that were processed.
309
+
310
+ - **`@` (Lone at symbol)**
311
+ - **Description:** If you type a lone `@` symbol without a path, the query is
312
+ passed as-is to the Gemini model. This might be useful if you are
313
+ specifically talking _about_ the `@` symbol in your prompt.
314
+
315
+ ### Error handling for `@` commands
316
+
317
+ - If the path specified after `@` is not found or is invalid, an error message
318
+ will be displayed, and the query might not be sent to the Gemini model, or it
319
+ will be sent without the file content.
320
+ - If the `read_many_files` tool encounters an error (e.g., permission issues),
321
+ this will also be reported.
322
+
323
+ ## Shell mode and passthrough commands (`!`)
324
+
325
+ The `!` prefix lets you interact with your system's shell directly from within
326
+ Gemini CLI.
327
+
328
+ - **`!<shell_command>`**
329
+ - **Description:** Execute the given `<shell_command>` using `bash` on
330
+ Linux/macOS or `powershell.exe -NoProfile -Command` on Windows (unless you
331
+ override `ComSpec`). Any output or errors from the command are displayed in
332
+ the terminal.
333
+ - **Examples:**
334
+ - `!ls -la` (executes `ls -la` and returns to Gemini CLI)
335
+ - `!git status` (executes `git status` and returns to Gemini CLI)
336
+
337
+ - **`!` (Toggle shell mode)**
338
+ - **Description:** Typing `!` on its own toggles shell mode.
339
+ - **Entering shell mode:**
340
+ - When active, shell mode uses a different coloring and a "Shell Mode
341
+ Indicator".
342
+ - While in shell mode, text you type is interpreted directly as a shell
343
+ command.
344
+ - **Exiting shell mode:**
345
+ - When exited, the UI reverts to its standard appearance and normal Gemini
346
+ CLI behavior resumes.
347
+
348
+ - **Caution for all `!` usage:** Commands you execute in shell mode have the
349
+ same permissions and impact as if you ran them directly in your terminal.
350
+
351
+ - **Environment variable:** When a command is executed via `!` or in shell mode,
352
+ the `GEMINI_CLI=1` environment variable is set in the subprocess's
353
+ environment. This allows scripts or tools to detect if they are being run from
354
+ within the Gemini CLI.