@dgxo/mashadevcli 1.1.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 (140) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +393 -0
  3. package/bundle/builtin/skill-creator/SKILL.md +382 -0
  4. package/bundle/builtin/skill-creator/scripts/init_skill.cjs +239 -0
  5. package/bundle/builtin/skill-creator/scripts/package_skill.cjs +131 -0
  6. package/bundle/builtin/skill-creator/scripts/validate_skill.cjs +131 -0
  7. package/bundle/docs/CONTRIBUTING.md +1 -0
  8. package/bundle/docs/admin/enterprise-controls.md +115 -0
  9. package/bundle/docs/assets/connected_devtools.png +0 -0
  10. package/bundle/docs/assets/gemini-screenshot.png +0 -0
  11. package/bundle/docs/assets/monitoring-dashboard-logs.png +0 -0
  12. package/bundle/docs/assets/monitoring-dashboard-metrics.png +0 -0
  13. package/bundle/docs/assets/monitoring-dashboard-overview.png +0 -0
  14. package/bundle/docs/assets/release_patch.png +0 -0
  15. package/bundle/docs/assets/theme-ansi-light.png +0 -0
  16. package/bundle/docs/assets/theme-ansi.png +0 -0
  17. package/bundle/docs/assets/theme-atom-one.png +0 -0
  18. package/bundle/docs/assets/theme-ayu-light.png +0 -0
  19. package/bundle/docs/assets/theme-ayu.png +0 -0
  20. package/bundle/docs/assets/theme-custom.png +0 -0
  21. package/bundle/docs/assets/theme-default-light.png +0 -0
  22. package/bundle/docs/assets/theme-default.png +0 -0
  23. package/bundle/docs/assets/theme-dracula.png +0 -0
  24. package/bundle/docs/assets/theme-github-light.png +0 -0
  25. package/bundle/docs/assets/theme-github.png +0 -0
  26. package/bundle/docs/assets/theme-google-light.png +0 -0
  27. package/bundle/docs/assets/theme-xcode-light.png +0 -0
  28. package/bundle/docs/changelogs/index.md +867 -0
  29. package/bundle/docs/changelogs/latest.md +208 -0
  30. package/bundle/docs/changelogs/preview.md +187 -0
  31. package/bundle/docs/cli/checkpointing.md +93 -0
  32. package/bundle/docs/cli/cli-reference.md +115 -0
  33. package/bundle/docs/cli/creating-skills.md +80 -0
  34. package/bundle/docs/cli/custom-commands.md +327 -0
  35. package/bundle/docs/cli/enterprise.md +604 -0
  36. package/bundle/docs/cli/gemini-ignore.md +71 -0
  37. package/bundle/docs/cli/gemini-md.md +116 -0
  38. package/bundle/docs/cli/generation-settings.md +210 -0
  39. package/bundle/docs/cli/headless.md +50 -0
  40. package/bundle/docs/cli/model-routing.md +42 -0
  41. package/bundle/docs/cli/model.md +53 -0
  42. package/bundle/docs/cli/plan-mode.md +375 -0
  43. package/bundle/docs/cli/rewind.md +51 -0
  44. package/bundle/docs/cli/sandbox.md +257 -0
  45. package/bundle/docs/cli/session-management.md +184 -0
  46. package/bundle/docs/cli/settings.md +165 -0
  47. package/bundle/docs/cli/skills.md +134 -0
  48. package/bundle/docs/cli/system-prompt.md +125 -0
  49. package/bundle/docs/cli/telemetry.md +922 -0
  50. package/bundle/docs/cli/themes.md +269 -0
  51. package/bundle/docs/cli/token-caching.md +20 -0
  52. package/bundle/docs/cli/trusted-folders.md +126 -0
  53. package/bundle/docs/cli/tutorials/automation.md +283 -0
  54. package/bundle/docs/cli/tutorials/file-management.md +142 -0
  55. package/bundle/docs/cli/tutorials/mcp-setup.md +113 -0
  56. package/bundle/docs/cli/tutorials/memory-management.md +126 -0
  57. package/bundle/docs/cli/tutorials/session-management.md +105 -0
  58. package/bundle/docs/cli/tutorials/shell-commands.md +107 -0
  59. package/bundle/docs/cli/tutorials/skills-getting-started.md +110 -0
  60. package/bundle/docs/cli/tutorials/task-planning.md +93 -0
  61. package/bundle/docs/cli/tutorials/web-tools.md +78 -0
  62. package/bundle/docs/core/index.md +107 -0
  63. package/bundle/docs/core/remote-agents.md +84 -0
  64. package/bundle/docs/core/subagents.md +307 -0
  65. package/bundle/docs/examples/proxy-script.md +83 -0
  66. package/bundle/docs/extensions/best-practices.md +188 -0
  67. package/bundle/docs/extensions/index.md +61 -0
  68. package/bundle/docs/extensions/reference.md +333 -0
  69. package/bundle/docs/extensions/releasing.md +154 -0
  70. package/bundle/docs/extensions/writing-extensions.md +308 -0
  71. package/bundle/docs/get-started/authentication.md +402 -0
  72. package/bundle/docs/get-started/examples.md +139 -0
  73. package/bundle/docs/get-started/gemini-3.md +115 -0
  74. package/bundle/docs/get-started/index.md +82 -0
  75. package/bundle/docs/get-started/installation.md +174 -0
  76. package/bundle/docs/hooks/best-practices.md +709 -0
  77. package/bundle/docs/hooks/index.md +164 -0
  78. package/bundle/docs/hooks/reference.md +330 -0
  79. package/bundle/docs/hooks/writing-hooks.md +474 -0
  80. package/bundle/docs/ide-integration/ide-companion-spec.md +267 -0
  81. package/bundle/docs/ide-integration/index.md +224 -0
  82. package/bundle/docs/index.md +141 -0
  83. package/bundle/docs/integration-tests.md +211 -0
  84. package/bundle/docs/issue-and-pr-automation.md +172 -0
  85. package/bundle/docs/local-development.md +134 -0
  86. package/bundle/docs/mermaid/context.mmd +103 -0
  87. package/bundle/docs/mermaid/render-path.mmd +64 -0
  88. package/bundle/docs/npm.md +62 -0
  89. package/bundle/docs/redirects.json +20 -0
  90. package/bundle/docs/reference/commands.md +526 -0
  91. package/bundle/docs/reference/configuration.md +1786 -0
  92. package/bundle/docs/reference/keyboard-shortcuts.md +164 -0
  93. package/bundle/docs/reference/memport.md +246 -0
  94. package/bundle/docs/reference/policy-engine.md +364 -0
  95. package/bundle/docs/reference/tools.md +106 -0
  96. package/bundle/docs/release-confidence.md +164 -0
  97. package/bundle/docs/releases.md +540 -0
  98. package/bundle/docs/resources/faq.md +175 -0
  99. package/bundle/docs/resources/quota-and-pricing.md +165 -0
  100. package/bundle/docs/resources/tos-privacy.md +102 -0
  101. package/bundle/docs/resources/troubleshooting.md +176 -0
  102. package/bundle/docs/resources/uninstall.md +56 -0
  103. package/bundle/docs/sidebar.json +233 -0
  104. package/bundle/docs/tools/activate-skill.md +43 -0
  105. package/bundle/docs/tools/ask-user.md +95 -0
  106. package/bundle/docs/tools/file-system.md +129 -0
  107. package/bundle/docs/tools/internal-docs.md +46 -0
  108. package/bundle/docs/tools/mcp-server.md +1150 -0
  109. package/bundle/docs/tools/memory.md +35 -0
  110. package/bundle/docs/tools/planning.md +58 -0
  111. package/bundle/docs/tools/shell.md +216 -0
  112. package/bundle/docs/tools/todos.md +35 -0
  113. package/bundle/docs/tools/web-fetch.md +35 -0
  114. package/bundle/docs/tools/web-search.md +32 -0
  115. package/bundle/docs/update/update-guide.md +111 -0
  116. package/bundle/masha.js +563471 -0
  117. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/client/main.js +89 -0
  118. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/_client-assets.d.ts +7 -0
  119. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/_client-assets.js +9 -0
  120. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/_client-assets.js.map +1 -0
  121. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/index.d.ts +48 -0
  122. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/index.js +299 -0
  123. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/index.js.map +1 -0
  124. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/types.d.ts +36 -0
  125. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/types.js +7 -0
  126. package/bundle/node_modules/@dgxo/mashadevcli-devtools/dist/src/types.js.map +1 -0
  127. package/bundle/node_modules/@dgxo/mashadevcli-devtools/package.json +32 -0
  128. package/bundle/policies/conseca.toml +6 -0
  129. package/bundle/policies/discovered.toml +8 -0
  130. package/bundle/policies/plan.toml +109 -0
  131. package/bundle/policies/read-only.toml +53 -0
  132. package/bundle/policies/write.toml +80 -0
  133. package/bundle/policies/yolo.toml +54 -0
  134. package/bundle/sandbox-macos-permissive-open.sb +27 -0
  135. package/bundle/sandbox-macos-permissive-proxied.sb +37 -0
  136. package/bundle/sandbox-macos-restrictive-open.sb +96 -0
  137. package/bundle/sandbox-macos-restrictive-proxied.sb +98 -0
  138. package/bundle/sandbox-macos-strict-open.sb +131 -0
  139. package/bundle/sandbox-macos-strict-proxied.sb +133 -0
  140. package/package.json +169 -0
