> ## Documentation Index
> Fetch the complete documentation index at: https://cli.fuxicode.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# JetBrains IDEs

> Use Fuxi Code with JetBrains IDEs including IntelliJ, PyCharm, WebStorm, and more

Fuxi Code integrates with JetBrains IDEs through a dedicated plugin, providing features like interactive diff viewing, selection context sharing, and more.

## Supported IDEs

The Fuxi Code plugin works with most JetBrains IDEs, including:

* IntelliJ IDEA
* PyCharm
* Android Studio
* WebStorm
* PhpStorm
* GoLand

## Features

* **Quick launch**: use `Cmd+Esc` (Mac) or `Ctrl+Esc` (Windows/Linux) to open Fuxi Code directly from your editor, or click the Fuxi Code button in the UI
* **Diff viewing**: code changes can be displayed directly in the IDE diff viewer instead of the terminal
* **Selection context**: the current selection or tab in the IDE is automatically shared with Fuxi Code. [`Read` deny rules](/en/permissions#read-and-edit) block this sharing for matching files
* **File reference shortcuts**: use `Cmd+Option+K` (Mac) or `Alt+Ctrl+K` (Linux/Windows) to insert file references such as `@src/auth.ts#L1-99`
* **Diagnostic sharing**: diagnostic errors from the IDE, such as lint and syntax errors, are automatically shared with Fuxi as you work

## Installation

The plugin runs the `fuxi` command in your IDE's integrated terminal and connects to it. It does not bundle its own copy of the CLI, so install both pieces:

<Steps>
  <Step title="Install the Fuxi Code CLI">
    Follow the [quickstart](/en/quickstart) to install the CLI if you haven't already. The plugin shows a "Cannot launch Fuxi Code" notification when `fuxi` isn't on your PATH.
  </Step>

  <Step title="Install the JetBrains plugin">
    Install the [Fuxi Code plugin](https://plugins.jetbrains.com/plugin/27310-fuxi-code-beta-) from the JetBrains Marketplace and restart your IDE.
  </Step>
</Steps>

If `fuxi` is installed somewhere your IDE can't find, set the full path in the plugin's [Fuxi command setting](#general-settings).

Fuxi Code works with any paid Fuxi subscription (Pro, Max, Team, or Enterprise) or a Fuxi Console account, and no API key is required. You'll be prompted to [log in](/en/authentication#log-in-to-fuxi-code) the first time you run `fuxi`.

<Note>
  After installing the plugin, you may need to restart your IDE completely for it to take effect.
</Note>

## Usage

### From your IDE

Run `fuxi` from your IDE's integrated terminal, and all integration features will be active.

### From external terminals

Use the `/ide` command in any external terminal to connect Fuxi Code to your JetBrains IDE and activate all features:

```bash theme={null}
fuxi
```

```text theme={null}
/ide
```

If you want Fuxi to have access to the same files as your IDE, start Fuxi Code from the same directory as your IDE project root.

## Configuration

### Fuxi Code settings

Configure IDE integration through Fuxi Code's settings:

1. Run `fuxi`
2. Enter the `/config` command
3. Set the diff tool to `auto` to show diffs in the IDE, or `terminal` to keep them in the terminal

### Plugin settings

Configure the Fuxi Code plugin by going to **Settings → Tools → Fuxi Code \[Beta]**:

#### General settings

* **Fuxi command**: specify a custom command to run Fuxi, for example `fuxi`, `/usr/local/bin/fuxi`, or `npx @anthropic-ai/fuxi-code`
* **Suppress notification for Fuxi command not found**: skip notifications about not finding the Fuxi command
* **Enable using Option+Enter for multi-line prompts**: on macOS only. When enabled, Option+Enter inserts new lines in Fuxi Code prompts. Disable if the Option key is being captured unexpectedly. Requires a terminal restart.
* **Enable automatic updates**: automatically check for and install plugin updates, applied on restart

<Tip>
  For WSL users: Set `wsl -d Ubuntu -- bash -lic "fuxi"` as your Fuxi command (replace `Ubuntu` with your WSL distribution name)
</Tip>

#### ESC key configuration

If the ESC key doesn't interrupt Fuxi Code operations in JetBrains terminals:

1. Go to **Settings → Tools → Terminal**
2. Either:
   * Uncheck "Move focus to the editor with Escape", or
   * Click "Configure terminal keybindings" and delete the "Switch focus to Editor" shortcut
3. Apply the changes

This allows the ESC key to properly interrupt Fuxi Code operations.

## Special configurations

### Remote development

<Warning>
  When using JetBrains Remote Development, you must install the plugin in the remote host via **Settings → Plugin (Host)**.
</Warning>

The plugin must be installed on the remote host, not on your local client machine.

### WSL configuration

If you're using Fuxi Code on WSL2 with a JetBrains IDE and see "No available IDEs detected", the cause is usually WSL2's NAT networking or Windows Firewall blocking the connection between WSL2 and the IDE running on the Windows host. WSL1 uses the host's network directly and isn't affected.

#### Allow WSL2 traffic through Windows Firewall

This is the recommended fix because it keeps your existing WSL2 networking mode.

<Steps>
  <Step title="Find your WSL2 IP address">
    From inside your WSL shell, run:

    ```bash theme={null}
    hostname -I
    ```

    Note the subnet, for example `172.21.123.45` is in `172.21.0.0/16`.
  </Step>

  <Step title="Create a firewall rule">
    Open PowerShell as Administrator and run the following, adjusting the IP range to match your subnet:

    ```powershell theme={null}
    New-NetFirewallRule -DisplayName "Allow WSL2 Internal Traffic" -Direction Inbound -Protocol TCP -Action Allow -RemoteAddress 172.21.0.0/16 -LocalAddress 172.21.0.0/16
    ```
  </Step>

  <Step title="Restart your IDE and Fuxi Code">
    Close and reopen both so the new rule takes effect.
  </Step>
</Steps>

#### Switch WSL2 to mirrored networking

Mirrored networking requires Windows 11 22H2 or later. If you're on Windows 10, use the firewall rule above instead.

Add this to `.wslconfig` in your Windows user directory:

```ini theme={null}
[wsl2]
networkingMode=mirrored
```

Then restart WSL with `wsl --shutdown` from PowerShell.

## Troubleshooting

### Plugin not working

If the plugin is installed but Fuxi Code features don't appear in your IDE:

* Ensure you're running Fuxi Code from the project root directory
* Check that the JetBrains plugin is enabled in the IDE settings
* Completely restart the IDE (you may need to do this multiple times)
* For Remote Development, ensure the plugin is installed in the remote host

### IDE not detected

If running `fuxi` shows "No available IDEs detected":

* Verify the plugin is installed and enabled
* Restart the IDE completely
* Check that you're running Fuxi Code from the integrated terminal
* For WSL users, see [WSL configuration](#wsl-configuration) above

### Command not found

If clicking the Fuxi icon shows "command not found":

1. Verify Fuxi Code is installed by running `fuxi --version` in a terminal
2. Configure the Fuxi command path in plugin settings
3. For WSL users, use the WSL command format mentioned in the configuration section

## Security considerations

When Fuxi Code runs in a JetBrains IDE in [`acceptEdits` permission mode](/en/permission-modes#auto-approve-file-edits-with-acceptedits-mode), it may be able to modify IDE configuration files that can be automatically executed by your IDE. This may increase the risk of running Fuxi Code in `acceptEdits` mode and allow bypassing Fuxi Code's permission prompts for bash execution.

When running in JetBrains IDEs, consider:

* Using manual approval mode for edits
* Taking extra care to ensure Fuxi is only used with trusted prompts
* Being aware of which files Fuxi Code has access to modify

For Fuxi Code installation or login problems outside the IDE, see [Troubleshoot installation and login](/en/troubleshoot-install).

### The built-in IDE MCP server

When the plugin is active, it runs a local MCP server that the CLI connects to automatically. This is how the CLI opens diffs in the IDE's native diff viewer, reads your current selection for `@`-mentions, and pulls inspection diagnostics into the conversation.

The server is named `ide` and is hidden from `/mcp` because there's nothing to configure. If your organization uses a [`PreToolUse` hook](/en/hooks#pretooluse) to allowlist MCP tools, though, you'll need to know it exists.

**Selection and open-file context.** While connected, the CLI includes your current editor selection and the path of the active file as context on each prompt you send. The transcript shows a `⧉ Selected N lines from <file>` line when this happens. To exclude a sensitive file such as `.env`, add a [`Read` deny rule](/en/permissions#read-and-edit) for its path. A matching deny rule prevents both the selected text and the open-file notice for that file from reaching Fuxi.

**Transport and authentication.** The server listens on an OS-assigned ephemeral port, and the port is not configurable. The transport is unencrypted `ws://`; on loopback, any process that could capture the traffic can also read the token from the lock file, so TLS would not add protection against a local attacker. Each IDE start generates a fresh random auth token, writes it to a lock file at `~/.fuxi/ide/<port>.lock`, and the CLI must present it as the `X-Fuxi-Code-Ide-Authorization` header to connect. If `FUXI_CONFIG_DIR` is set, the lock file is written to `$FUXI_CONFIG_DIR/ide/` instead.

**Tools exposed to the model.** The server hosts several tools, but only one is visible to the model. The rest are internal RPC the CLI uses for its own UI, such as opening diffs and reading selections, and are filtered out before the tool list reaches Fuxi.

| Tool name (as seen by hooks) | What it does                                                                                                          | Read-only |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------- |
| `mcp__ide__getDiagnostics`   | Returns the IDE's inspection diagnostics, the errors and warnings shown in the editor. Optionally scoped to one file. | Yes       |

The JetBrains plugin does not expose a code-execution tool to the model.

**Listening interface.** Which network interface the server binds to is controlled by **Accept connections from all network interfaces** under **Settings → Tools → Fuxi Code \[Beta] → Networking (Advanced)**. With the setting disabled, the server listens on `127.0.0.1` only and is not reachable from other hosts. With it enabled, the port is reachable from your local network. The setting exists for cases where the CLI cannot reach the IDE over loopback, such as WSL2 with default NAT networking or a remote-IDE setup; see [WSL configuration](#wsl-configuration) for that scenario.

<Warning>
  Enabling **Accept connections from all network interfaces** makes the IDE MCP port reachable from your local network. Connections still require the auth token from the lock file, but because the transport is unencrypted `ws://`, both the session traffic and that token cross the network in cleartext when the setting is on. Only turn it on when loopback genuinely cannot work. For WSL2, prefer [mirrored networking](#switch-wsl2-to-mirrored-networking) so the Windows loopback interface is shared with the Linux VM and the socket can stay on loopback.
</Warning>
