@mmmbuto/gemini-cli-termux 0.30.3-termux → 0.30.5-termux

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 (400) hide show
  1. package/README.md +42 -193
  2. package/bundle/docs/cli/settings.md +8 -9
  3. package/bundle/docs/extensions/reference.md +14 -38
  4. package/bundle/docs/hooks/reference.md +0 -8
  5. package/bundle/docs/reference/configuration.md +0 -8
  6. package/bundle/gemini.js +10730 -11704
  7. package/bundle/node_modules/@google/gemini-cli-devtools/package.json +1 -1
  8. package/bundle/package.json +2 -1
  9. package/package.json +67 -5
  10. package/packages/cli/dist/index.js +0 -0
  11. package/packages/cli/dist/package.json +2 -2
  12. package/packages/cli/dist/src/commands/extensions/examples/custom-commands/gemini-extension.json +2 -2
  13. package/packages/cli/dist/src/commands/extensions/examples/exclude-tools/gemini-extension.json +3 -3
  14. package/packages/cli/dist/src/commands/extensions/examples/hooks/gemini-extension.json +2 -2
  15. package/packages/cli/dist/src/commands/extensions/examples/hooks/hooks/hooks.json +11 -11
  16. package/packages/cli/dist/src/commands/extensions/examples/mcp-server/example.js +1 -1
  17. package/packages/cli/dist/src/commands/extensions/examples/mcp-server/gemini-extension.json +8 -8
  18. package/packages/cli/dist/src/commands/extensions/examples/mcp-server/package.json +9 -9
  19. package/packages/cli/dist/src/commands/extensions/examples/skills/gemini-extension.json +2 -2
  20. package/packages/cli/dist/src/commands/extensions/examples/themes-example/README.md +8 -5
  21. package/packages/cli/dist/src/commands/extensions/examples/themes-example/gemini-extension.json +27 -27
  22. package/packages/cli/dist/src/config/config.js +4 -65
  23. package/packages/cli/dist/src/config/config.js.map +1 -1
  24. package/packages/cli/dist/src/config/settingsSchema.d.ts +1 -235
  25. package/packages/cli/dist/src/config/settingsSchema.js +1 -235
  26. package/packages/cli/dist/src/config/settingsSchema.js.map +1 -1
  27. package/packages/cli/dist/src/gemini.js +0 -2
  28. package/packages/cli/dist/src/gemini.js.map +1 -1
  29. package/packages/cli/dist/src/generated/git-commit.d.ts +2 -2
  30. package/packages/cli/dist/src/generated/git-commit.js +2 -2
  31. package/packages/cli/dist/src/patches/empty-module.d.ts +2 -0
  32. package/packages/cli/dist/src/patches/empty-module.js +2 -0
  33. package/packages/cli/dist/src/patches/empty-module.js.map +1 -0
  34. package/packages/cli/dist/src/services/McpPromptLoader.js +3 -6
  35. package/packages/cli/dist/src/services/McpPromptLoader.js.map +1 -1
  36. package/packages/cli/dist/src/ui/components/AgentConfigDialog.js +19 -5
  37. package/packages/cli/dist/src/ui/components/AgentConfigDialog.js.map +1 -1
  38. package/packages/cli/dist/src/ui/components/AgentConfigDialog.test.js +41 -19
  39. package/packages/cli/dist/src/ui/components/AgentConfigDialog.test.js.map +1 -1
  40. package/packages/cli/dist/src/ui/components/DialogManager.d.ts +1 -1
  41. package/packages/cli/dist/src/ui/components/DialogManager.js +34 -7
  42. package/packages/cli/dist/src/ui/components/DialogManager.js.map +1 -1
  43. package/packages/cli/dist/src/ui/components/InputPrompt.d.ts +9 -0
  44. package/packages/cli/dist/src/ui/components/InputPrompt.js +350 -125
  45. package/packages/cli/dist/src/ui/components/InputPrompt.js.map +1 -1
  46. package/packages/cli/dist/src/ui/components/InputPrompt.test.js +788 -35
  47. package/packages/cli/dist/src/ui/components/InputPrompt.test.js.map +1 -1
  48. package/packages/cli/dist/src/ui/components/messages/ShellToolMessage.js +2 -2
  49. package/packages/cli/dist/src/ui/components/messages/ShellToolMessage.js.map +1 -1
  50. package/packages/cli/dist/src/ui/components/messages/ToolConfirmationMessage.js +4 -77
  51. package/packages/cli/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
  52. package/packages/cli/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +0 -51
  53. package/packages/cli/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -1
  54. package/packages/cli/dist/src/ui/components/messages/ToolMessage.js +2 -2
  55. package/packages/cli/dist/src/ui/components/messages/ToolMessage.js.map +1 -1
  56. package/packages/cli/dist/src/ui/components/messages/ToolShared.d.ts +0 -1
  57. package/packages/cli/dist/src/ui/components/messages/ToolShared.js +2 -2
  58. package/packages/cli/dist/src/ui/components/messages/ToolShared.js.map +1 -1
  59. package/packages/cli/dist/src/ui/components/shared/BaseSettingsDialog.js +4 -1
  60. package/packages/cli/dist/src/ui/components/shared/BaseSettingsDialog.js.map +1 -1
  61. package/packages/cli/dist/src/ui/components/shared/BaseSettingsDialog.test.js +139 -40
  62. package/packages/cli/dist/src/ui/components/shared/BaseSettingsDialog.test.js.map +1 -1
  63. package/packages/cli/dist/src/ui/components/shared/TextInput.js +2 -1
  64. package/packages/cli/dist/src/ui/components/shared/TextInput.js.map +1 -1
  65. package/packages/cli/dist/src/ui/hooks/toolMapping.js +0 -1
  66. package/packages/cli/dist/src/ui/hooks/toolMapping.js.map +1 -1
  67. package/packages/cli/dist/src/ui/hooks/toolMapping.test.js +0 -13
  68. package/packages/cli/dist/src/ui/hooks/toolMapping.test.js.map +1 -1
  69. package/packages/cli/dist/src/ui/hooks/useToolScheduler.js +2 -18
  70. package/packages/cli/dist/src/ui/hooks/useToolScheduler.js.map +1 -1
  71. package/packages/cli/dist/src/ui/hooks/useToolScheduler.test.js +0 -44
  72. package/packages/cli/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
  73. package/packages/cli/dist/src/ui/keyMatchers.test.js.map +1 -1
  74. package/packages/cli/dist/src/ui/types.d.ts +0 -1
  75. package/packages/cli/dist/src/ui/types.js.map +1 -1
  76. package/packages/cli/dist/src/ui/utils/commandUtils.js +4 -1
  77. package/packages/cli/dist/src/ui/utils/commandUtils.js.map +1 -1
  78. package/packages/cli/dist/src/utils/activityLogger.js +23 -94
  79. package/packages/cli/dist/src/utils/activityLogger.js.map +1 -1
  80. package/packages/cli/dist/src/utils/handleAutoUpdate.d.ts +1 -1
  81. package/packages/cli/dist/src/utils/handleAutoUpdate.js +1 -1
  82. package/packages/cli/dist/src/utils/handleAutoUpdate.js.map +1 -1
  83. package/packages/cli/dist/src/utils/handleAutoUpdate.test.js +11 -11
  84. package/packages/cli/dist/src/utils/handleAutoUpdate.test.js.map +1 -1
  85. package/{bundle/sandbox-macos-restrictive-closed.sb → packages/cli/dist/src/utils/sandbox-macos-strict-open.sb} +42 -4
  86. package/packages/cli/dist/src/utils/{sandbox-macos-restrictive-closed.sb → sandbox-macos-strict-proxied.sb} +44 -4
  87. package/packages/cli/dist/tsconfig.tsbuildinfo +1 -1
  88. package/packages/core/dist/docs/admin/enterprise-controls.md +115 -0
  89. package/packages/core/dist/docs/changelogs/index.md +57 -1
  90. package/packages/core/dist/docs/changelogs/latest.md +357 -314
  91. package/packages/core/dist/docs/changelogs/preview.md +288 -411
  92. package/packages/core/dist/docs/cli/checkpointing.md +2 -3
  93. package/packages/core/dist/docs/cli/cli-reference.md +42 -28
  94. package/packages/core/dist/docs/cli/custom-commands.md +3 -0
  95. package/packages/core/dist/docs/cli/enterprise.md +28 -8
  96. package/packages/core/dist/docs/cli/gemini-md.md +21 -13
  97. package/packages/core/dist/docs/cli/headless.md +34 -372
  98. package/packages/core/dist/docs/cli/model.md +1 -1
  99. package/packages/core/dist/docs/cli/plan-mode.md +245 -0
  100. package/packages/core/dist/docs/cli/rewind.md +11 -11
  101. package/packages/core/dist/docs/cli/sandbox.md +6 -5
  102. package/packages/core/dist/docs/cli/session-management.md +61 -44
  103. package/packages/core/dist/docs/cli/settings.md +64 -49
  104. package/packages/core/dist/docs/cli/skills.md +29 -7
  105. package/packages/core/dist/docs/cli/telemetry.md +41 -5
  106. package/packages/core/dist/docs/cli/themes.md +88 -54
  107. package/packages/core/dist/docs/cli/trusted-folders.md +31 -0
  108. package/packages/core/dist/docs/cli/tutorials/automation.md +187 -0
  109. package/packages/core/dist/docs/cli/tutorials/file-management.md +142 -0
  110. package/packages/core/dist/docs/cli/tutorials/mcp-setup.md +105 -0
  111. package/packages/core/dist/docs/cli/tutorials/memory-management.md +126 -0
  112. package/packages/core/dist/docs/cli/tutorials/session-management.md +105 -0
  113. package/packages/core/dist/docs/cli/tutorials/shell-commands.md +107 -0
  114. package/packages/core/dist/docs/cli/tutorials/skills-getting-started.md +36 -31
  115. package/packages/core/dist/docs/cli/tutorials/task-planning.md +93 -0
  116. package/packages/core/dist/docs/cli/tutorials/web-tools.md +78 -0
  117. package/packages/core/dist/docs/core/index.md +7 -7
  118. package/packages/core/dist/docs/core/subagents.md +40 -40
  119. package/packages/core/dist/docs/extensions/best-practices.md +102 -53
  120. package/packages/core/dist/docs/extensions/index.md +37 -21
  121. package/packages/core/dist/docs/extensions/reference.md +148 -219
  122. package/packages/core/dist/docs/extensions/releasing.md +93 -122
  123. package/packages/core/dist/docs/extensions/writing-extensions.md +87 -76
  124. package/packages/core/dist/docs/get-started/authentication.md +4 -4
  125. package/packages/core/dist/docs/get-started/examples.md +39 -119
  126. package/packages/core/dist/docs/get-started/gemini-3.md +17 -3
  127. package/packages/core/dist/docs/get-started/index.md +16 -5
  128. package/packages/core/dist/docs/get-started/installation.md +110 -77
  129. package/packages/core/dist/docs/hooks/best-practices.md +1 -1
  130. package/packages/core/dist/docs/hooks/reference.md +2 -2
  131. package/packages/core/dist/docs/index.md +142 -149
  132. package/packages/core/dist/docs/redirects.json +19 -0
  133. package/packages/core/dist/docs/reference/commands.md +523 -0
  134. package/{bundle/docs/get-started → packages/core/dist/docs/reference}/configuration.md +180 -71
  135. package/packages/core/dist/docs/{cli → reference}/keyboard-shortcuts.md +49 -35
  136. package/packages/core/dist/docs/{core → reference}/policy-engine.md +76 -32
  137. package/packages/core/dist/docs/releases.md +2 -2
  138. package/{bundle/docs → packages/core/dist/docs/resources}/faq.md +1 -1
  139. package/packages/core/dist/docs/{quota-and-pricing.md → resources/quota-and-pricing.md} +12 -5
  140. package/{bundle/docs → packages/core/dist/docs/resources}/tos-privacy.md +3 -3
  141. package/packages/core/dist/docs/{troubleshooting.md → resources/troubleshooting.md} +1 -1
  142. package/packages/core/dist/docs/sidebar.json +194 -113
  143. package/packages/core/dist/docs/tools/activate-skill.md +43 -0
  144. package/packages/core/dist/docs/tools/ask-user.md +95 -0
  145. package/packages/core/dist/docs/tools/file-system.md +55 -143
  146. package/packages/core/dist/docs/tools/index.md +97 -93
  147. package/packages/core/dist/docs/tools/internal-docs.md +46 -0
  148. package/packages/core/dist/docs/tools/mcp-server.md +65 -16
  149. package/packages/core/dist/docs/tools/memory.md +21 -40
  150. package/packages/core/dist/docs/tools/planning.md +57 -0
  151. package/packages/core/dist/docs/tools/shell.md +44 -88
  152. package/packages/core/dist/docs/tools/todos.md +22 -44
  153. package/packages/core/dist/docs/tools/web-fetch.md +22 -46
  154. package/packages/core/dist/docs/tools/web-search.md +19 -29
  155. package/packages/core/dist/src/code_assist/types.d.ts +14 -14
  156. package/packages/core/dist/src/config/config.d.ts +1 -13
  157. package/packages/core/dist/src/config/config.js +6 -39
  158. package/packages/core/dist/src/config/config.js.map +1 -1
  159. package/packages/core/dist/src/confirmation-bus/types.d.ts +0 -3
  160. package/packages/core/dist/src/confirmation-bus/types.js.map +1 -1
  161. package/packages/core/dist/src/core/coreToolHookTriggers.d.ts +1 -1
  162. package/packages/core/dist/src/core/coreToolHookTriggers.js +3 -8
  163. package/packages/core/dist/src/core/coreToolHookTriggers.js.map +1 -1
  164. package/packages/core/dist/src/generated/git-commit.d.ts +2 -2
  165. package/packages/core/dist/src/generated/git-commit.js +2 -2
  166. package/packages/core/dist/src/hooks/hookEventHandler.d.ts +2 -2
  167. package/packages/core/dist/src/hooks/hookEventHandler.js +2 -8
  168. package/packages/core/dist/src/hooks/hookEventHandler.js.map +1 -1
  169. package/packages/core/dist/src/hooks/hookSystem.d.ts +2 -2
  170. package/packages/core/dist/src/hooks/hookSystem.js +4 -4
  171. package/packages/core/dist/src/hooks/hookSystem.js.map +1 -1
  172. package/packages/core/dist/src/hooks/types.d.ts +0 -18
  173. package/packages/core/dist/src/hooks/types.js +0 -17
  174. package/packages/core/dist/src/hooks/types.js.map +1 -1
  175. package/packages/core/dist/src/ide/ide-client.js +1 -1
  176. package/packages/core/dist/src/ide/ide-client.js.map +1 -1
  177. package/packages/core/dist/src/ide/types.d.ts +8 -8
  178. package/packages/core/dist/src/index.d.ts +2 -0
  179. package/packages/core/dist/src/index.js +2 -0
  180. package/packages/core/dist/src/index.js.map +1 -1
  181. package/packages/core/dist/src/policy/policies/plan.toml +29 -43
  182. package/packages/core/dist/src/policy/policies/read-only.toml +12 -11
  183. package/packages/core/dist/src/policy/policies/write.toml +11 -10
  184. package/packages/core/dist/src/policy/policies/yolo.toml +24 -12
  185. package/packages/core/dist/src/policy/policy-engine.js +1 -5
  186. package/packages/core/dist/src/policy/policy-engine.js.map +1 -1
  187. package/packages/core/dist/src/policy/types.d.ts +1 -2
  188. package/packages/core/dist/src/policy/types.js +0 -1
  189. package/packages/core/dist/src/policy/types.js.map +1 -1
  190. package/packages/core/dist/src/safety/context-builder.d.ts +3 -3
  191. package/packages/core/dist/src/safety/context-builder.js +4 -60
  192. package/packages/core/dist/src/safety/context-builder.js.map +1 -1
  193. package/packages/core/dist/src/safety/context-builder.test.js +18 -98
  194. package/packages/core/dist/src/safety/context-builder.test.js.map +1 -1
  195. package/packages/core/dist/src/safety/protocol.d.ts +0 -4
  196. package/packages/core/dist/src/safety/registry.d.ts +1 -2
  197. package/packages/core/dist/src/safety/registry.js +4 -14
  198. package/packages/core/dist/src/safety/registry.js.map +1 -1
  199. package/packages/core/dist/src/safety/registry.test.js +2 -5
  200. package/packages/core/dist/src/safety/registry.test.js.map +1 -1
  201. package/packages/core/dist/src/scheduler/scheduler.d.ts +1 -1
  202. package/packages/core/dist/src/scheduler/scheduler.js +4 -49
  203. package/packages/core/dist/src/scheduler/scheduler.js.map +1 -1
  204. package/packages/core/dist/src/scheduler/scheduler.test.js +0 -91
  205. package/packages/core/dist/src/scheduler/scheduler.test.js.map +1 -1
  206. package/packages/core/dist/src/scheduler/state-manager.d.ts +0 -6
  207. package/packages/core/dist/src/scheduler/state-manager.js +0 -12
  208. package/packages/core/dist/src/scheduler/state-manager.js.map +1 -1
  209. package/packages/core/dist/src/scheduler/tool-executor.js +7 -9
  210. package/packages/core/dist/src/scheduler/tool-executor.js.map +1 -1
  211. package/packages/core/dist/src/scheduler/tool-executor.test.js +1 -1
  212. package/packages/core/dist/src/scheduler/tool-executor.test.js.map +1 -1
  213. package/packages/core/dist/src/scheduler/types.d.ts +0 -13
  214. package/packages/core/dist/src/services/shellExecutionService.d.ts +1 -1
  215. package/packages/core/dist/src/services/shellExecutionService.js +7 -8
  216. package/packages/core/dist/src/services/shellExecutionService.js.map +1 -1
  217. package/packages/core/dist/src/services/shellExecutionService.test.js +5 -5
  218. package/packages/core/dist/src/services/shellExecutionService.test.js.map +1 -1
  219. package/packages/core/dist/src/services/test-data/resolved-aliases-retry.golden.json +251 -251
  220. package/packages/core/dist/src/services/test-data/resolved-aliases.golden.json +251 -251
  221. package/packages/core/dist/src/skills/builtin/skill-creator/scripts/init_skill.cjs +5 -1
  222. package/packages/core/dist/src/skills/builtin/skill-creator/scripts/package_skill.cjs +5 -1
  223. package/packages/core/dist/src/skills/builtin/skill-creator/scripts/validate_skill.cjs +5 -1
  224. package/packages/core/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +1 -3
  225. package/packages/core/dist/src/telemetry/clearcut-logger/clearcut-logger.js +0 -2
  226. package/packages/core/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
  227. package/packages/core/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +1 -9
  228. package/packages/core/dist/src/telemetry/clearcut-logger/event-metadata-key.js +1 -19
  229. package/packages/core/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -1
  230. package/packages/core/dist/src/telemetry/index.d.ts +1 -2
  231. package/packages/core/dist/src/telemetry/index.js +1 -2
  232. package/packages/core/dist/src/telemetry/index.js.map +1 -1
  233. package/packages/core/dist/src/telemetry/loggers.js +0 -4
  234. package/packages/core/dist/src/telemetry/loggers.js.map +1 -1
  235. package/packages/core/dist/src/telemetry/trace.js.map +1 -1
  236. package/packages/core/dist/src/telemetry/types.d.ts +0 -26
  237. package/packages/core/dist/src/telemetry/types.js +2 -76
  238. package/packages/core/dist/src/telemetry/types.js.map +1 -1
  239. package/packages/core/dist/src/tools/diffOptions.d.ts +2 -2
  240. package/packages/core/dist/src/tools/diffOptions.js.map +1 -1
  241. package/packages/core/dist/src/tools/mcp-client.test.js.map +1 -1
  242. package/packages/core/dist/src/tools/mcp-tool.d.ts +1 -3
  243. package/packages/core/dist/src/tools/mcp-tool.js +2 -9
  244. package/packages/core/dist/src/tools/mcp-tool.js.map +1 -1
  245. package/packages/core/dist/src/tools/memoryTool.d.ts +0 -10
  246. package/packages/core/dist/src/tools/memoryTool.js +30 -25
  247. package/packages/core/dist/src/tools/memoryTool.js.map +1 -1
  248. package/packages/core/dist/src/tools/tool-names.d.ts +6 -0
  249. package/packages/core/dist/src/tools/tool-names.js +16 -1
  250. package/packages/core/dist/src/tools/tool-names.js.map +1 -1
  251. package/packages/core/dist/src/tools/tools.d.ts +0 -11
  252. package/packages/core/dist/src/tools/tools.js.map +1 -1
  253. package/packages/core/dist/src/utils/getPty.d.ts +14 -1
  254. package/packages/core/dist/src/utils/getPty.js +67 -2
  255. package/packages/core/dist/src/utils/getPty.js.map +1 -1
  256. package/packages/core/dist/src/utils/memoryDiscovery.d.ts +11 -3
  257. package/packages/core/dist/src/utils/memoryDiscovery.js +56 -21
  258. package/packages/core/dist/src/utils/memoryDiscovery.js.map +1 -1
  259. package/packages/core/dist/src/utils/secure-browser-launcher.js +40 -29
  260. package/packages/core/dist/src/utils/secure-browser-launcher.js.map +1 -1
  261. package/packages/core/dist/src/utils/textUtils.d.ts +0 -9
  262. package/packages/core/dist/src/utils/textUtils.js +0 -15
  263. package/packages/core/dist/src/utils/textUtils.js.map +1 -1
  264. package/packages/core/dist/src/utils/textUtils.test.js +1 -42
  265. package/packages/core/dist/src/utils/textUtils.test.js.map +1 -1
  266. package/packages/core/dist/tsconfig.tsbuildinfo +1 -1
  267. package/packages/test-utils/dist/tsconfig.tsbuildinfo +1 -1
  268. package/bundle/docs/ROADMAP.md +0 -113
  269. package/bundle/docs/TERMUX.md +0 -95
  270. package/bundle/docs/architecture.md +0 -80
  271. package/bundle/docs/assets/hero.png +0 -0
  272. package/bundle/docs/cli/authentication.md +0 -3
  273. package/bundle/docs/cli/commands.md +0 -430
  274. package/bundle/docs/cli/context-memory.md +0 -69
  275. package/bundle/docs/cli/index.md +0 -65
  276. package/bundle/docs/cli/keyboard-shortcuts.md +0 -140
  277. package/bundle/docs/cli/tutorials.md +0 -87
  278. package/bundle/docs/core/policy-engine.md +0 -305
  279. package/bundle/docs/get-started/configuration-v1.md +0 -888
  280. package/bundle/docs/patches/README.md +0 -74
  281. package/bundle/docs/patches/mcp-sdk-typings-shim.md +0 -27
  282. package/bundle/docs/quota-and-pricing.md +0 -158
  283. package/bundle/docs/termux-api/COMMANDS.md +0 -592
  284. package/bundle/docs/termux-api/DISCOVERY_SETUP.md +0 -670
  285. package/bundle/docs/termux-api/EXECUTION_PLAN.md +0 -532
  286. package/bundle/docs/termux-api/MERGE_STRATEGY.md +0 -365
  287. package/bundle/docs/termux-api/PATCHES.md +0 -480
  288. package/bundle/docs/termux-api/README.md +0 -416
  289. package/bundle/docs/troubleshooting.md +0 -173
  290. package/bundle/policies/conseca.toml +0 -6
  291. package/bundle/sandbox-macos-permissive-closed.sb +0 -32
  292. package/packages/cli/README.md +0 -173
  293. package/packages/cli/dist/src/commands/extensions/examples/mcp-server/example.d.ts +0 -6
  294. package/packages/cli/dist/src/commands/extensions/examples/mcp-server/example.js.map +0 -1
  295. package/packages/cli/dist/src/commands/extensions/examples/mcp-server/example.test.d.ts +0 -6
  296. package/packages/cli/dist/src/commands/extensions/examples/mcp-server/example.test.js +0 -111
  297. package/packages/cli/dist/src/commands/extensions/examples/mcp-server/example.test.js.map +0 -1
  298. package/packages/cli/dist/src/ui/components/messages/ToolConfirmationMessageOverflow.test.d.ts +0 -6
  299. package/packages/cli/dist/src/ui/components/messages/ToolConfirmationMessageOverflow.test.js +0 -93
  300. package/packages/cli/dist/src/ui/components/messages/ToolConfirmationMessageOverflow.test.js.map +0 -1
  301. package/packages/cli/dist/src/ui/hooks/useReactToolScheduler.d.ts +0 -42
  302. package/packages/cli/dist/src/ui/hooks/useReactToolScheduler.js +0 -105
  303. package/packages/cli/dist/src/ui/hooks/useReactToolScheduler.js.map +0 -1
  304. package/packages/cli/dist/src/ui/hooks/useReactToolScheduler.test.d.ts +0 -6
  305. package/packages/cli/dist/src/ui/hooks/useReactToolScheduler.test.js +0 -58
  306. package/packages/cli/dist/src/ui/hooks/useReactToolScheduler.test.js.map +0 -1
  307. package/packages/cli/dist/src/ui/hooks/useRefreshMemoryCommand.d.ts +0 -6
  308. package/packages/cli/dist/src/ui/hooks/useRefreshMemoryCommand.js +0 -7
  309. package/packages/cli/dist/src/ui/hooks/useRefreshMemoryCommand.js.map +0 -1
  310. package/packages/cli/dist/src/ui/hooks/useShowMemoryCommand.d.ts +0 -9
  311. package/packages/cli/dist/src/ui/hooks/useShowMemoryCommand.js +0 -59
  312. package/packages/cli/dist/src/ui/hooks/useShowMemoryCommand.js.map +0 -1
  313. package/packages/cli/dist/src/ui/hooks/useToolExecutionScheduler.d.ts +0 -30
  314. package/packages/cli/dist/src/ui/hooks/useToolExecutionScheduler.js +0 -149
  315. package/packages/cli/dist/src/ui/hooks/useToolExecutionScheduler.js.map +0 -1
  316. package/packages/cli/dist/src/ui/hooks/useToolExecutionScheduler.test.d.ts +0 -6
  317. package/packages/cli/dist/src/ui/hooks/useToolExecutionScheduler.test.js +0 -376
  318. package/packages/cli/dist/src/ui/hooks/useToolExecutionScheduler.test.js.map +0 -1
  319. package/packages/cli/dist/src/ui/hooks/useToolSchedulerFacade.test.d.ts +0 -6
  320. package/packages/cli/dist/src/ui/hooks/useToolSchedulerFacade.test.js +0 -45
  321. package/packages/cli/dist/src/ui/hooks/useToolSchedulerFacade.test.js.map +0 -1
  322. package/packages/cli/dist/src/ui/utils/InlineMarkdownRenderer.test.d.ts +0 -6
  323. package/packages/cli/dist/src/ui/utils/InlineMarkdownRenderer.test.js +0 -21
  324. package/packages/cli/dist/src/ui/utils/InlineMarkdownRenderer.test.js.map +0 -1
  325. package/packages/cli/dist/src/ui/utils/terminalUtils.test.d.ts +0 -6
  326. package/packages/cli/dist/src/ui/utils/terminalUtils.test.js +0 -40
  327. package/packages/cli/dist/src/ui/utils/terminalUtils.test.js.map +0 -1
  328. package/packages/cli/dist/src/utils/checks.d.ts +0 -19
  329. package/packages/cli/dist/src/utils/checks.js +0 -24
  330. package/packages/cli/dist/src/utils/checks.js.map +0 -1
  331. package/packages/cli/dist/src/utils/checks.test.d.ts +0 -6
  332. package/packages/cli/dist/src/utils/checks.test.js +0 -29
  333. package/packages/cli/dist/src/utils/checks.test.js.map +0 -1
  334. package/packages/cli/dist/src/utils/sandbox-macos-permissive-closed.sb +0 -32
  335. package/packages/cli/index.js +0 -2
  336. package/packages/core/dist/docs/TERMUX.md +0 -95
  337. package/packages/core/dist/docs/architecture.md +0 -80
  338. package/packages/core/dist/docs/assets/hero.png +0 -0
  339. package/packages/core/dist/docs/cli/authentication.md +0 -3
  340. package/packages/core/dist/docs/cli/commands.md +0 -430
  341. package/packages/core/dist/docs/cli/context-memory.md +0 -69
  342. package/packages/core/dist/docs/cli/index.md +0 -65
  343. package/packages/core/dist/docs/cli/tutorials.md +0 -87
  344. package/packages/core/dist/docs/cli/uninstall.md +0 -65
  345. package/packages/core/dist/docs/core/memport.md +0 -246
  346. package/packages/core/dist/docs/core/tools-api.md +0 -131
  347. package/packages/core/dist/docs/faq.md +0 -154
  348. package/packages/core/dist/docs/get-started/configuration-v1.md +0 -888
  349. package/packages/core/dist/docs/get-started/configuration.md +0 -1585
  350. package/packages/core/dist/docs/patches/README.md +0 -74
  351. package/packages/core/dist/docs/patches/mcp-sdk-typings-shim.md +0 -27
  352. package/packages/core/dist/docs/termux-api/COMMANDS.md +0 -592
  353. package/packages/core/dist/docs/termux-api/DISCOVERY_SETUP.md +0 -670
  354. package/packages/core/dist/docs/termux-api/EXECUTION_PLAN.md +0 -532
  355. package/packages/core/dist/docs/termux-api/MERGE_STRATEGY.md +0 -365
  356. package/packages/core/dist/docs/termux-api/PATCHES.md +0 -480
  357. package/packages/core/dist/docs/termux-api/README.md +0 -416
  358. package/packages/core/dist/docs/tos-privacy.md +0 -96
  359. package/packages/core/dist/src/safety/conseca/conseca.d.ts +0 -31
  360. package/packages/core/dist/src/safety/conseca/conseca.js +0 -105
  361. package/packages/core/dist/src/safety/conseca/conseca.js.map +0 -1
  362. package/packages/core/dist/src/safety/conseca/conseca.test.d.ts +0 -6
  363. package/packages/core/dist/src/safety/conseca/conseca.test.js +0 -226
  364. package/packages/core/dist/src/safety/conseca/conseca.test.js.map +0 -1
  365. package/packages/core/dist/src/safety/conseca/integration.test.d.ts +0 -6
  366. package/packages/core/dist/src/safety/conseca/integration.test.js +0 -19
  367. package/packages/core/dist/src/safety/conseca/integration.test.js.map +0 -1
  368. package/packages/core/dist/src/safety/conseca/policy-enforcer.d.ts +0 -13
  369. package/packages/core/dist/src/safety/conseca/policy-enforcer.js +0 -135
  370. package/packages/core/dist/src/safety/conseca/policy-enforcer.js.map +0 -1
  371. package/packages/core/dist/src/safety/conseca/policy-enforcer.test.d.ts +0 -6
  372. package/packages/core/dist/src/safety/conseca/policy-enforcer.test.js +0 -141
  373. package/packages/core/dist/src/safety/conseca/policy-enforcer.test.js.map +0 -1
  374. package/packages/core/dist/src/safety/conseca/policy-generator.d.ts +0 -15
  375. package/packages/core/dist/src/safety/conseca/policy-generator.js +0 -144
  376. package/packages/core/dist/src/safety/conseca/policy-generator.js.map +0 -1
  377. package/packages/core/dist/src/safety/conseca/policy-generator.test.d.ts +0 -6
  378. package/packages/core/dist/src/safety/conseca/policy-generator.test.js +0 -84
  379. package/packages/core/dist/src/safety/conseca/policy-generator.test.js.map +0 -1
  380. package/packages/core/dist/src/safety/conseca/types.d.ts +0 -15
  381. package/packages/core/dist/src/safety/conseca/types.js +0 -7
  382. package/packages/core/dist/src/safety/conseca/types.js.map +0 -1
  383. package/packages/core/dist/src/telemetry/conseca-logger.d.ts +0 -9
  384. package/packages/core/dist/src/telemetry/conseca-logger.js +0 -91
  385. package/packages/core/dist/src/telemetry/conseca-logger.js.map +0 -1
  386. package/packages/core/dist/src/telemetry/conseca-logger.test.d.ts +0 -6
  387. package/packages/core/dist/src/telemetry/conseca-logger.test.js +0 -89
  388. package/packages/core/dist/src/telemetry/conseca-logger.test.js.map +0 -1
  389. package/packages/core/dist/src/tools/mcpImportTool.d.ts +0 -31
  390. package/packages/core/dist/src/tools/mcpImportTool.js +0 -143
  391. package/packages/core/dist/src/tools/mcpImportTool.js.map +0 -1
  392. package/packages/core/dist/src/utils/contextMemory.d.ts +0 -67
  393. package/packages/core/dist/src/utils/contextMemory.js +0 -493
  394. package/packages/core/dist/src/utils/contextMemory.js.map +0 -1
  395. package/packages/core/dist/src/utils/contextMemory.test.d.ts +0 -6
  396. package/packages/core/dist/src/utils/contextMemory.test.js +0 -183
  397. package/packages/core/dist/src/utils/contextMemory.test.js.map +0 -1
  398. /package/{bundle/docs/core → packages/core/dist/docs/reference}/memport.md +0 -0
  399. /package/{bundle/docs/core → packages/core/dist/docs/reference}/tools-api.md +0 -0
  400. /package/{bundle/docs/cli → packages/core/dist/docs/resources}/uninstall.md +0 -0
