How to Set Up Qwen Code with Roo Code in VS Code

Qwen3-Coder has become a powerhouse for developers, offering deep logic and high-speed completions. By integrating it with the Roo Code extension in Visual Studio Code, you can turn your editor into an autonomous coding agent.

Here is the complete guide to setting up your environment, from cloud registration to local integration.


Phase 1: Cloud Configuration

Before running the model locally, you need to establish your credentials through Alibaba Cloud.

  1. Register an Account: Go to Alibaba Cloud and create a new account.

  2. Access Model Studio: Navigate to the Model Studio Console. This is the central hub for managing AI models.

  3. Generate your API Key: * Browse the available models and select the Qwen series.

    • Click the Get API Key button.

    • Tip: Keep this key secure; you will need it if you choose to bypass OAuth later.


Phase 2: Local Environment Setup

Now, let's prepare your machine to bridge the gap between the cloud and your code editor.

1. Install the Qwen Client

Open your terminal and install the official Qwen CLI globally using npm:

Bash
npm install -g @qwen-code/qwen-code@latest

2. Authenticate via OAuth

To simplify the connection without manually managing keys every session, use the OAuth flow:

  • In your terminal, type: qwen

  • Select the OAuth option when prompted.

  • This will open your browser to authorize the connection. Once confirmed, your credentials will be stored automatically on your laptop.

3. Prepare VS Code

If you haven't already, download and install Visual Studio Code.


Phase 3: Integrating with Roo Code

The final step is connecting the Qwen engine to the Roo Code (formerly known as Cline) extension.

  1. Install Roo Code: Open VS Code, go to the Extensions view (Ctrl+Shift+X), search for "Roo Code", and click Install.

  2. Configure the Provider:

    • Open the Roo Code panel on the sidebar.

    • Click the Settings (gear icon).

    • Under API Provider, select Qwen Code.

  3. Select Your Model:

    • Depending on your needs, you can choose between different versions:

      • Qwen Code Plus: Best for complex architecture and deep debugging.

      • Qwen Code Flash: Optimized for speed and quick refactors.


All Done!

You are now ready to use one of the most capable coding models directly within your IDE. You can now ask Roo Code to generate files, fix bugs, or explain complex logic using the Qwen backbone.

Note: If you encounter any connection issues, ensure your terminal is still logged in by running the qwen command to refresh your OAuth token.

Komentar