> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/QwenLM/qwen-code/llms.txt
> Use this file to discover all available pages before exploring further.

# JetBrains IDEs Integration

> Use Qwen Code in IntelliJ IDEA, WebStorm, PyCharm, and other JetBrains IDEs via ACP

JetBrains IDEs provide native support for AI coding assistants through the Agent Client Protocol (ACP). This integration allows you to use Qwen Code directly within your JetBrains IDE with real-time AI assistance.

<Frame>
  <img src="https://img.alicdn.com/imgextra/i3/O1CN01ZxYel21y433Ci6eg0_!!6000000006524-2-tps-2774-1494.png" alt="Qwen Code in JetBrains AI Chat" />
</Frame>

## Features

<CardGroup cols={2}>
  <Card title="Native Agent Experience" icon="robot">
    Integrated AI assistant panel within your JetBrains IDE
  </Card>

  <Card title="Agent Client Protocol" icon="plug">
    Full support for ACP enabling advanced IDE interactions
  </Card>

  <Card title="Symbol Management" icon="hashtag">
    \#-mention files to add them to the conversation context
  </Card>

  <Card title="Conversation History" icon="clock-rotate-left">
    Access to past conversations within the IDE
  </Card>

  <Card title="Multi-IDE Support" icon="grid">
    Works with IntelliJ IDEA, WebStorm, PyCharm, and more
  </Card>

  <Card title="Workspace Integration" icon="folder-tree">
    Full access to your project structure and files
  </Card>
</CardGroup>

## Supported IDEs

Qwen Code works with JetBrains IDEs that support the Agent Client Protocol:

<CardGroup cols={3}>
  <Card title="IntelliJ IDEA" icon="java">
    Ultimate and Community editions
  </Card>

  <Card title="WebStorm" icon="js">
    For web development
  </Card>

  <Card title="PyCharm" icon="python">
    Professional and Community editions
  </Card>

  <Card title="GoLand" icon="golang">
    For Go development
  </Card>

  <Card title="PhpStorm" icon="php">
    For PHP development
  </Card>

  <Card title="RubyMine" icon="gem">
    For Ruby development
  </Card>

  <Card title="CLion" icon="c">
    For C/C++ development
  </Card>

  <Card title="Rider" icon="microsoft">
    For .NET development
  </Card>

  <Card title="Android Studio" icon="android">
    For Android development
  </Card>
</CardGroup>