@@ -93,7 +93,7 @@ Environment variables can be used to override the settings in the file.
93
93
  `true` or `1` will enable the feature. Any other value will disable it.
94
94
 
95
95
  For detailed information about all configuration options, see the
96
- [Configuration guide](../get-started/configuration.md).
96
+ [Configuration guide](../reference/configuration.md).
97
97
 
98
98
  ## Google Cloud telemetry
99
99
 
@@ -275,9 +275,9 @@ For local development and debugging, you can capture telemetry data locally:
275
275
  The following section describes the structure of logs and metrics generated for
276
276
  Gemini CLI.
277
277
 
278
- The `session.id`, `installation.id`, and `user.email` (available only when
279
- authenticated with a Google account) are included as common attributes on all
280
- logs and metrics.
278
+ The `session.id`, `installation.id`, `active_approval_mode`, and `user.email`
279
+ (available only when authenticated with a Google account) are included as common
280
+ attributes on all logs and metrics.
281
281
 
282
282
  ### Logs
283
283
 
@@ -320,6 +320,8 @@ Captures startup configuration and user prompt submissions.
320
320
 
321
321
  Tracks changes and duration of approval modes.
322
322
 
323
+ ##### Lifecycle
324
+
323
325
  - `approval_mode_switch`: Approval mode was changed.