@@ -0,0 +1,267 @@
1
+ # Gemini CLI companion plugin: Interface specification
2
+
3
+ > Last Updated: September 15, 2025
4
+
5
+ This document defines the contract for building a companion plugin to enable
6
+ Gemini CLI's IDE mode. For VS Code, these features (native diffing, context
7
+ awareness) are provided by the official extension
8
+ ([marketplace](https://marketplace.visualstudio.com/items?itemName=Google.@dgxo/mashadevcli-vscode)).
9
+ This specification is for contributors who wish to bring similar functionality
10
+ to other editors like JetBrains IDEs, Sublime Text, etc.
11
+
12
+ ## I. The communication interface
13
+
14
+ Gemini CLI and the IDE plugin communicate through a local communication channel.
15
+
16
+ ### 1. Transport layer: MCP over HTTP
17
+
18
+ The plugin **MUST** run a local HTTP server that implements the **Model Context
19
+ Protocol (MCP)**.
20
+
21
+ - **Protocol:** The server must be a valid MCP server. We recommend using an
22
+ existing MCP SDK for your language of choice if available.
23
+ - **Endpoint:** The server should expose a single endpoint (e.g., `/mcp`) for
24
+ all MCP communication.
25
+ - **Port:** The server **MUST** listen on a dynamically assigned port (i.e.,
26
+ listen on port `0`).
27
+
28
+ ### 2. Discovery mechanism: The port file
29
+
30
+ For Gemini CLI to connect, it needs to discover which IDE instance it's running
31
+ in and what port your server is using. The plugin **MUST** facilitate this by
32
+ creating a "discovery file."
33
+
34
+ - **How the CLI finds the file:** The CLI determines the Process ID (PID) of the
35
+ IDE it's running in by traversing the process tree. It then looks for a
36
+ discovery file that contains this PID in its name.
37
+ - **File location:** The file must be created in a specific directory:
38
+ `os.tmpdir()/gemini/ide/`. Your plugin must create this directory if it
39
+ doesn't exist.
40
+ - **File naming convention:** The filename is critical and **MUST** follow the
41
+ pattern: `gemini-ide-server-${PID}-${PORT}.json`
42
+ - `${PID}`: The process ID of the parent IDE process. Your plugin must
43
+ determine this PID and include it in the filename.
44
+ - `${PORT}`: The port your MCP server is listening on.
45
+ - **File content and workspace validation:** The file **MUST** contain a JSON
46
+ object with the following structure:
47
+
48
+ ```json
49
+ {
50
+ "port": 12345,
51
+ "workspacePath": "/path/to/project1:/path/to/project2",
52
+ "authToken": "a-very-secret-token",
53
+ "ideInfo": {
54
+ "name": "vscode",
55
+ "displayName": "VS Code"
56
+ }
57
+ }
58
+ ```
59
+ - `port` (number, required): The port of the MCP server.
60
+ - `workspacePath` (string, required): A list of all open workspace root paths,
61
+ delimited by the OS-specific path separator (`:` for Linux/macOS, `;` for
62
+ Windows). The CLI uses this path to ensure it's running in the same project
63
+ folder that's open in the IDE. If the CLI's current working directory is not
64
+ a sub-directory of `workspacePath`, the connection will be rejected. Your
65
+ plugin **MUST** provide the correct, absolute path(s) to the root of the
66
+ open workspace(s).
67
+ - `authToken` (string, required): A secret token for securing the connection.
68
+ The CLI will include this token in an `Authorization: Bearer <token>` header
69
+ on all requests.
70
+ - `ideInfo` (object, required): Information about the IDE.
71
+ - `name` (string, required): A short, lowercase identifier for the IDE
72
+ (e.g., `vscode`, `jetbrains`).
73
+ - `displayName` (string, required): A user-friendly name for the IDE (e.g.,
74
+ `VS Code`, `JetBrains IDE`).
75
+
76
+ - **Authentication:** To secure the connection, the plugin **MUST** generate a
77
+ unique, secret token and include it in the discovery file. The CLI will then
78
+ include this token in the `Authorization` header for all requests to the MCP
79
+ server (e.g., `Authorization: Bearer a-very-secret-token`). Your server
80
+ **MUST** validate this token on every request and reject any that are
81
+ unauthorized.
82
+ - **Tie-breaking with environment variables (recommended):** For the most
83
+ reliable experience, your plugin **SHOULD** both create the discovery file and
84
+ set the `GEMINI_CLI_IDE_SERVER_PORT` environment variable in the integrated
85
+ terminal. The file serves as the primary discovery mechanism, but the
86
+ environment variable is crucial for tie-breaking. If a user has multiple IDE
87
+ windows open for the same workspace, the CLI uses the
88
+ `GEMINI_CLI_IDE_SERVER_PORT` variable to identify and connect to the correct
89
+ window's server.
90
+
91
+ ## II. The context interface
92
+
93
+ To enable context awareness, the plugin **MAY** provide the CLI with real-time
94
+ information about the user's activity in the IDE.
95
+
96
+ ### `ide/contextUpdate` notification
97
+
98
+ The plugin **MAY** send an `ide/contextUpdate`
99
+ [notification](https://modelcontextprotocol.io/specification/2025-06-18/basic/index#notifications)
100
+ to the CLI whenever the user's context changes.
101
+
102
+ - **Triggering events:** This notification should be sent (with a recommended
103
+ debounce of 50ms) when:
104
+ - A file is opened, closed, or focused.
105
+ - The user's cursor position or text selection changes in the active file.
106
+ - **Payload (`IdeContext`):** The notification parameters **MUST** be an
107
+ `IdeContext` object:
108
+
109
+ ```typescript
110
+ interface IdeContext {
111
+ workspaceState?: {
112
+ openFiles?: File[];
113
+ isTrusted?: boolean;
114
+ };
115
+ }
116
+
117
+ interface File {
118
+ // Absolute path to the file
119
+ path: string;
120
+ // Last focused Unix timestamp (for ordering)
121
+ timestamp: number;
122
+ // True if this is the currently focused file
123
+ isActive?: boolean;
124
+ cursor?: {
125
+ // 1-based line number
126
+ line: number;
127
+ // 1-based character number
128
+ character: number;
129
+ };
130
+ // The text currently selected by the user
131
+ selectedText?: string;
132
+ }
133
+ ```
134
+
135
+ **Note:** The `openFiles` list should only include files that exist on disk.
136
+ Virtual files (e.g., unsaved files without a path, editor settings pages)
137
+ **MUST** be excluded.
138
+
139
+ ### How the CLI uses this context
140
+
141
+ After receiving the `IdeContext` object, the CLI performs several normalization
142
+ and truncation steps before sending the information to the model.
143
+
144
+ - **File ordering:** The CLI uses the `timestamp` field to determine the most
145
+ recently used files. It sorts the `openFiles` list based on this value.
146
+ Therefore, your plugin **MUST** provide an accurate Unix timestamp for when a
147
+ file was last focused.
148
+ - **Active file:** The CLI considers only the most recent file (after sorting)
149
+ to be the "active" file. It will ignore the `isActive` flag on all other files
150
+ and clear their `cursor` and `selectedText` fields. Your plugin should focus
151
+ on setting `isActive: true` and providing cursor/selection details only for
152
+ the currently focused file.
153
+ - **Truncation:** To manage token limits, the CLI truncates both the file list
154
+ (to 10 files) and the `selectedText` (to 16KB).
155
+
156
+ While the CLI handles the final truncation, it is highly recommended that your
157
+ plugin also limits the amount of context it sends.
158
+
159
+ ## III. The diffing interface
160
+
161
+ To enable interactive code modifications, the plugin **MAY** expose a diffing
162
+ interface. This allows the CLI to request that the IDE open a diff view, showing
163
+ proposed changes to a file. The user can then review, edit, and ultimately
164
+ accept or reject these changes directly within the IDE.
165
+
166
+ ### `openDiff` tool
167
+
168
+ The plugin **MUST** register an `openDiff` tool on its MCP server.
169
+
170
+ - **Description:** This tool instructs the IDE to open a modifiable diff view
171
+ for a specific file.
172
+ - **Request (`OpenDiffRequest`):** The tool is invoked via a `tools/call`
173
+ request. The `arguments` field within the request's `params` **MUST** be an
174
+ `OpenDiffRequest` object.
175
+
176
+ ```typescript
177
+ interface OpenDiffRequest {
178
+ // The absolute path to the file to be diffed.
179
+ filePath: string;
180
+ // The proposed new content for the file.
181
+ newContent: string;
182
+ }
183
+ ```
184
+
185
+ - **Response (`CallToolResult`):** The tool **MUST** immediately return a
186
+ `CallToolResult` to acknowledge the request and report whether the diff view
187
+ was successfully opened.
188
+ - On Success: If the diff view was opened successfully, the response **MUST**
189
+ contain empty content (i.e., `content: []`).
190
+ - On Failure: If an error prevented the diff view from opening, the response
191
+ **MUST** have `isError: true` and include a `TextContent` block in the
192
+ `content` array describing the error.
193
+
194
+ The actual outcome of the diff (acceptance or rejection) is communicated
195
+ asynchronously via notifications.
196
+
197
+ ### `closeDiff` tool
198
+
199
+ The plugin **MUST** register a `closeDiff` tool on its MCP server.
200
+
201
+ - **Description:** This tool instructs the IDE to close an open diff view for a
202
+ specific file.
203
+ - **Request (`CloseDiffRequest`):** The tool is invoked via a `tools/call`
204
+ request. The `arguments` field within the request's `params` **MUST** be an
205
+ `CloseDiffRequest` object.
206
+
207
+ ```typescript
208
+ interface CloseDiffRequest {
209
+ // The absolute path to the file whose diff view should be closed.
210
+ filePath: string;
211
+ }
212
+ ```
213
+
214
+ - **Response (`CallToolResult`):** The tool **MUST** return a `CallToolResult`.
215
+ - On Success: If the diff view was closed successfully, the response **MUST**
216
+ include a single **TextContent** block in the content array containing the
217
+ file's final content before closing.
218
+ - On Failure: If an error prevented the diff view from closing, the response
219
+ **MUST** have `isError: true` and include a `TextContent` block in the
220
+ `content` array describing the error.
221
+
222
+ ### `ide/diffAccepted` notification
223
+
224
+ When the user accepts the changes in a diff view (e.g., by clicking an "Apply"
225
+ or "Save" button), the plugin **MUST** send an `ide/diffAccepted` notification
226
+ to the CLI.
227
+
228
+ - **Payload:** The notification parameters **MUST** include the file path and
229
+ the final content of the file. The content may differ from the original
230
+ `newContent` if the user made manual edits in the diff view.
231
+
232
+ ```typescript
233
+ {
234
+ // The absolute path to the file that was diffed.
235
+ filePath: string;
236
+ // The full content of the file after acceptance.
237
+ content: string;
238
+ }
239
+ ```
240
+
241
+ ### `ide/diffRejected` notification
242
+
243
+ When the user rejects the changes (e.g., by closing the diff view without
244
+ accepting), the plugin **MUST** send an `ide/diffRejected` notification to the
245
+ CLI.
246
+
247
+ - **Payload:** The notification parameters **MUST** include the file path of the
248
+ rejected diff.
249
+
250
+ ```typescript
251
+ {
252
+ // The absolute path to the file that was diffed.
253
+ filePath: string;
254
+ }
255
+ ```
256
+
257
+ ## IV. The lifecycle interface
258
+
259
+ The plugin **MUST** manage its resources and the discovery file correctly based
260
+ on the IDE's lifecycle.
261
+
262
+ - **On activation (IDE startup/plugin enabled):**
263
+ 1. Start the MCP server.
264
+ 2. Create the discovery file.
265
+ - **On deactivation (IDE shutdown/plugin disabled):**
266
+ 1. Stop the MCP server.
267
+ 2. Delete the discovery file.
@@ -0,0 +1,224 @@
1
+ # IDE integration
2
+
3
+ Gemini CLI can integrate with your IDE to provide a more seamless and
4
+ context-aware experience. This integration allows the CLI to understand your
5
+ workspace better and enables powerful features like native in-editor diffing.
6
+
7
+ Currently, the supported IDEs are [Antigravity](https://antigravity.google),
8
+ [Visual Studio Code](https://code.visualstudio.com/), and other editors that
9
+ support VS Code extensions. To build support for other editors, see the
10
+ [IDE Companion Extension Spec](./ide-companion-spec.md).
11
+
12
+ ## Features
13
+
14
+ - **Workspace context:** The CLI automatically gains awareness of your workspace
15
+ to provide more relevant and accurate responses. This context includes:
16
+ - The **10 most recently accessed files** in your workspace.
17
+ - Your active cursor position.
18
+ - Any text you have selected (up to a 16KB limit; longer selections will be
19
+ truncated).
20
+
21
+ - **Native diffing:** When Gemini suggests code modifications, you can view the
22
+ changes directly within your IDE's native diff viewer. This allows you to
23
+ review, edit, and accept or reject the suggested changes seamlessly.
24
+
25
+ - **VS Code commands:** You can access Gemini CLI features directly from the VS
26
+ Code Command Palette (`Cmd+Shift+P` or `Ctrl+Shift+P`):
27
+ - `Gemini CLI: Run`: Starts a new Gemini CLI session in the integrated
28
+ terminal.
29
+ - `Gemini CLI: Accept Diff`: Accepts the changes in the active diff editor.
30
+ - `Gemini CLI: Close Diff Editor`: Rejects the changes and closes the active
31
+ diff editor.
32
+ - `Gemini CLI: View Third-Party Notices`: Displays the third-party notices for
33
+ the extension.
34
+
35
+ ## Installation and setup
36
+
37
+ There are three ways to set up the IDE integration:
38
+
39
+ ### 1. Automatic nudge (recommended)
40
+
41
+ When you run Gemini CLI inside a supported editor, it will automatically detect
42
+ your environment and prompt you to connect. Answering "Yes" will automatically
43
+ run the necessary setup, which includes installing the companion extension and
44
+ enabling the connection.
45
+
46
+ ### 2. Manual installation from CLI
47
+
48
+ If you previously dismissed the prompt or want to install the extension
49
+ manually, you can run the following command inside Gemini CLI:
50
+
51
+ ```
52
+ /ide install
53
+ ```
54
+
55
+ This will find the correct extension for your IDE and install it.
56
+
57
+ ### 3. Manual installation from a marketplace
58
+
59
+ You can also install the extension directly from a marketplace.
60
+
61
+ - **For Visual Studio Code:** Install from the
62
+ [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=google.@dgxo/mashadevcli-vscode).
63
+ - **For VS Code forks:** To support forks of VS Code, the extension is also
64
+ published on the
65
+ [Open VSX Registry](https://open-vsx.org/extension/google/@dgxo/mashadevcli-vscode).
66
+ Follow your editor's instructions for installing extensions from this
67
+ registry.
68
+
69
+ > NOTE: The "Gemini CLI Companion" extension may appear towards the bottom of
70
+ > search results. If you don't see it immediately, try scrolling down or sorting
71
+ > by "Newly Published".
72
+ >
73
+ > After manually installing the extension, you must run `/ide enable` in the CLI
74
+ > to activate the integration.
75
+
76
+ ## Usage
77
+
78
+ ### Enabling and disabling
79
+
80
+ You can control the IDE integration from within the CLI:
81
+
82
+ - To enable the connection to the IDE, run:
83
+ ```
84
+ /ide enable
85
+ ```
86
+ - To disable the connection, run:
87
+ ```
88
+ /ide disable
89
+ ```
90
+
91
+ When enabled, Gemini CLI will automatically attempt to connect to the IDE
92
+ companion extension.
93
+
94
+ ### Checking the status
95
+
96
+ To check the connection status and see the context the CLI has received from the
97
+ IDE, run:
98
+
99
+ ```
100
+ /ide status
101
+ ```
102
+
103
+ If connected, this command will show the IDE it's connected to and a list of
104
+ recently opened files it is aware of.
105
+
106
+ > [!NOTE] The file list is limited to 10 recently accessed files within your
107
+ > workspace and only includes local files on disk.)
108
+
109
+ ### Working with diffs
110
+
111
+ When you ask Gemini to modify a file, it can open a diff view directly in your
112
+ editor.
113
+
114
+ **To accept a diff**, you can perform any of the following actions:
115
+
116
+ - Click the **checkmark icon** in the diff editor's title bar.
117
+ - Save the file (e.g., with `Cmd+S` or `Ctrl+S`).
118
+ - Open the Command Palette and run **Gemini CLI: Accept Diff**.
119
+ - Respond with `yes` in the CLI when prompted.
120
+
121
+ **To reject a diff**, you can:
122
+
123
+ - Click the **'x' icon** in the diff editor's title bar.
124
+ - Close the diff editor tab.
125
+ - Open the Command Palette and run **Gemini CLI: Close Diff Editor**.
126
+ - Respond with `no` in the CLI when prompted.
127
+
128
+ You can also **modify the suggested changes** directly in the diff view before
129
+ accepting them.
130
+
131
+ If you select ‘Allow for this session’ in the CLI, changes will no longer show
132
+ up in the IDE as they will be auto-accepted.
133
+
134
+ ## Using with sandboxing
135
+
136
+ If you are using Gemini CLI within a sandbox, please be aware of the following:
137
+
138
+ - **On macOS:** The IDE integration requires network access to communicate with
139
+ the IDE companion extension. You must use a Seatbelt profile that allows
140
+ network access.
141
+ - **In a Docker container:** If you run Gemini CLI inside a Docker (or Podman)
142
+ container, the IDE integration can still connect to the VS Code extension
143
+ running on your host machine. The CLI is configured to automatically find the
144
+ IDE server on `host.docker.internal`. No special configuration is usually
145
+ required, but you may need to ensure your Docker networking setup allows
146
+ connections from the container to the host.
147
+
148
+ ## Troubleshooting
149
+
150
+ If you encounter issues with IDE integration, here are some common error
151
+ messages and how to resolve them.
152
+
153
+ ### Connection errors
154
+
155
+ - **Message:**
156
+ `🔴 Disconnected: Failed to connect to IDE companion extension in [IDE Name]. Please ensure the extension is running. To install the extension, run /ide install.`
157
+ - **Cause:** Gemini CLI could not find the necessary environment variables
158
+ (`GEMINI_CLI_IDE_WORKSPACE_PATH` or `GEMINI_CLI_IDE_SERVER_PORT`) to connect
159
+ to the IDE. This usually means the IDE companion extension is not running or
160
+ did not initialize correctly.
161
+ - **Solution:**
162
+ 1. Make sure you have installed the **Gemini CLI Companion** extension in
163
+ your IDE and that it is enabled.
164
+ 2. Open a new terminal window in your IDE to ensure it picks up the correct
165
+ environment.
166
+
167
+ - **Message:**
168
+ `🔴 Disconnected: IDE connection error. The connection was lost unexpectedly. Please try reconnecting by running /ide enable`
169
+ - **Cause:** The connection to the IDE companion was lost.
170
+ - **Solution:** Run `/ide enable` to try and reconnect. If the issue
171
+ continues, open a new terminal window or restart your IDE.
172
+
173
+ ### Manual PID override
174
+
175
+ If automatic IDE detection fails, or if you are running Gemini CLI in a
176
+ standalone terminal and want to manually associate it with a specific IDE
177
+ instance, you can set the `GEMINI_CLI_IDE_PID` environment variable to the
178
+ process ID (PID) of your IDE.
179
+
180
+ **macOS/Linux**
181
+
182
+ ```bash
183
+ export GEMINI_CLI_IDE_PID=12345
184
+ ```
185
+
186
+ **Windows (PowerShell)**
187
+
188
+ ```powershell
189
+ $env:GEMINI_CLI_IDE_PID=12345
190
+ ```
191
+
192
+ When this variable is set, Gemini CLI will skip automatic detection and attempt
193
+ to connect using the provided PID.
194
+
195
+ ### Configuration errors
196
+
197
+ - **Message:**
198
+ `🔴 Disconnected: Directory mismatch. Gemini CLI is running in a different location than the open workspace in [IDE Name]. Please run the CLI from one of the following directories: [List of directories]`
199
+ - **Cause:** The CLI's current working directory is outside the workspace you
200
+ have open in your IDE.
201
+ - **Solution:** `cd` into the same directory that is open in your IDE and
202
+ restart the CLI.
203
+
204
+ - **Message:**
205
+ `🔴 Disconnected: To use this feature, please open a workspace folder in [IDE Name] and try again.`
206
+ - **Cause:** You have no workspace open in your IDE.
207
+ - **Solution:** Open a workspace in your IDE and restart the CLI.
208
+
209
+ ### General errors
210
+
211
+ - **Message:**
212
+ `IDE integration is not supported in your current environment. To use this feature, run Gemini CLI in one of these supported IDEs: [List of IDEs]`
213
+ - **Cause:** You are running Gemini CLI in a terminal or environment that is
214
+ not a supported IDE.
215
+ - **Solution:** Run Gemini CLI from the integrated terminal of a supported
216
+ IDE, like Antigravity or VS Code.
217
+
218
+ - **Message:**
219
+ `No installer is available for IDE. Please install the Gemini CLI Companion extension manually from the marketplace.`
220
+ - **Cause:** You ran `/ide install`, but the CLI does not have an automated
221
+ installer for your specific IDE.
222
+ - **Solution:** Open your IDE's extension marketplace, search for "Gemini CLI
223
+ Companion", and
224
+ [install it manually](#3-manual-installation-from-a-marketplace).
@@ -0,0 +1,141 @@
1
+ # Gemini CLI documentation
2
+
3
+ Gemini CLI brings the power of Gemini models directly into your terminal. Use it
4
+ to understand code, automate tasks, and build workflows with your local project
5
+ context.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g @dgxo/mashadevcli
11
+ ```
12
+
13
+ ## Get started
14
+
15
+ Jump in to Gemini CLI.
16
+
17
+ - **[Quickstart](./get-started/index.md):** Your first session with Gemini CLI.
18
+ - **[Installation](./get-started/installation.md):** How to install Gemini CLI
19
+ on your system.
20
+ - **[Authentication](./get-started/authentication.md):** Setup instructions for
21
+ personal and enterprise accounts.
22
+ - **[Examples](./get-started/examples.md):** Practical examples of Gemini CLI in
23
+ action.
24
+ - **[CLI cheatsheet](./cli/cli-reference.md):** A quick reference for common
25
+ commands and options.
26
+ - **[Gemini 3 on Gemini CLI](./get-started/gemini-3.md):** Learn about Gemini 3
27
+ support in Gemini CLI.
28
+
29
+ ## Use Gemini CLI
30
+
31
+ User-focused guides and tutorials for daily development workflows.
32
+
33
+ - **[File management](./cli/tutorials/file-management.md):** How to work with
34
+ local files and directories.
35
+ - **[Get started with Agent skills](./cli/tutorials/skills-getting-started.md):**
36
+ Getting started with specialized expertise.
37
+ - **[Manage context and memory](./cli/tutorials/memory-management.md):**
38
+ Managing persistent instructions and facts.
39
+ - **[Execute shell commands](./cli/tutorials/shell-commands.md):** Executing
40
+ system commands safely.
41
+ - **[Manage sessions and history](./cli/tutorials/session-management.md):**
42
+ Resuming, managing, and rewinding conversations.
43
+ - **[Plan tasks with todos](./cli/tutorials/task-planning.md):** Using todos for
44
+ complex workflows.
45
+ - **[Web search and fetch](./cli/tutorials/web-tools.md):** Searching and
46
+ fetching content from the web.
47
+ - **[Set up an MCP server](./cli/tutorials/mcp-setup.md):** Set up an MCP
48
+ server.
49
+ - **[Automate tasks](./cli/tutorials/automation.md):** Automate tasks.
50
+
51
+ ## Features
52
+
53
+ Technical documentation for each capability of Gemini CLI.
54
+
55
+ - **[Extensions](./extensions/index.md):** Extend Gemini CLI with new tools and
56
+ capabilities.
57
+ - **[Agent Skills](./cli/skills.md):** Use specialized agents for specific
58
+ tasks.
59
+ - **[Checkpointing](./cli/checkpointing.md):** Automatic session snapshots.
60
+ - **[Headless mode](./cli/headless.md):** Programmatic and scripting interface.
61
+ - **[Hooks](./hooks/index.md):** Customize Gemini CLI behavior with scripts.
62
+ - **[IDE integration](./ide-integration/index.md):** Integrate Gemini CLI with
63
+ your favorite IDE.
64
+ - **[MCP servers](./tools/mcp-server.md):** Connect to and use remote agents.
65
+ - **[Model routing](./cli/model-routing.md):** Automatic fallback resilience.
66
+ - **[Model selection](./cli/model.md):** Choose the best model for your needs.
67
+ - **[Plan mode 🔬](./cli/plan-mode.md):** Use a safe, read-only mode for
68
+ planning complex changes.
69
+ - **[Subagents 🔬](./core/subagents.md):** Using specialized agents for specific
70
+ tasks.
71
+ - **[Remote subagents 🔬](./core/remote-agents.md):** Connecting to and using
72
+ remote agents.
73
+ - **[Rewind](./cli/rewind.md):** Rewind and replay sessions.
74
+ - **[Sandboxing](./cli/sandbox.md):** Isolate tool execution.
75
+ - **[Settings](./cli/settings.md):** Full configuration reference.
76
+ - **[Telemetry](./cli/telemetry.md):** Usage and performance metric details.
77
+ - **[Token caching](./cli/token-caching.md):** Performance optimization.
78
+
79
+ ## Configuration
80
+
81
+ Settings and customization options for Gemini CLI.
82
+
83
+ - **[Custom commands](./cli/custom-commands.md):** Personalized shortcuts.
84
+ - **[Enterprise configuration](./cli/enterprise.md):** Professional environment
85
+ controls.
86
+ - **[Ignore files (.geminiignore)](./cli/gemini-ignore.md):** Exclusion pattern
87
+ reference.
88
+ - **[Model configuration](./cli/generation-settings.md):** Fine-tune generation
89
+ parameters like temperature and thinking budget.
90
+ - **[Project context (GEMINI.md)](./cli/gemini-md.md):** Technical hierarchy of
91
+ context files.
92
+ - **[System prompt override](./cli/system-prompt.md):** Instruction replacement
93
+ logic.
94
+ - **[Themes](./cli/themes.md):** UI personalization technical guide.
95
+ - **[Trusted folders](./cli/trusted-folders.md):** Security permission logic.
96
+
97
+ ## Reference
98
+
99
+ Deep technical documentation and API specifications.
100
+
101
+ - **[Command reference](./reference/commands.md):** Detailed slash command
102
+ guide.
103
+ - **[Configuration reference](./reference/configuration.md):** Settings and
104
+ environment variables.
105
+ - **[Keyboard shortcuts](./reference/keyboard-shortcuts.md):** Productivity
106
+ tips.
107
+ - **[Memory import processor](./reference/memport.md):** How Gemini CLI
108
+ processes memory from various sources.
109
+ - **[Policy engine](./reference/policy-engine.md):** Fine-grained execution
110
+ control.
111
+ - **[Tools reference](./reference/tools.md):** Information on how tools are
112
+ defined, registered, and used.
113
+
114
+ ## Resources
115
+
116
+ Support, release history, and legal information.
117
+
118
+ - **[FAQ](./resources/faq.md):** Answers to frequently asked questions.
119
+ - **[Quota and pricing](./resources/quota-and-pricing.md):** Limits and billing
120
+ details.
121
+ - **[Terms and privacy](./resources/tos-privacy.md):** Official notices and
122
+ terms.
123
+ - **[Troubleshooting](./resources/troubleshooting.md):** Common issues and
124
+ solutions.
125
+ - **[Uninstall](./resources/uninstall.md):** How to uninstall Gemini CLI.
126
+
127
+ ## Development
128
+
129
+ - **[Contribution guide](/docs/contributing):** How to contribute to Gemini CLI.
130
+ - **[Integration testing](./integration-tests.md):** Running integration tests.
131
+ - **[Issue and PR automation](./issue-and-pr-automation.md):** Automation for
132
+ issues and pull requests.
133
+ - **[Local development](./local-development.md):** Setting up a local
134
+ development environment.
135
+ - **[NPM package structure](./npm.md):** The structure of the NPM packages.
136
+
137
+ ## Releases
138
+
139
+ - **[Release notes](./changelogs/index.md):** Release notes for all versions.
140
+ - **[Stable release](./changelogs/latest.md):** The latest stable release.
141
+ - **[Preview release](./changelogs/preview.md):** The latest preview release.