Qwen Code is an open-source AI-powered terminal agent developed by the QwenLM team at Alibaba Cloud. Built from the ground up for the terminal environment, Qwen Code provides a Claude Code-style interactive coding experience optimized for Alibaba’s Qwen model family, while maintaining compatibility with models from OpenAI, Anthropic, Google, and others through a multi-protocol provider system.
The agent is designed to feel like a natural extension of the developer’s terminal workflow. It operates in the same shell environment, has access to the file system, can execute commands, edit files, create projects, and manage git workflows – all through natural language interaction. With support for agentic workflows that decompose complex tasks, sub-agents for parallel execution, and IDE integration via VS Code and JetBrains, Qwen Code positions itself as a versatile open-source alternative to proprietary coding assistants.
What is Qwen Code and how does it work?
Qwen Code is a terminal-based AI coding agent that integrates directly into the developer’s shell. Once installed, users interact with it through natural language commands in their terminal. The agent has full access to the working directory, can execute shell commands, read and write files, manage git repositories, and browse the web. It supports a conversational interface where developers can discuss code, request changes, and iterate on solutions.
Key Features
| Feature | Description | Status |
|---|---|---|
| Interactive Terminal | Natural language coding in the shell | Stable |
| Agentic Workflows | Multi-step task decomposition and execution | Stable |
| Sub-Agents | Parallel execution of independent subtasks | Beta |
| Multi-Provider | Supports Qwen, OpenAI, Anthropic, Google, and more | Stable |
| IDE Integration | VS Code and JetBrains extension support | Beta |
| Tool Library | Built-in tools for file, git, web, and system operations | Stable |
Provider Support
| Provider | Models | Protocol | Quality |
|---|---|---|---|
| Alibaba Cloud | Qwen 3, Qwen2.5, Qwen-Coder | DashScope API | Excellent |
| OpenAI | GPT-4o, GPT-4o-mini, o1, o3 | OpenAI API | Excellent |
| Anthropic | Claude 3.5 Sonnet, Claude 4 | Anthropic API | Excellent |
| Gemini 1.5 Pro, 2.0 Flash | Google AI API | Very Good | |
| DeepSeek | DeepSeek V3, R1 | OpenAI-compatible | Very Good |
| Ollama | Any local model | Ollama API | Variable |
How do agentic workflows work in Qwen Code?
Qwen Code’s agentic workflow system is designed for complex, multi-step tasks. When given a high-level request like “Create a REST API for a blog platform,” the agent analyzes the task, creates a plan with specific steps, executes each step sequentially or in parallel using sub-agents, and monitors progress. The workflow system includes error handling, automatic retry, and rollback capabilities. Developers can observe the agent’s reasoning process and intervene at any point.
flowchart TD
A[User Request] --> B[Task Parser]
B --> C[Create Execution Plan]
C --> D{Parallelizable?}
D -->|Yes| E[Spawn Sub-Agents]
D -->|No| F[Sequential Execution]
E --> G[Sub-Agent 1: Backend]
E --> H[Sub-Agent 2: Frontend]
E --> I[Sub-Agent 3: Database]
F --> J[Step 1: Analyze]
J --> K[Step 2: Implement]
K --> L[Step 3: Test]
G --> M[Merge Results]
H --> M
I --> M
L --> M
M --> N[Review & Verify]
N --> O[Present to User]Installation and Setup
| Method | Command | Notes |
|---|---|---|
| pip | pip install qwen-code | Python 3.10+ required |
| npm | npm install -g qwen-code | Node.js 18+ required |
| Docker | docker pull qwenlm/qwen-code | For containerized use |
| Source | git clone https://github.com/QwenLM/qwen-code | Development setup |
What IDE integration does Qwen Code offer?
Qwen Code provides VS Code and JetBrains extensions that bridge the terminal agent with the IDE experience. The extensions provide an inline chat panel, code completion suggestions powered by the agent, the ability to apply file edits directly in the editor, and a diff view for reviewing changes before acceptance. The IDE integration shares the same backend agent, so context is maintained between terminal and IDE interactions.
sequenceDiagram
participant Dev as Developer
participant Terminal as Terminal
participant Agent as Qwen Code Agent
participant Tools as Tool Library
participant IDE as IDE Extension
Dev->>Terminal: "Add pagination to users API"
Terminal->>Agent: Process request
Agent->>Agent: Analyze codebase
Agent->>Tools: Read route files
Tools-->>Agent: Current implementation
Agent->>Agent: Design pagination approach
Agent->>Tools: Edit route handler
Agent->>Tools: Add query parameters
Agent->>Tools: Create pagination utility
Tools-->>IDE: Show changes in diff view
IDE-->>Dev: Review and accept changes
Dev->>Terminal: "Run tests"
Agent->>Tools: Execute test suite
Tools-->>Dev: All tests passingWhat tools does Qwen Code provide?
Qwen Code comes with a comprehensive tool library that covers common development operations. File operations include read, write, edit, and search across the project. Shell execution allows running commands, scripts, and build tools. Git integration covers commit, branch, push, and PR creation. Web browsing enables documentation lookup and API research. System tools handle process management and environment configuration. The tool library is extensible through a plugin system.
How does Qwen Code handle security?
Security is handled through a permission system that controls what the agent can access. File operations are restricted to the project directory by default, shell commands are sandboxed, and sensitive operations require explicit user confirmation. The agent displays all commands before execution, and the terminal history is maintained for audit purposes. For enterprise deployments, additional security policies can be configured through a YAML-based configuration file.
Frequently Asked Questions
What is Qwen Code? Qwen Code is an open-source AI terminal agent by Alibaba that provides a Claude Code-style interactive coding experience optimized for Qwen models with support for multiple LLM providers.
What features does it offer? Interactive terminal coding, agentic workflows with task decomposition, parallel sub-agents, multi-provider support (Qwen, OpenAI, Anthropic, Google), and IDE integration for VS Code and JetBrains.
How do I install it? Install via pip (pip install qwen-code), npm (npm install -g qwen-code), Docker, or clone from GitHub. Python 3.10+ or Node.js 18+ required.
What LLM providers are supported? Alibaba Cloud (Qwen models), OpenAI, Anthropic, Google, DeepSeek, and any Ollama-hosted local model via the multi-protocol provider system.
Does it integrate with IDEs? Yes, VS Code and JetBrains extensions are available, providing inline chat, code suggestions, diff-based change review, and shared context with the terminal agent.
無程式碼也能輕鬆打造專業LINE官方帳號!一鍵導入模板,讓AI助你行銷加分!