324
326
  - **Attributes**:
325
327
  - `from_mode` (string)
@@ -330,6 +332,15 @@ Tracks changes and duration of approval modes.
330
332
  - `mode` (string)
331
333
  - `duration_ms` (int)
332
334
 
335
+ ##### Execution
336
+
337
+ These events track the execution of an approval mode, such as Plan Mode.
338
+
339
+ - `plan_execution`: A plan was executed and the session switched from plan mode
340
+ to active execution.
341
+ - **Attributes**:
342
+ - `approval_mode` (string)
343
+
333
344
  #### Tools
334
345
 
335
346
  Captures tool executions, output truncation, and Edit behavior.
@@ -349,7 +360,21 @@ Captures tool executions, output truncation, and Edit behavior.
349
360
  - `extension_name` (string, if applicable)
350
361
  - `extension_id` (string, if applicable)
351
362
  - `content_length` (int, if applicable)
352
- - `metadata` (if applicable)
363
+ - `metadata` (if applicable), which includes for the `AskUser` tool:
364
+ - `ask_user` (object):
365
+ - `question_types` (array of strings)
366
+ - `ask_user_dismissed` (boolean)
367
+ - `ask_user_empty_submission` (boolean)
368
+ - `ask_user_answer_count` (number)
369
+ - `diffStat` (if applicable), which includes:
370
+ - `model_added_lines` (number)
371
+ - `model_removed_lines` (number)
372
+ - `model_added_chars` (number)
373
+ - `model_removed_chars` (number)
374
+ - `user_added_lines` (number)
375
+ - `user_removed_lines` (number)
376
+ - `user_added_chars` (number)
377
+ - `user_removed_chars` (number)
353
378
 
