Merge branch 'main' into chore/sync-gemini-cli-v0.3.4

This commit is contained in:
mingholy.lmh
2025-09-15 13:42:42 +08:00
123 changed files with 13595 additions and 1237 deletions

View File

@@ -1,6 +1,6 @@
# IDE Integration
Gemini CLI can integrate with your IDE to provide a more seamless and context-aware experience. This integration allows the CLI to understand your workspace better and enables powerful features like native in-editor diffing.
Qwen Code can integrate with your IDE to provide a more seamless and context-aware experience. This integration allows the CLI to understand your workspace better and enables powerful features like native in-editor diffing.
Currently, the only supported IDE is [Visual Studio Code](https://code.visualstudio.com/) and other editors that support VS Code extensions.
@@ -11,13 +11,13 @@ Currently, the only supported IDE is [Visual Studio Code](https://code.visualstu
- Your active cursor position.
- Any text you have selected (up to a 16KB limit; longer selections will be truncated).
- **Native Diffing:** When Gemini suggests code modifications, you can view the changes directly within your IDE's native diff viewer. This allows you to review, edit, and accept or reject the suggested changes seamlessly.
- **Native Diffing:** When Qwen suggests code modifications, you can view the changes directly within your IDE's native diff viewer. This allows you to review, edit, and accept or reject the suggested changes seamlessly.
- **VS Code Commands:** You can access Gemini CLI features directly from the VS Code Command Palette (`Cmd+Shift+P` or `Ctrl+Shift+P`):
- `Gemini CLI: Run`: Starts a new Gemini CLI session in the integrated terminal.
- `Gemini CLI: Accept Diff`: Accepts the changes in the active diff editor.
- `Gemini CLI: Close Diff Editor`: Rejects the changes and closes the active diff editor.
- `Gemini CLI: View Third-Party Notices`: Displays the third-party notices for the extension.
- **VS Code Commands:** You can access Qwen Code features directly from the VS Code Command Palette (`Cmd+Shift+P` or `Ctrl+Shift+P`):
- `Qwen Code: Run`: Starts a new Qwen Code session in the integrated terminal.
- `Qwen Code: Accept Diff`: Accepts the changes in the active diff editor.
- `Qwen Code: Close Diff Editor`: Rejects the changes and closes the active diff editor.
- `Qwen Code: View Third-Party Notices`: Displays the third-party notices for the extension.
## Installation and Setup
@@ -25,11 +25,11 @@ There are three ways to set up the IDE integration:
### 1. Automatic Nudge (Recommended)
When you run Gemini CLI inside a supported editor, it will automatically detect your environment and prompt you to connect. Answering "Yes" will automatically run the necessary setup, which includes installing the companion extension and enabling the connection.
When you run Qwen Code inside a supported editor, it will automatically detect your environment and prompt you to connect. Answering "Yes" will automatically run the necessary setup, which includes installing the companion extension and enabling the connection.
### 2. Manual Installation from CLI
If you previously dismissed the prompt or want to install the extension manually, you can run the following command inside Gemini CLI:
If you previously dismissed the prompt or want to install the extension manually, you can run the following command inside Qwen Code:
```
/ide install
@@ -41,8 +41,8 @@ This will find the correct extension for your IDE and install it.
You can also install the extension directly from a marketplace.
- **For Visual Studio Code:** Install from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=google.gemini-cli-vscode-ide-companion).
- **For VS Code Forks:** To support forks of VS Code, the extension is also published on the [Open VSX Registry](https://open-vsx.org/extension/google/gemini-cli-vscode-ide-companion). Follow your editor's instructions for installing extensions from this registry.
- **For Visual Studio Code:** Install from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=qwenlm.qwen-code-vscode-ide-companion).
- **For VS Code Forks:** To support forks of VS Code, the extension is also published on the [Open VSX Registry](https://open-vsx.org/extension/qwenlm/qwen-code-vscode-ide-companion). Follow your editor's instructions for installing extensions from this registry.
> NOTE:
> The "Gemini CLI Companion" extension may appear towards the bottom of search results. If you don't see it immediately, try scrolling down or sorting by "Newly Published".
@@ -64,7 +64,7 @@ You can control the IDE integration from within the CLI:
/ide disable
```
When enabled, Gemini CLI will automatically attempt to connect to the IDE companion extension.
When enabled, Qwen Code will automatically attempt to connect to the IDE companion extension.
### Checking the Status
@@ -86,14 +86,14 @@ When you ask Gemini to modify a file, it can open a diff view directly in your e
- Click the **checkmark icon** in the diff editor's title bar.
- Save the file (e.g., with `Cmd+S` or `Ctrl+S`).
- Open the Command Palette and run **Gemini CLI: Accept Diff**.
- Open the Command Palette and run **Qwen Code: Accept Diff**.
- Respond with `yes` in the CLI when prompted.
**To reject a diff**, you can:
- Click the **'x' icon** in the diff editor's title bar.
- Close the diff editor tab.
- Open the Command Palette and run **Gemini CLI: Close Diff Editor**.
- Open the Command Palette and run **Qwen Code: Close Diff Editor**.
- Respond with `no` in the CLI when prompted.
You can also **modify the suggested changes** directly in the diff view before accepting them.
@@ -102,10 +102,10 @@ If you select Yes, allow always in the CLI, changes will no longer show up
## Using with Sandboxing
If you are using Gemini CLI within a sandbox, please be aware of the following:
If you are using Qwen Code within a sandbox, please be aware of the following:
- **On macOS:** The IDE integration requires network access to communicate with the IDE companion extension. You must use a Seatbelt profile that allows network access.
- **In a Docker Container:** If you run Gemini CLI inside a Docker (or Podman) container, the IDE integration can still connect to the VS Code extension running on your host machine. The CLI is configured to automatically find the IDE server on `host.docker.internal`. No special configuration is usually required, but you may need to ensure your Docker networking setup allows connections from the container to the host.
- **In a Docker Container:** If you run Qwen Code inside a Docker (or Podman) container, the IDE integration can still connect to the VS Code extension running on your host machine. The CLI is configured to automatically find the IDE server on `host.docker.internal`. No special configuration is usually required, but you may need to ensure your Docker networking setup allows connections from the container to the host.
## Troubleshooting
@@ -113,10 +113,10 @@ If you encounter issues with IDE integration, here are some common error message
### Connection Errors
- **Message:** `🔴 Disconnected: Failed to connect to IDE companion extension in [IDE Name]. Please ensure the extension is running. To install the extension, run /ide install.`
- **Cause:** Gemini CLI could not find the necessary environment variables (`GEMINI_CLI_IDE_WORKSPACE_PATH` or `GEMINI_CLI_IDE_SERVER_PORT`) to connect to the IDE. This usually means the IDE companion extension is not running or did not initialize correctly.
- **Message:** `🔴 Disconnected: Failed to connect to IDE companion extension for [IDE Name]. Please ensure the extension is running and try restarting your terminal. To install the extension, run /ide install.`
- **Cause:** Qwen Code could not find the necessary environment variables (`QWEN_CODE_IDE_WORKSPACE_PATH` or `QWEN_CODE_IDE_SERVER_PORT`) to connect to the IDE. This usually means the IDE companion extension is not running or did not initialize correctly.
- **Solution:**
1. Make sure you have installed the **Gemini CLI Companion** extension in your IDE and that it is enabled.
1. Make sure you have installed the **Qwen Code Companion** extension in your IDE and that it is enabled.
2. Open a new terminal window in your IDE to ensure it picks up the correct environment.
- **Message:** `🔴 Disconnected: IDE connection error. The connection was lost unexpectedly. Please try reconnecting by running /ide enable`
@@ -125,8 +125,8 @@ If you encounter issues with IDE integration, here are some common error message
### Configuration Errors
- **Message:** `🔴 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]`
- **Cause:** The CLI's current working directory is outside the workspace you have open in your IDE.
- **Message:** `🔴 Disconnected: Directory mismatch. Qwen Code is running in a different location than the open workspace in [IDE Name]. Please run the CLI from the same directory as your project's root folder.`
- **Cause:** The CLI's current working directory is outside the folder or workspace you have open in your IDE.
- **Solution:** `cd` into the same directory that is open in your IDE and restart the CLI.
- **Message:** `🔴 Disconnected: To use this feature, please open a workspace folder in [IDE Name] and try again.`
@@ -135,10 +135,10 @@ If you encounter issues with IDE integration, here are some common error message
### General Errors
- **Message:** `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]`
- **Cause:** You are running Gemini CLI in a terminal or environment that is not a supported IDE.
- **Solution:** Run Gemini CLI from the integrated terminal of a supported IDE, like VS Code.
- **Message:** `IDE integration is not supported in your current environment. To use this feature, run Qwen Code in one of these supported IDEs: [List of IDEs]`
- **Cause:** You are running Qwen Code in a terminal or environment that is not a supported IDE.
- **Solution:** Run Qwen Code from the integrated terminal of a supported IDE, like VS Code.
- **Message:** `No installer is available for IDE. Please install the Gemini CLI Companion extension manually from the marketplace.`
- **Cause:** You ran `/ide install`, but the CLI does not have an automated installer for your specific IDE.
- **Solution:** Open your IDE's extension marketplace, search for "Gemini CLI Companion", and [install it manually](#3-manual-installation-from-a-marketplace).
- **Solution:** Open your IDE's extension marketplace, search for "Qwen Code Companion", and install it manually.