Qwen Code Leverages Qwen3 as a CLI Agentic Programming Tool

0
8


Image by Editor

 

Introduction

 
With the recent surge of code-centric large language models, many developers and programmers have started to rely on them to improve productivity. Capabilities such as code suggestions, debugging, and even scaling an entire project are now possible with these tools.

With technological advancements, the idea of agentic AI has been introduced to support our work. As an agentic approach can reason about tasks and decide on the best next step to reach a goal, it has become a vital tool developers can adopt today. By integrating code-focused models with an agentic framework, we can create a personalized coding assistant that understands our needs from a simple prompt.

One of the most prominent open-source code-centric models is the Qwen3-Coder, which boasts strong capabilities in agentic coding tasks. With a strong model like this, the team then released a CLI agentic programming tool called Qwen Code to assist our coding work.

In this article, we will explore how to use Qwen Code in practice.

 

Qwen Code

 
Qwen Code is an agentic command-line (CLI) workflow tool based on the Gemini CLI that has been adapted for the Qwen3-Coder models. This CLI tool aims to improve development workflows with an intelligent assistant that can understand your environment and act based on your prompt. Furthermore, the tool provides ways to automate operational tasks and parsing enhancements specific to the Qwen-Coder models.

The CLI tool is free to use and offers two authentication options: Qwen OAuth and an OpenAI-compatible API. The recommended method is Qwen OAuth, which we will explore in this article. Qwen OAuth provides free options, including 2000 requests per day and a rate limit of 60 requests per minute, with no token limit, which we will take advantage of.

To start using Qwen Code, you need Node.js version 20 or higher installed. You can download it from the source or use the following code.

curl -qL https://www.npmjs.com/install.sh | sh

 

After installation, use npm to download the tool into your environment with the code below.

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

 

If you prefer to install Qwen Code from source, you can use the following commands:

git clone https://github.com/QwenLM/qwen-code.git
cd qwen-code
npm install
npm install -g .

 

With Qwen Code installed, let’s try it out. In this article, we will evaluate a coding project—specifically the Local RAG recipe project I developed. You can use your own project and code repository.

Let’s start by activating Qwen Code using the following command in your preferred directory.

 
Qwen Code Leverages Qwen3 as a CLI Agentic Programming Tool
 

The first thing Qwen Code will ask you to do is authenticate. For this article, we will select Qwen OAuth, and you will be redirected to the browser.

 
Qwen Code Leverages Qwen3 as a CLI Agentic Programming Tool

 
Select your preferred way to log in—there are many options to authenticate your profile. Once you have logged in, return to your CLI, and you are ready to work with Qwen Code.

Start using Qwen Code by passing a prompt into the CLI. For example, I used the prompt: “describe the code here”

 
Qwen Code Leverages Qwen3 as a CLI Agentic Programming Tool
 

Qwen Code will perform an agentic process and examine the entire project repository.

 
Qwen Code Leverages Qwen3 as a CLI Agentic Programming Tool
 

Then Qwen Code will provide a complete explanation based on the prompt. In this example, it explains the code in the directory and its purpose.

 
Qwen Code Leverages Qwen3 as a CLI Agentic Programming Tool
 

Using Qwen Code, you can ask it to execute actions on your behalf. For example, you could ask to improve the code repository using the prompt: “what parts of this module can be optimized?”

 
Qwen Code Leverages Qwen3 as a CLI Agentic Programming Tool
 

Qwen Code will present possible optimizations and suggested changes to implement.

 
Qwen Code Leverages Qwen3 as a CLI Agentic Programming Tool
 

You can then accept or reject the changes, maintaining a human-in-the-loop workflow. If you wish, you can enable automatic changes so you do not need to accept them repeatedly.

Qwen Code can also create required files on its own, such as the requirements.txt shown below.

 

 

Lastly, you can specify a folder or files you want Qwen Code to process. For example, I used the prompt "@chroma_db, please explain to me what this folder is all about". The result is shown below:

 
Qwen Code Leverages Qwen3 as a CLI Agentic Programming Tool
 

The result shows the purpose of each file in the directory and how it is used.

If you want to improve your Qwen Code experience, you can create a file .qwen/settings.json and fill it with the settings you want. For example, you can set the token limit using the following:

{
  "sessionTokenLimit": 32000
}

 

Additionally, you can use various commands, such as /help to display all available Qwen Code commands or /stats to show the current Qwen Code session information.

That’s the basic usage of Qwen Code; try various prompts on your projects to see how it can help your work.

 

Wrapping Up

 
Qwen Code is an agentic CLI tool that utilizes Qwen3-Coder, a powerful code-focused model. By adapting the tool from Gemini CLI, Qwen Code can understand your code and automate many fundamental tasks with a simple prompt.

I hope this has helped!
 
 

Cornellius Yudha Wijaya is a data science assistant manager and data writer. While working full-time at Allianz Indonesia, he loves to share Python and data tips via social media and writing media. Cornellius writes on a variety of AI and machine learning topics.