354
379
  - `gemini_cli.tool_output_truncated`: Output of a tool call was truncated.
355
380
  - **Attributes**:
@@ -710,6 +735,17 @@ Agent lifecycle metrics: runs, durations, and turns.
710
735
  - **Attributes**:
711
736
  - `agent_name` (string)
712
737
 
738
+ ##### Approval Mode
739
+
740
+ ###### Execution
741
+
742
+ These metrics track the adoption and usage of specific approval workflows, such
743
+ as Plan Mode.
744
+
745
+ - `gemini_cli.plan.execution.count` (Counter, Int): Counts plan executions.
746
+ - **Attributes**:
747
+ - `approval_mode` (string)
748
+
713
749
  ##### UI
714
750
 
715
751
  UI stability signals such as flicker count.
@@ -16,12 +16,14 @@ using the `/theme` command within Gemini CLI:
16
16
  - `Default`
17
17
  - `Dracula`
18
18
  - `GitHub`
19
+ - `Solarized Dark`
19
20
  - **Light themes:**
20
21
  - `ANSI Light`
21
22
  - `Ayu Light`
22
23
  - `Default Light`
23
24
  - `GitHub Light`
24
25
  - `Google Code`
26
+ - `Solarized Light`
25
27
  - `Xcode`
26
28
 