<Note>
  Ensure your JetBrains IDE version supports ACP. Check the [JetBrains documentation](https://www.jetbrains.com/help/) for your specific IDE.
</Note>

## Requirements

* **JetBrains IDE**: Version with ACP support
* **Qwen Code CLI**: Installed globally
* **Node.js**: Version 20 or later

## Installation

<Steps>
  <Step title="Install Qwen Code CLI">
    Install the Qwen Code CLI globally using npm:

    ```bash theme={null}
    npm install -g @qwen-code/qwen-code
    ```

    Verify the installation:

    ```bash theme={null}
    qwen --version
    ```

    Note the full path to the `qwen` executable:

    ```bash theme={null}
    # On Unix/macOS:
    which qwen

    # On Windows:
    where qwen
    ```
  </Step>

  <Step title="Open AI Chat Tool Window">
    In your JetBrains IDE:

    1. Navigate to the **AI Chat** tool window
    2. If not visible, enable it via View → Tool Windows → AI Chat
  </Step>

  <Step title="Configure ACP Agent">
    Configure Qwen Code as an ACP agent:

    1. Click the **3-dot menu** in the upper-right corner of the AI Chat window
    2. Select **Configure ACP Agent**
    3. Add the following configuration:

    ```json theme={null}
    {
      "agent_servers": {
        "qwen": {
          "command": "/path/to/qwen",
          "args": ["--acp"],
          "env": {}
        }
      }
    }
    ```

    Replace `/path/to/qwen` with the actual path from Step 1.
  </Step>

  <Step title="Start Using Qwen Code">
    The Qwen Code agent should now be available in the AI Assistant panel. Select it from the agent dropdown and start chatting!
  </Step>
</Steps>

## Configuration Details

### Finding the Qwen Executable Path

<Tabs>
  <Tab title="macOS/Linux">
    ```bash theme={null}
    which qwen
    ```

    Common locations:

    * npm global: `/usr/local/bin/qwen`
    * nvm: `~/.nvm/versions/node/v20.x.x/bin/qwen`
    * Homebrew: `/opt/homebrew/bin/qwen`
  </Tab>

  <Tab title="Windows">
    ```cmd theme={null}
    where qwen
    ```

    Common locations:

    * npm global: `C:\Users\<username>\AppData\Roaming\npm\qwen.cmd`
    * Node.js: `C:\Program Files\nodejs\qwen.cmd`
  </Tab>
</Tabs>

### Advanced Configuration

You can add environment variables and custom settings:

```json theme={null}
{
  "agent_servers": {
    "qwen": {
      "command": "/path/to/qwen",
      "args": ["--acp"],
      "env": {
        "QWEN_LOG_LEVEL": "info",
        "DASHSCOPE_API_KEY": "sk-xxxxxxxxxxxxx"
      }
    }
  }
}
```

### Qwen Code Settings

The agent reads configuration from:

* **User settings**: `~/.qwen/settings.json`
* **Project settings**: `.qwen/settings.json`

Configure your models and authentication:

```json theme={null}
{
  "modelProviders": {
    "openai": [
      {
        "id": "qwen3-coder-plus",
        "name": "qwen3-coder-plus",
        "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
        "envKey": "DASHSCOPE_API_KEY"
      }
    ]
  },
  "security": {
    "auth": {
      "selectedType": "openai"
    }
  },
  "model": {
    "name": "qwen3-coder-plus"
  }
}
```

See the [Configuration Guide](/users/configuration/settings) for all options.

## Usage

### Opening the AI Chat

Access the Qwen Code agent:

1. Open the **AI Chat** tool window (View → Tool Windows → AI Chat)
2. Select **Qwen Code** from the agent dropdown
3. Start your conversation

### Using #-mentions

Reference files using the # symbol:

```
#filename to mention specific files
#package to reference packages or modules
```

Example:

```
Explain what #Main.java does
Refactor #UserService to use dependency injection
Add tests for #Button.tsx
```

### Common Tasks

Qwen Code can help with:

**Code Explanation**:

```
Explain the purpose of #DatabaseConnection.java
What does the authenticate method in #AuthService do?
```

**Bug Fixing**:

```
Fix the null pointer exception in #UserController:42
Debug why #payment-processor.ts is failing
```

**Refactoring**:

```
Refactor #LegacyCode.java to use modern Java patterns
Simplify the logic in #complex-function.ts
```

**Testing**:

```
Generate unit tests for #Calculator.kt
Add integration tests for #PaymentAPI
```

**Documentation**:

```
Add JSDoc comments to #utils.ts
Document the API endpoints in #routes.js
```

## Authentication

Configure authentication using the Qwen Code CLI:

```bash theme={null}
qwen
/auth
```

Choose your authentication method:

<Tabs>
  <Tab title="Qwen OAuth">
    **Recommended for individual developers**

    * Free tier: 1,000 requests/day
    * Browser-based login flow
    * Automatic credential caching

    Run `/auth` and select "Qwen OAuth" to start the browser flow.
  </Tab>

  <Tab title="API Key">
    **Recommended for teams and custom providers**

    Supports multiple providers:

    * OpenAI and compatible APIs
    * Anthropic (Claude)
    * Google Gemini
    * Alibaba Cloud Bailian

    Configure in `~/.qwen/settings.json` or via environment variables.
  </Tab>
</Tabs>

See the [Authentication Guide](/users/configuration/auth) for detailed setup.

## Tips & Best Practices

<AccordionGroup>
  <Accordion title="Use precise file references">
    When asking about code, use #-mentions to specify exact files:

    Good: "Fix the bug in #UserService.java:156"

    Not as good: "Fix the bug in the user service"
  </Accordion>

  <Accordion title="Provide context with your questions">
    Give Qwen context about what you're trying to achieve:

    "I'm implementing user authentication. Can you help refactor #AuthController to use JWT tokens?"
  </Accordion>

  <Accordion title="Review generated code">
    Always review Qwen's suggestions before applying them. Use your IDE's diff view to see changes clearly.
  </Accordion>

  <Accordion title="Build on conversation history">
    Qwen remembers previous messages in the conversation. Use this to iterate on solutions:

    1. "Explain how #DataProcessor works"
    2. "Now optimize it for large datasets"
    3. "Add error handling to the optimized version"
  </Accordion>

  <Accordion title="Use natural language">
    Don't worry about formal syntax. Qwen understands natural language:

    "Make this function faster"
    "Add logging to track performance"
    "What's wrong with this code?"
  </Accordion>
</AccordionGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Agent not appearing in list">
    **Issue**: Can't find Qwen Code in the AI Chat agent dropdown

    **Solutions**:

    1. Verify Qwen Code CLI is installed:
       ```bash theme={null}
       qwen --version
       ```
    2. Check the agent configuration:
       * Ensure the `command` path is correct
       * Verify the path points to the `qwen` executable
    3. Restart your JetBrains IDE
    4. Check IDE version supports ACP
  </Accordion>

  <Accordion title="Qwen Code not responding">
    **Issue**: Agent appears but doesn't respond to messages

    **Solutions**:

    1. Check internet connection
    2. Verify authentication is configured:
       ```bash theme={null}
       qwen -p "Hello"
       ```
    3. Review IDE logs for errors:
       * Help → Show Log in Explorer (Windows/Linux)
       * Help → Show Log in Finder (macOS)
    4. Test the CLI directly:
       ```bash theme={null}
       qwen --acp
       ```
  </Accordion>

  <Accordion title="Authentication errors">
    **Issue**: "Authentication failed" or similar errors

    **Solutions**:

    1. Run authentication setup:
       ```bash theme={null}
       qwen
       /auth
       ```
    2. Verify API keys in `~/.qwen/settings.json`
    3. Check environment variables in ACP configuration
    4. Test with the CLI:
       ```bash theme={null}
       qwen -p "Test message"
       ```
  </Accordion>

  <Accordion title="Command path issues (Windows)">
    **Issue**: "Command not found" on Windows

    **Solutions**:

    1. Use the full path to `qwen.cmd`:
       ```json theme={null}
       {
         "command": "C:\\Users\\username\\AppData\\Roaming\\npm\\qwen.cmd"
       }
       ```
    2. Use forward slashes or escaped backslashes
    3. Verify npm global bin is in PATH:
       ```cmd theme={null}
       npm config get prefix
       ```
  </Accordion>

  <Accordion title="Node.js version issues">
    **Issue**: Agent fails to start due to Node.js version

    **Solutions**:

    1. Check Node.js version:
       ```bash theme={null}
       node --version
       ```
    2. Upgrade to Node.js 20 or later:
       * Download from [nodejs.org](https://nodejs.org/)
       * Or use a version manager (nvm, n, volta)
    3. Reinstall Qwen Code after upgrading Node.js:
       ```bash theme={null}
       npm install -g @qwen-code/qwen-code@latest
       ```
  </Accordion>
</AccordionGroup>

### Viewing Logs

Access logs for debugging:

**JetBrains IDE Logs**:

* Help → Show Log in Explorer (Windows/Linux)
* Help → Show Log in Finder (macOS)
* Look for ACP-related error messages

**Qwen Code Logs**:

```bash theme={null}
# View recent logs
tail -f ~/.qwen/logs/*.log

# Or on Windows
type %USERPROFILE%\.qwen\logs\*.log
```

## Reporting Issues

When reporting issues, include:

1. **Environment information**:
   * JetBrains IDE name and version
   * Qwen Code version: `qwen --version`
   * Node.js version: `node --version`
   * Operating system

2. **Configuration**:
   * Your ACP agent configuration (remove sensitive data)
   * Relevant parts of `~/.qwen/settings.json`

3. **Error details**:
   * Error messages from IDE logs
   * Error messages from Qwen Code logs
   * Steps to reproduce the issue

4. **Submit to**:
   * [Qwen Code Issues](https://github.com/QwenLM/qwen-code/issues)

## Resources

<CardGroup cols={2}>
  <Card title="JetBrains Documentation" icon="book" href="https://www.jetbrains.com/help/">
    Official JetBrains IDE documentation
  </Card>

  <Card title="Agent Client Protocol" icon="network-wired" href="https://agentclientprotocol.com">
    Learn about the ACP specification
  </Card>

  <Card title="Qwen Code CLI Guide" icon="terminal" href="/users/overview">
    Full CLI documentation and features
  </Card>

  <Card title="GitHub Discussions" icon="comments" href="https://github.com/QwenLM/qwen-code/discussions">
    Join the community discussion
  </Card>
</CardGroup>

## Next Steps

* Learn about [configuration options](/users/configuration/settings)
* Explore [authentication methods](/users/configuration/auth)
* Try the [VS Code extension](/ide-integration/vscode) for a different IDE experience
* Check out the [Zed integration](/ide-integration/zed) for Zed editor users
