Skip to main content
The Qwen Code extension for Zed integrates Qwen Code as an AI agent server using the Agent Client Protocol (ACP). This provides a native agent experience directly within Zed’s interface.

Features

Native Agent Experience

Integrated AI assistant panel within Zed’s interface

Agent Client Protocol

Full support for ACP enabling advanced IDE interactions

File Management

@-mention files to add them to the conversation context

Conversation History

Access to past conversations within Zed

Multi-platform

Works on macOS (ARM64 & Intel), Linux, and Windows

Workspace Awareness

Read, write, and edit files in your workspace

Requirements

The Zed extension requires the Qwen Code CLI to be installed separately.
  • Zed Editor: Latest version recommended
  • Node.js: Version 20 or later
  • Qwen Code CLI: Installed globally via npm
  • Internet connection: For AI model access

Installation

1

Install Qwen Code CLI

First, install the Qwen Code CLI globally:
npm install -g @qwen-code/qwen-code
Verify the installation:
qwen --version
2

Install Zed Extension

Open Zed and install the extension using one of these methods:Via Extensions Panel:
  1. Open the Extensions panel:
    • macOS: cmd-shift-x
    • Linux/Windows: ctrl-shift-x
  2. Search for “Qwen Code”
  3. Click “Install”
Via Command Line:
zed --install-extension qwen-code
3

Enable Agent Server

After installation:
  1. Switch to the Agent Server tab in the Extensions panel
  2. Ensure “Qwen Code” is enabled
  3. The agent server will start automatically
4

Open Agent Panel

Launch the Agent Panel:
  • macOS: cmd-shift-a
  • Linux/Windows: ctrl-shift-a
Select “Qwen Code” from the agent list and start chatting!

Usage

Opening the Agent Panel

Access the Qwen Code agent:
  1. Press cmd-shift-a (macOS) or ctrl-shift-a (Linux/Windows)
  2. Select “Qwen Code” from the agent dropdown
  3. Start your conversation

Using @-mentions

Reference files in your workspace:
@filename to mention specific files
@directory/ to reference entire directories
Example:
Explain what @src/main.rs does
Refactor @utils/parser.ts to improve performance
Add tests for @components/Button.tsx

Agent Capabilities

The Qwen Code agent can:
  • Read files: Access any file in your workspace
  • Write files: Create new files or modify existing ones
  • Edit code: Make surgical changes to specific functions or sections
  • Explain code: Provide detailed explanations of code structure and logic
  • Debug: Help identify and fix bugs
  • Suggest improvements: Recommend refactorings and optimizations

Natural Language Commands

Use natural language to describe what you want:
"Explain the codebase structure"
"Find all TODO comments"
"Refactor this function to use async/await"
"Generate unit tests for the parser module"
"Fix the type errors in src/types.ts"

Configuration

Environment Variables

The Zed extension inherits environment variables from Zed. To set custom variables:
  1. Open Zed settings (macOS: cmd-,, Linux/Windows: ctrl-,)
  2. Add agent server environment variables:
{
  "agent_servers": {
    "qwen-code": {
      "env": {
        "QWEN_LOG_LEVEL": "info",
        "YOUR_CUSTOM_VAR": "value"
      }
    }
  }
}

Qwen Code Settings

The agent server reads configuration from:
  • User settings: ~/.qwen/settings.json
  • Project settings: .qwen/settings.json (workspace root)
Configure authentication, models, and other options:
{
  "modelProviders": {
    "openai": [
      {
        "id": "qwen3-coder-plus",
        "name": "qwen3-coder-plus",
        "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
        "envKey": "DASHSCOPE_API_KEY"
      }
    ]
  },
  "env": {
    "DASHSCOPE_API_KEY": "sk-xxxxxxxxxxxxx"
  },
  "security": {
    "auth": {
      "selectedType": "openai"
    }
  },
  "model": {
    "name": "qwen3-coder-plus"
  }
}
See the Configuration Guide for all options.

Authentication

The extension uses your existing Qwen Code authentication. Configure it by running the CLI:
qwen
/auth
Choose between:
  • Qwen OAuth: Free tier with 1,000 requests/day
  • API Key: Use OpenAI, Anthropic, or other compatible providers

Platform Support

The Zed extension is available for:
PlatformArchitectureStatus
macOSARM64 (Apple Silicon)✅ Supported
macOSx86_64 (Intel)✅ Supported
Linuxx86_64✅ Supported
Windowsx86_64✅ Supported
The current version requires Node.js to run. A single-file executable version is in development.

Tips & Best Practices

Always use @-mentions to specify which files you’re asking about. This gives Qwen precise context:Good: “Refactor @src/parser.ts to use async/await”Not as good: “Refactor the parser file”
When Qwen suggests file changes, review them carefully in Zed’s diff view before accepting.
Build on previous conversations. Qwen remembers the context from your chat history.
Begin with high-level questions (“What does this project do?”) then drill down into specifics.

Troubleshooting

Issue: Error message “server shut down unexpectedly”Solutions:
  1. Collect logs:
    • Press cmd-shift-p (macOS) or ctrl-shift-p (Windows/Linux)
    • Select Zed: Open Log
  2. Check logs for errors related to:
    • Agent server startup
    • Node.js runtime
    • Qwen Code CLI
  3. Verify Qwen Code CLI works:
    qwen --version
    qwen --acp
    
  4. Check Node.js version:
    node --version  # Should be 20 or later
    
Issue: Agent starts but encounters problems during useSolutions:
  1. Open ACP logs:
    • Press cmd-shift-p (macOS) or ctrl-shift-p (Windows/Linux)
    • Select Dev: Open ACP Logs
  2. Look for error messages in the ACP logs
  3. Check authentication:
    qwen
    /auth
    
  4. Verify internet connectivity
Issue: Can’t find Qwen Code in the agent dropdownSolutions:
  • Verify the extension is installed (check Extensions panel)
  • Ensure the agent server is enabled in the Agent Server tab
  • Restart Zed
  • Check that Qwen Code CLI is installed:
    which qwen  # Unix/macOS
    where qwen  # Windows
    
Issue: Agent can’t authenticate or make requestsSolutions:
  1. Run authentication setup:
    qwen
    /auth
    
  2. Check ~/.qwen/settings.json for correct API keys
  3. Test authentication in the CLI:
    qwen -p "Hello"
    
  4. Verify API key validity with your provider

Viewing Logs

Access different log files for debugging:
Log TypeHow to AccessContains
Zed Logscmd/ctrl-shift-p → “Zed: Open Log”General Zed and extension logs
ACP Logscmd/ctrl-p → “Dev: Open ACP Logs”Agent Client Protocol communication
Qwen LogsTerminal: tail -f ~/.qwen/logs/*.logQwen Code CLI logs

Reporting Issues

If you encounter problems:
  1. Collect diagnostic information:
    • Zed version: Help → About Zed
    • Qwen Code version: qwen --version
    • Node.js version: node --version
    • Relevant log excerpts
  2. Report the issue at one of these locations:
  3. Include in your report:
    • Clear description of the issue
    • Steps to reproduce
    • Expected vs. actual behavior
    • Relevant log excerpts
    • System information

Resources

Zed Agent Panel Guide

Learn more about Zed’s agent panel

Agent Client Protocol

Understand the ACP specification

Qwen Code Discussions

Join the community discussion

Zed Community

Connect with other Zed users

Next Steps