27
29
  ### Changing themes
@@ -39,22 +41,22 @@ can change the theme using the `/theme` command.
39
41
  ### Theme persistence
40
42
 
41
43
  Selected themes are saved in Gemini CLI's
42
- [configuration](../get-started/configuration.md) so your preference is
43
- remembered across sessions.
44
+ [configuration](../reference/configuration.md) so your preference is remembered
45
+ across sessions.
44
46
 
45
47
  ---
46
48
 
47
49
  ## Custom color themes
48
50
 
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
+ Gemini CLI lets you create your own custom color themes by specifying them in
52
+ your `settings.json` file. This gives you full control over the color palette
51
53
  used in the CLI.
52
54
 
53
55
  ### How to define a custom theme
54
56
 
55
57
  Add a `customThemes` block to your user, project, or system `settings.json`
56
58
  file. Each custom theme is defined as an object with a unique name and a set of
57
- color keys. For example:
59
+ nested configuration objects. For example:
58
60
 
59
61
  ```json
60
62
  {
@@ -63,50 +65,52 @@ color keys. For example:
63
65
  "MyCustomTheme": {
64
66
  "name": "MyCustomTheme",
65
67
  "type": "custom",
66
- "Background": "#181818",
67
- ...
68
+ "background": {
69
+ "primary": "#181818"
70
+ },
71
+ "text": {
72
+ "primary": "#f0f0f0",
73
+ "secondary": "#a0a0a0"
74
+ }
68
75
  }
69
76
  }
70
77
  }
71
78
  }
72
79
  ```
