# AI use cases for Qwen Code (QwenLM/qwen-code)

Repo: [QwenLM/qwen-code](https://github.com/QwenLM/qwen-code) | Use cases: 3 | Page: https://dedupedai.com/use-cases/qwenlm-qwen-code/

Qwen Code is an open-source AI coding agent for the terminal, editor, desktop, browser and chat. It ships SubAgents, Agent Teams, Auto-Memory, Auto-Skills, MCP, Plan Mode, sandbox and git worktrees, and works with OpenAI, Anthropic, Gemini and Qwen APIs or local models through Ollama and vLLM. It also runs headless in scripts, as a shared daemon over HTTP, through Python, TypeScript and Java SDKs, and from Telegram, DingTalk, WeChat and Feishu.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Run an open-source coding agent with any model: https://dedupedai.com/use-cases/qwenlm-qwen-code/run-an-open-source-coding-agent-with-any-model/
- Run a coding agent in scripts and CI: https://dedupedai.com/use-cases/qwenlm-qwen-code/use-qwen-code-headless-in-ci/
- Let Claude or Codex hand coding tasks to Qwen Code: https://dedupedai.com/use-cases/qwenlm-qwen-code/let-other-agents-delegate-to-qwen-code/

## How to run an open-source coding agent with any model with Qwen Code

Repo: [QwenLM/qwen-code](https://github.com/QwenLM/qwen-code) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Install Qwen Code, pick a provider with /auth and have it explain and change your repository.

**Who it is for:** A developer who likes the Claude Code workflow but wants open source and freedom to switch models.

**The problem:** Most terminal coding agents tie you to one vendor's models and pricing.

**The outcome:** A terminal agent working in your project with the provider of your choice, switchable at runtime.

### Steps

1. Install with `npm install -g @qwen-code/qwen-code@latest` (Node.js 22+) or `brew install qwen-code`
2. Restart your terminal, then run `cd /path/to/your-project` and start the agent with qwen
3. Inside the session run /auth to configure your provider and API key
4. Try the README's first prompt: Explain this repository and show me where to start
5. See the Authentication Guide to use a local model through Ollama or vLLM

### Prompt to paste into your agent

```text
Install QwenLM/qwen-code, start it in this project with qwen, configure <provider> with /auth, then explain this repository and propose a plan for <task> in Plan Mode before changing any files.
```

### Caveat

Model costs depend on the provider you choose; a local model avoids API bills but needs capable hardware.

Risk, remote script: The standalone installer pipes a script from an Aliyun storage bucket into your shell; npm or Homebrew avoid that.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/qwenlm-qwen-code/run-an-open-source-coding-agent-with-any-model/

## How to run a coding agent in scripts and CI with Qwen Code

Repo: [QwenLM/qwen-code](https://github.com/QwenLM/qwen-code) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Use Qwen Code's headless mode or Python SDK to run agent tasks in batch jobs and pipelines.

**Who it is for:** A platform engineer who wants an agent to summarise, review or fix code as a CI step.

**The problem:** Interactive agents are hard to use in automation, where there is no one to type prompts.

**The outcome:** Scripted agent runs with qwen -p in CI, or a Python program that streams results from the SDK.

### Steps

1. Install Qwen Code and configure a provider as in the Quick Start
2. Run headless with `qwen -p "..."` in scripts, CI/CD or batch jobs
3. Or use the Python SDK: call query with a prompt, cwd and path_to_qwen_executable, as in the README example
4. Print only result messages using is_sdk_result_message
5. Store provider keys as CI secrets rather than in the repository

### Prompt to paste into your agent

```text
Add a CI step that runs QwenLM/qwen-code headless with `qwen -p "..."` to <task, for example summarise changed files>. Use the provider key from the CI secret <name> and fail the job if the agent reports errors.
```

### Caveat

An agent with write access in CI can change code; start with read-only tasks such as summaries.

Risk, credentials: CI runs need a provider API key; store it as a secret and scope it to the minimum.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/qwenlm-qwen-code/use-qwen-code-headless-in-ci/

## How to let Claude or Codex hand coding tasks to Qwen Code with Qwen Code

Repo: [QwenLM/qwen-code](https://github.com/QwenLM/qwen-code) | Difficulty: Intermediate | Time: 20 minutes | Basis: From the README

Use the Qwen Code Claw skill so other agents delegate coding work to Qwen Code over ACP.

**Who it is for:** Someone running several agents who wants a cheaper or open model to take some coding tasks.

**The problem:** Coordinating several coding agents by hand means copying context between terminals.

**The outcome:** Claude, Codex or another agent delegating tasks to Qwen Code through acpx, following an official skill.

### Steps

1. Paste the README's prompt into your agent: Use Qwen Code as a coding agent
2. The agent fetches the qwen-code-claw SKILL.md from the Qwen Code repository
3. It follows that skill to install, authenticate and use Qwen Code via acpx
4. Optionally run `qwen serve` to connect clients over HTTP and SSE as a shared daemon
5. Review the delegated changes before merging them

### Prompt to paste into your agent

```text
Use Qwen Code as a coding agent. First, fetch and read this skill reference: https://raw.githubusercontent.com/QwenLM/qwen-code/refs/heads/main/.qwen/skills/qwen-code-claw/SKILL.md. Then follow it to install, authenticate and use Qwen Code via acpx for <task>.
```

### Caveat

The daemon mode and Web UI are marked experimental in the README.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/qwenlm-qwen-code/let-other-agents-delegate-to-qwen-code/
