> ## 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.

# Introduction

> An open-source AI agent that lives in your terminal, optimized for Qwen3-Coder models

## What is Qwen Code?

Qwen Code is an open-source AI agent for the terminal that helps you understand large codebases, automate tedious work, and ship faster. Built and optimized for [Qwen3-Coder](https://github.com/QwenLM/Qwen3-Coder), it brings powerful AI capabilities directly to your command line.

<CardGroup cols={2}>
  <Card title="Quick Install" icon="download" href="/installation">
    Get started in seconds with npm, Homebrew, or our install script
  </Card>

  <Card title="Quick Start" icon="rocket" href="/quickstart">
    Launch your first AI-assisted coding session
  </Card>
</CardGroup>

## Why Choose Qwen Code?

Qwen Code stands out from other AI coding assistants with these key advantages:

<CardGroup cols={2}>
  <Card title="Multi-Protocol with Free Tier" icon="plug">
    Use OpenAI, Anthropic, or Gemini-compatible APIs—or sign in with **Qwen OAuth for 1,000 free requests per day**. No credit card required.
  </Card>

  <Card title="Open-Source & Co-Evolving" icon="code-branch">
    Both the framework and the Qwen3-Coder model are open-source. They're developed together, ensuring seamless integration and continuous improvement.
  </Card>

  <Card title="Agentic & Feature-Rich" icon="brain">
    Rich built-in tools including Skills, SubAgents, and Plan Mode provide a full agentic workflow for complex coding tasks.
  </Card>

  <Card title="Terminal-First, IDE-Friendly" icon="terminal">
    Built for developers who live in the command line, with optional integration for VS Code, Zed, and JetBrains IDEs.
  </Card>
</CardGroup>

## How It Works

Qwen Code operates in multiple modes to fit your workflow:

### Interactive Mode

Launch an intuitive terminal UI where you can chat with AI, reference files, and see changes in real-time:

```bash theme={null}
cd your-project/
qwen
```

Use `@` to reference local files:

```text theme={null}
Explain what @src/main.ts does
Refactor @utils/helpers.js to use modern ES6 syntax
```

### Headless Mode

Run AI commands without the interactive UI—perfect for scripts, automation, and CI/CD:

```bash theme={null}
qwen -p "Generate unit tests for src/api/users.ts"
qwen -p "Review the code in @src/auth.ts for security issues"
```

### IDE Integration

Use Qwen Code inside your favorite editor:

* **VS Code**: Full extension with inline assistance
* **Zed**: Native integration for AI-powered editing
* **JetBrains**: Plugin support for IntelliJ, PyCharm, and more

<Note>
  Learn more in the [IDE Integration](/ide-integration/overview) section.
</Note>

## Key Features

### Intelligent Code Understanding

* **Codebase Analysis**: Ask questions about your entire project structure
* **File References**: Use `@filename` to include specific files in context
* **Multi-File Refactoring**: Make changes across multiple files safely

### Powerful Tools & Agents

* **SubAgents**: Delegate complex tasks to specialized AI agents
* **Skills System**: Reusable skill modules for common workflows
* **MCP Support**: Connect to Model Context Protocol servers
* **LSP Integration**: Leverage Language Server Protocol for code intelligence

### Flexible Authentication

Choose the authentication method that works best for you:

<CardGroup cols={2}>
  <Card title="Qwen OAuth" icon="shield-check">
    **Recommended**: Sign in with your qwen.ai account. Get 1,000 free requests daily.
  </Card>

  <Card title="API Key" icon="key">
    Use your own API keys from OpenAI, Anthropic, Google GenAI, or Alibaba Cloud.
  </Card>
</CardGroup>

### Advanced Capabilities

* **Sandbox Execution**: Run commands safely in isolated Docker/Podman containers
* **Token Caching**: Reduce costs with intelligent prompt caching
* **Memory System**: Maintain context across sessions
* **Approval Modes**: Control AI actions with `--yolo` or step-by-step approval

## Use Cases

Qwen Code excels at a wide range of development tasks:

<AccordionGroup>
  <Accordion title="Code Understanding">
    * "What does this codebase do?"
    * "Explain the architecture of this project"
    * "Find all the places where user authentication is handled"
    * "How does the payment flow work?"
  </Accordion>

  <Accordion title="Code Generation">
    * "Generate unit tests for this module"
    * "Create a REST API endpoint for user management"
    * "Add error handling to this function"
    * "Implement a caching layer for database queries"
  </Accordion>

  <Accordion title="Refactoring & Optimization">
    * "Refactor this function to be more readable"
    * "Convert this code from JavaScript to TypeScript"
    * "Optimize this database query for performance"
    * "Split this large component into smaller, reusable pieces"
  </Accordion>

  <Accordion title="Debugging & Troubleshooting">
    * "Why is this test failing?"
    * "Find and fix the memory leak in this code"
    * "Debug the race condition in this async function"
    * "Identify security vulnerabilities in this authentication flow"
  </Accordion>

  <Accordion title="Documentation & Review">
    * "Add JSDoc comments to all exported functions"
    * "Review this PR for code quality issues"
    * "Generate a README for this project"
    * "Create API documentation from these endpoints"
  </Accordion>
</AccordionGroup>

## Technology Stack

Qwen Code is built with modern, production-ready technologies:

* **Runtime**: Node.js 20+
* **Language**: TypeScript 5.3+ with strict mode
* **UI Framework**: Ink (React for CLI)
* **Build Tool**: esbuild for fast compilation
* **Testing**: Vitest with comprehensive test coverage

## Project Background

Qwen Code is based on [Google Gemini CLI](https://github.com/google-gemini/gemini-cli), with significant adaptations to better support Qwen-Coder models. The project is actively maintained by the Qwen team and welcomes community contributions.

<CardGroup cols={2}>
  <Card title="GitHub Repository" icon="github" href="https://github.com/QwenLM/qwen-code">
    Star the repo and contribute to the project
  </Card>

  <Card title="Join Discord" icon="discord" href="https://discord.gg/ycKBjdNd">
    Get help and connect with the community
  </Card>
</CardGroup>

## Performance

Qwen Code delivers strong performance on terminal-based coding benchmarks:

| Agent     | Model              | Terminal-Bench Accuracy |
| --------- | ------------------ | ----------------------- |
| Qwen Code | Qwen3-Coder-480A35 | 37.5%                   |
| Qwen Code | Qwen3-Coder-30BA3B | 31.3%                   |

<Note>
  Terminal-Bench measures an AI agent's ability to complete real-world terminal-based coding tasks.
</Note>

## Next Steps

Ready to get started? Follow these guides:

<Steps>
  <Step title="Install Qwen Code">
    Choose your preferred installation method: npm, Homebrew, or install script.

    [Go to Installation →](/installation)
  </Step>

  <Step title="Set Up Authentication">
    Configure Qwen OAuth for free tier access or connect your API keys.

    [Go to Authentication →](/authentication)
  </Step>

  <Step title="Run Your First Session">
    Launch Qwen Code and complete your first AI-assisted coding task.

    [Go to Quick Start →](/quickstart)
  </Step>
</Steps>

<Warning>
  **Node.js 20 or later is required**. Make sure you have the correct version installed before proceeding.
</Warning>