73
80
 
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
-
90
- You can also override individual UI text roles by adding a nested `text` object.
91
- This object supports the keys `primary`, `secondary`, `link`, `accent`, and
92
- `response`. When `text.response` is provided it takes precedence over
93
- `text.primary` for rendering model responses in chat.
81
+ **Configuration objects:**
82
+
83
+ - **`text`**: Defines text colors.
84
+ - `primary`: The default text color.
85
+ - `secondary`: Used for less prominent text.
86
+ - `link`: Color for URLs and links.
87
+ - `accent`: Used for highlights and emphasis.
88
+ - `response`: Precedence over `primary` for rendering model responses.
89
+ - **`background`**: Defines background colors.
90
+ - `primary`: The main background color of the UI.
91
+ - `diff.added`: Background for added lines in diffs.
92
+ - `diff.removed`: Background for removed lines in diffs.
93
+ - **`border`**: Defines border colors.
94
+ - `default`: The standard border color.
95
+ - `focused`: Border color when an element is focused.
96
+ - **`status`**: Colors for status indicators.
97
+ - `success`: Used for successful operations.
98
+ - `warning`: Used for warnings.
99
+ - `error`: Used for errors.
100
+ - **`ui`**: Other UI elements.
101
+ - `comment`: Color for code comments.
102
+ - `symbol`: Color for code symbols and operators.
103
+ - `gradient`: An array of colors used for gradient effects.
94
104
 
95
105
  **Required properties:**
96
106
 
97
107
  - `name` (must match the key in the `customThemes` object and be a string)
98
108
  - `type` (must be the string `"custom"`)
99
- - `Background`
100
- - `Foreground`
101
- - `LightBlue`
102
- - `AccentBlue`
103
- - `AccentPurple`
104
- - `AccentCyan`
105
- - `AccentGreen`
106
- - `AccentYellow`
107
- - `AccentRed`
108
- - `Comment`
109
- - `Gray`
109
+
110
+ While all sub-properties are technically optional, we recommend providing at
111
+ least `background.primary`, `text.primary`, `text.secondary`, and the various
112
+ accent colors via `text.link`, `text.accent`, and `status` to ensure a cohesive
113
+ UI.
110
114
 
111
115
  You can use either hex codes (e.g., `#FF0000`) **or** standard CSS color names
112
116
  (e.g., `coral`, `teal`, `blue`) for any color value. See
@@ -141,22 +145,35 @@ custom theme defined in `settings.json`.
141
145
 
142
146
  ```json
143
147
  {
144
- "name": "My File Theme",
148
+ "name": "Gruvbox Dark",
145
149
  "type": "custom",
146
- "Background": "#282A36",
147
- "Foreground": "#F8F8F2",
148
- "LightBlue": "#82AAFF",
149
- "AccentBlue": "#61AFEF",
150
- "AccentPurple": "#BD93F9",
151
- "AccentCyan": "#8BE9FD",
152
- "AccentGreen": "#50FA7B",
153
- "AccentYellow": "#F1FA8C",
154
- "AccentRed": "#FF5555",
155
- "Comment": "#6272A4",
156
- "Gray": "#ABB2BF",
157
- "DiffAdded": "#A6E3A1",
158
- "DiffRemoved": "#F38BA8",
159
- "GradientColors": ["#4796E4", "#847ACE", "#C3677F"]
150
+ "background": {
151
+ "primary": "#282828",
152
+ "diff": {
153
+ "added": "#2b3312",
154
+ "removed": "#341212"
155
+ }
156
+ },
157
+ "text": {
158
+ "primary": "#ebdbb2",
159
+ "secondary": "#a89984",
160
+ "link": "#83a598",
161
+ "accent": "#d3869b"
162
+ },
163
+ "border": {
164
+ "default": "#3c3836",
165
+ "focused": "#458588"
166
+ },
167
+ "status": {
168
+ "success": "#b8bb26",
169
+ "warning": "#fabd2f",
170
+ "error": "#fb4934"
171
+ },
172
+ "ui": {
173
+ "comment": "#928374",
174
+ "symbol": "#8ec07c",
175
+ "gradient": ["#cc241d", "#d65d0e", "#d79921"]
176
+ }
160
177
  }
161
178
  ```
162
179
 
@@ -177,9 +194,18 @@ untrusted sources.
177
194
  - Or, set it as the default by adding `"theme": "MyCustomTheme"` to the `ui`
178
195
  object in your `settings.json`.
179
196
  - Custom themes can be set at the user, project, or system level, and follow the
180
- same [configuration precedence](../get-started/configuration.md) as other
197
+ same [configuration precedence](../reference/configuration.md) as other
181
198
  settings.
182
199
 
200
+ ### Themes from extensions
201
+
202
+ [Extensions](../extensions/reference.md#themes) can also provide custom themes.
203
+ Once an extension is installed and enabled, its themes are automatically added
204
+ to the selection list in the `/theme` command.
205
+
206
+ Themes from extensions appear with the extension name in parentheses to help you
207
+ identify their source, for example: `shades-of-green (green-extension)`.
208
+
183
209
  ---
184
210
 
185
211
  ## Dark themes
@@ -208,6 +234,10 @@ untrusted sources.
208
234
 
209
235
  <img src="/assets/theme-github.png" alt="GitHub theme" width="600">
210
236
 
237
+ ### Solarized Dark
238
+
239
+ <img src="/assets/theme-solarized-dark.png" alt="Solarized Dark theme" width="600">
240
+
211
241
  ## Light themes
212
242
 
213
243
  ### ANSI Light
@@ -230,6 +260,10 @@ untrusted sources.
230
260
 
231
261
  <img src="/assets/theme-google-light.png" alt="Google Code theme" width="600">
232
262
 
263
+ ### Solarized Light
264
+
265
+ <img src="/assets/theme-solarized-light.png" alt="Solarized Light theme" width="600">
266
+
233
267
  ### Xcode
234
268
 
235
269
  <img src="/assets/theme-xcode-light.png" alt="Xcode Light theme" width="600">
@@ -38,6 +38,37 @@ folder, a dialog will automatically appear, prompting you to make a choice:
38
38
  Your choice is saved in a central file (`~/.gemini/trustedFolders.json`), so you
39
39
  will only be asked once per folder.
40
40
 
41
+ ## Understanding folder contents: The discovery phase
42
+
43
+ Before you make a choice, the Gemini CLI performs a **discovery phase** to scan
44
+ the folder for potential configurations. This information is displayed in the
45
+ trust dialog to help you make an informed decision.
46
+
47
+ The discovery UI lists the following categories of items found in the project:
48
+
49
+ - **Commands**: Custom `.toml` command definitions that add new functionality.
50
+ - **MCP Servers**: Configured Model Context Protocol servers that the CLI will
51
+ attempt to connect to.
52
+ - **Hooks**: System or custom hooks that can intercept and modify CLI behavior.
53
+ - **Skills**: Local agent skills that provide specialized capabilities.
54
+ - **Setting overrides**: Any project-specific configurations that override your
55
+ global user settings.
56
+
57
+ ### Security warnings and errors
58
+
59
+ The trust dialog also highlights critical information that requires your
60
+ attention:
61
+
62
+ - **Security Warnings**: The CLI will explicitly flag potentially dangerous
63
+ settings, such as auto-approving certain tools or disabling the security
64
+ sandbox.
65
+ - **Discovery Errors**: If the CLI encounters issues while scanning the folder
66
+ (e.g., a malformed `settings.json` file), these errors will be displayed
67
+ prominently.
68
+
69
+ By reviewing these details, you can ensure that you only grant trust to projects
70
+ that you know are safe.
71
+
41
72
  ## Why trust matters: The impact of an untrusted workspace
42
73
 
43
74
  When a folder is **untrusted**, the Gemini CLI runs in a restricted "safe mode"
@@ -0,0 +1,187 @@
1
+ # Automate tasks with headless mode
2
+
3
+ Automate tasks with Gemini CLI. Learn how to use headless mode, pipe data into
4
+ Gemini CLI, automate workflows with shell scripts, and generate structured JSON
5
+ output for other applications.
6
+
7
+ ## Prerequisites
8
+
9
+ - Gemini CLI installed and authenticated.
10
+ - Familiarity with shell scripting (Bash/Zsh).
11
+
12
+ ## Why headless mode?
13
+
14
+ Headless mode runs Gemini CLI once and exits. It's perfect for:
15
+
16
+ - **CI/CD:** Analyzing pull requests automatically.
17
+ - **Batch processing:** Summarizing a large number of log files.
18
+ - **Tool building:** Creating your own "AI wrapper" scripts.
19
+
20
+ ## How to use headless mode
21
+
22
+ Run Gemini CLI in headless mode by providing a prompt as a positional argument.
23
+ This bypasses the interactive chat interface and prints the response to standard
24
+ output (stdout).
25
+
26
+ Run a single command:
27
+
28
+ ```bash
29
+ gemini "Write a poem about TypeScript"
30
+ ```
31
+
32
+ ## How to pipe input to Gemini CLI
33
+
34
+ Feed data into Gemini using the standard Unix pipe `|`. Gemini reads the
35
+ standard input (stdin) as context and answers your question using standard
36
+ output.
37
+
38
+ Pipe a file:
39
+
40
+ ```bash
41
+ cat error.log | gemini "Explain why this failed"
42
+ ```
43
+
44
+ Pipe a command:
45
+
46
+ ```bash
47
+ git diff | gemini "Write a commit message for these changes"
48
+ ```
49
+
50
+ ## Use Gemini CLI output in scripts
51
+
52
+ Because Gemini prints to stdout, you can chain it with other tools or save the
53
+ results to a file.
54
+
55
+ ### Scenario: Bulk documentation generator
56
+
57
+ You have a folder of Python scripts and want to generate a `README.md` for each
58
+ one.
59
+
60
+ 1. Save the following code as `generate_docs.sh`:
61
+
62
+ ```bash
63
+ #!/bin/bash
64
+
65
+ # Loop through all Python files
66
+ for file in *.py; do
67
+ echo "Generating docs for $file..."
68
+
69
+ # Ask Gemini CLI to generate the documentation and print it to stdout
70
+ gemini "Generate a Markdown documentation summary for @$file. Print the
71
+ result to standard output." > "${file%.py}.md"
72
+ done
73
+ ```
74
+
75
+ 2. Make the script executable and run it in your directory:
76
+
77
+ ```bash
78
+ chmod +x generate_docs.sh
79
+ ./generate_docs.sh
80
+ ```
81
+
82
+ This creates a corresponding Markdown file for every Python file in the
83
+ folder.
84
+
85
+ ## Extract structured JSON data
86
+
87
+ When writing a script, you often need structured data (JSON) to pass to tools
88
+ like `jq`. To get pure JSON data from the model, combine the
89
+ `--output-format json` flag with `jq` to parse the response field.
90
+
91
+ ### Scenario: Extract and return structured data
92
+
93
+ 1. Save the following script as `generate_json.sh`:
94
+
95
+ ```bash
96
+ #!/bin/bash
97
+
98
+ # Ensure we are in a project root
99
+ if [ ! -f "package.json" ]; then
100
+ echo "Error: package.json not found."
101
+ exit 1
102
+ fi
103
+
104
+ # Extract data
105
+ gemini --output-format json "Return a raw JSON object with keys 'version' and 'deps' from @package.json" | jq -r '.response' > data.json
106
+ ```
107
+
108
+ 2. Run `generate_json.sh`:
109
+
110
+ ```bash
111
+ chmod +x generate_json.sh
112
+ ./generate_json.sh
113
+ ```
114
+
115
+ 3. Check `data.json`. The file should look like this:
116
+
117
+ ```json
118
+ {
119
+ "version": "1.0.0",
120
+ "deps": {
121
+ "react": "^18.2.0"
122
+ }
123
+ }
124
+ ```
125
+
126
+ ## Build your own custom AI tools
127
+
128
+ Use headless mode to perform custom, automated AI tasks.
129
+
130
+ ### Scenario: Create a "Smart Commit" alias
131
+
132
+ You can add a function to your shell configuration (like `.zshrc` or `.bashrc`)
133
+ to create a `git commit` wrapper that writes the message for you.
134
+
135
+ 1. Open your `.zshrc` file (or `.bashrc` if you use Bash) in your preferred
136
+ text editor.
137
+
138
+ ```bash
139
+ nano ~/.zshrc
140
+ ```
141
+
142
+ **Note**: If you use VS Code, you can run `code ~/.zshrc`.
143
+
144
+ 2. Scroll to the very bottom of the file and paste this code:
145
+
146
+ ```bash
147
+ function gcommit() {
148
+ # Get the diff of staged changes
149
+ diff=$(git diff --staged)
150
+
151
+ if [ -z "$diff" ]; then
152
+ echo "No staged changes to commit."
153
+ return 1
154
+ fi
155
+
156
+ # Ask Gemini to write the message
157
+ echo "Generating commit message..."
158
+ msg=$(echo "$diff" | gemini "Write a concise Conventional Commit message for this diff. Output ONLY the message.")
159
+
160
+ # Commit with the generated message
161
+ git commit -m "$msg"
162
+ }
163
+ ```
164
+
165
+ Save your file and exit.
166
+
167
+ 3. Run this command to make the function available immediately:
168
+
169
+ ```bash
170
+ source ~/.zshrc
171
+ ```
172
+
173
+ 4. Use your new command:
174
+
175
+ ```bash
176
+ gcommit
177
+ ```
178
+
179
+ Gemini CLI will analyze your staged changes and commit them with a generated
180
+ message.
181
+
182
+ ## Next steps
183
+
184
+ - Explore the [Headless mode reference](../../cli/headless.md) for full JSON
185
+ schema details.
186
+ - Learn about [Shell commands](shell-commands.md) to let the agent run scripts
187
+ instead of just writing them.
@@ -0,0 +1,142 @@
1
+ # File management with Gemini CLI
2
+
3
+ Explore, analyze, and modify your codebase using Gemini CLI. In this guide,
4
+ you'll learn how to provide Gemini CLI with files and directories, modify and
5
+ create files, and control what Gemini CLI can see.
6
+
7
+ ## Prerequisites
8
+
9
+ - Gemini CLI installed and authenticated.
10
+ - A project directory to work with (e.g., a git repository).
11
+
12
+ ## How to give the agent context (Reading files)
13
+
14
+ Gemini CLI will generally try to read relevant files, sometimes prompting you
15
+ for access (depending on your settings). To ensure that Gemini CLI uses a file,
16
+ you can also include it directly.
17
+
18
+ ### Direct file inclusion (`@`)
19
+
20
+ If you know the path to the file you want to work on, use the `@` symbol. This
21
+ forces the CLI to read the file immediately and inject its content into your
22
+ prompt.
23
+
24
+ ```bash
25
+ `@src/components/UserProfile.tsx Explain how this component handles user data.`
26
+ ```
27
+
28
+ ### Working with multiple files
29
+
30
+ Complex features often span multiple files. You can chain `@` references to give
31
+ the agent a complete picture of the dependencies.
32
+
33
+ ```bash
34
+ `@src/components/UserProfile.tsx @src/types/User.ts Refactor the component to use the updated User interface.`
35
+ ```
36
+
37
+ ### Including entire directories
38
+
39
+ For broad questions or refactoring, you can include an entire directory. Be
40
+ careful with large folders, as this consumes more tokens.
41
+
42
+ ```bash
43
+ `@src/utils/ Check these utility functions for any deprecated API usage.`
44
+ ```
45
+
46
+ ## How to find files (Exploration)
47
+
48
+ If you _don't_ know the exact file path, you can ask Gemini CLI to find it for
49
+ you. This is useful when navigating a new codebase or looking for specific
50
+ logic.
51
+
52
+ ### Scenario: Find a component definition
53
+
54
+ You know there's a `UserProfile` component, but you don't know where it lives.
55
+
56
+ ```none
57
+ `Find the file that defines the UserProfile component.`
58
+ ```
59
+
60
+ Gemini uses the `glob` or `list_directory` tools to search your project
61
+ structure. It will return the specific path (e.g.,
62
+ `src/components/UserProfile.tsx`), which you can then use with `@` in your next
63
+ turn.
64
+
65
+ > **Tip:** You can also ask for lists of files, like "Show me all the TypeScript
66
+ > configuration files in the root directory."
67
+
68
+ ## How to modify code
69
+
70
+ Once Gemini CLI has context, you can direct it to make specific edits. The agent
71
+ is capable of complex refactoring, not just simple text replacement.
72
+
73
+ ```none
74
+ `Update @src/components/UserProfile.tsx to show a loading spinner if the user data is null.`
75
+ ```
76
+
77
+ Gemini CLI uses the `replace` tool to propose a targeted code change.
78
+
79
+ ### Creating new files
80
+
81
+ You can also ask the agent to create entirely new files or folder structures.
82
+
83
+ ```none
84
+ `Create a new file @src/components/LoadingSpinner.tsx with a simple Tailwind CSS spinner.`
85
+ ```
86
+
87
+ Gemini CLI uses the `write_file` tool to generate the new file from scratch.
88
+
89
+ ## Review and confirm changes
90
+
91
+ Gemini CLI prioritizes safety. Before any file is modified, it presents a
92
+ unified diff of the proposed changes.
93
+
94
+ ```diff
95
+ - if (!user) return null;
96
+ + if (!user) return <LoadingSpinner />;
97
+ ```
98
+
99
+ - **Red lines (-):** Code that will be removed.
100
+ - **Green lines (+):** Code that will be added.
101
+
102
+ Press **y** to confirm and apply the change to your local file system. If the
103
+ diff doesn't look right, press **n** to cancel and refine your prompt.
104
+
105
+ ## Verify the result
106
+
107
+ After the edit is complete, verify the fix. You can simply read the file again
108
+ or, better yet, run your project's tests.
109
+
110
+ ```none
111
+ `Run the tests for the UserProfile component.`
112
+ ```
113
+
114
+ Gemini CLI uses the `run_shell_command` tool to execute your test runner (e.g.,
115
+ `npm test` or `jest`). This ensures the changes didn't break existing
116
+ functionality.
117
+
118
+ ## Advanced: Controlling what Gemini sees
119
+
120
+ By default, Gemini CLI respects your `.gitignore` file. It won't read or search
121
+ through `node_modules`, build artifacts, or other ignored paths.
122
+
123
+ If you have sensitive files (like `.env`) or large assets that you want to keep
124
+ hidden from the AI _without_ ignoring them in Git, you can create a
125
+ `.geminiignore` file in your project root.
126
+
127
+ **Example `.geminiignore`:**
128
+
129
+ ```text
130
+ .env
131
+ local-db-dump.sql
132
+ private-notes.md
133
+ ```
134
+
135
+ ## Next steps
136
+
137
+ - Learn how to [Manage context and memory](memory-management.md) to keep your
138
+ agent smarter over long sessions.
139
+ - See [Execute shell commands](shell-commands.md) for more on running tests and
140
+ builds.
141
+ - Explore the technical [File system reference](../../tools/file-system.md) for
142
+ advanced tool parameters.