I have tested it and discovered what it has to offer and why you should try it.

But if you are not familiar with Qwen or Alibaba AI models,

Qwen has been quietly building some of the most capable coding models in the market, competing directly with OpenAI and Anthropic's offerings.

But now,

The trend seems to be moving AI coding to the terminal for good reasons.

  • Terminal coding natively offers direct file system access
  • Integration with your existing development workflow
  • The ability to handle complex multi-file operations without the limitations of web-based interfaces.

We have since seen several terminal coding AI assistants released since the release of Claude Code, and we can expect more to come.

Now, what does Qwen Code offer?

First, it's open-source and free, available on GitHub.

It's important to note Qwen Code is based on Gemini CLI, but the main contribution focuses on parser-level adaptations to support Qwen-Coder models better, making it a specialized tool rather than just another fork.

In this article,

I will show you how to get it installed, how to authenticate with OpenAI keys, and the basic usage of Qwen Code.

I will also follow up with a quick getting-started Qwen Code Cheat Sheet with detailed models set up and all possible commands, just like I did for Claude Code here and Gemini CLI here.

So,

What is Qwen Code?

Qwen Code Screenshot
Qwen Code Screenshot

Qwen Code is a command-line AI workflow tool adapted from Gemini CLI, optimized for Qwen3-Coder models with enhanced parser support and tool support.

It's like Google's Gemini CLI, but rebuilt specifically to work better with Alibaba's Qwen coding models.

The team built it into the parser level to make sure it understands and works with how Qwen-Coder processes and generates code.

Key Features

  • Code Understanding & Editing — Query and edit large codebases beyond traditional context window limits.
  • Workflow Automation — Automate operational tasks like handling pull requests and complex rebases.
  • Enhanced Parser — Adapted parser specifically optimized for Qwen-Coder models.
  • Large Codebase Support — Query and edit large codebases that would usually exceed context limits in other tools.
  • Operational Task Automation — Automate complex tasks like querying pull requests or handling messy git rebases.

Now, how do you get started with Qwen Code?

Let's get our hands dirty and install it to see the steps:

Qwen Code Setup Instructions

Qwen Code Installtion Screenshot
Qwen Code Installtion Screenshot

The installation process is straightforward, similar to other terminal AI tools, but with some Qwen-specific configuration steps.

Installation

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

Then run from anywhere:

qwen
Qwen Code Start Test
Qwen Code Start Test

Or you can install it from source if you want the latest features:

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

API Configuration

Set your Qwen API key. In Qwen Code project, you can also set your API key in .env file — the .env file should be placed in the root directory of your current project.

You'll need to visit https://modelstudio.console.alibabacloud.com/ to apply for your API key.


export OPENAI_API_KEY="your_api_key_here"
export OPENAI_BASE_URL="your_api_base_url_here"
export OPENAI_MODEL="your_api_model_here"

My Experience Setting Up

Step 1: You are prompted to select the theme first.

None

Once you have selected the theme, like in my case, I opted for Shades of Purple Dark.

Step 2: You can now authenticate with your API.

None

I opted to use OpenAI key for testing purposes. Here are the instructions:

Step 3: I created a new key in my OpenAI console

None

Step 4: I added the key after creating a new key on OpenAI console and configured the details as follows:

None
Qwen Code API Set up

The Base URL and Model fields in OpenAI configuration work like this:

Base URL:

  • This is the web address where API requests are sent
  • For standard OpenAI usage, you can leave this blank or use: https://api.openai.com/v1
  • Only change this if you're using a different service that's compatible with OpenAI's API format (like some local AI servers or alternative providers)

Model:

  • This specifies which AI model to use
  • Common OpenAI models include:
  • gpt-4o (latest GPT-4 model, recommended)
  • gpt-4o-mini (faster, cheaper version)
  • gpt-4-turbo (previous generation)
  • gpt-3.5-turbo (older, cheaper option)

For a standard OpenAI setup:

  • API Key: Enter your key from platform.openai.com
  • Base URL: Leave blank or use https://api.openai.com/v1
  • Model: Use gpt-4o for best results

The API key is the most important part — that's what authenticates you with OpenAI's service.

You can get one by creating an account at platform.openai.com and going to the API keys section as I have shared in the screencast above.

Qwen Code Usage Examples

Qwen Code Prompt Example
Qwen Code Prompt Example

The general usage examples from Qwen Code documentation are as follows:

Explore Codebases

cd your-project/
qwen
> Describe the main pieces of this system's architecture

Qwen Code understands and explains complex system architectures.

Code Development

> Refactor this function to improve readability and performance

Automate Workflows

> Analyze git commits from the last 7 days, grouped by feature and team member
> Convert all images in this directory to PNG format

Popular Tasks

Understand New Codebases

> What are the core business logic components?
> What security mechanisms are in place?
> How does the data flow work?

Code Refactoring & Optimization

> What parts of this module can be optimized?
> Help me refactor this class to follow better design patterns
> Add proper error handling and logging

Documentation & Testing

> Generate comprehensive JSDoc comments for this function
> Write unit tests for this component
> Create API documentation

Testing Qwen Code Commands

Qwen Code Commands
Testing Qwen Code Commands

Now it's time for us to test the commands available on Qwen Code.

Here are some of the basic commands I tested to help you get started.

Qwen Code Commands
About Command

I tested everything from simple code explanations to complex refactoring tasks, and the results were surprisingly good.

Qwen Code Test
Clear Command

The parser improvements show — it understands context better and generates more accurate code than I expected from a Gemini CLI fork.

Qwen Code Test
Help Command

I have also documented this in a Qwen Code cheat sheet post that can help you get started fast, and it's backed up by a special git repo that I will update often to help you have a common place of reference.

Qwen Code Commands List
Qwen Code Commands List

Final Thoughts

Look, after testing, Qwen Code is more like Gemini CLI, but that's not necessarily a bad thing.

What makes it a great option is its integration with the new Qwen models, especially the recently announced Qwen3-Coder.

Alibaba just released Qwen3-Coder-480B-A35B-Instruct, a massive 480B-parameter model that's setting new benchmarks in agentic coding tasks. We're talking about performance comparable to Claude Sonnet 4, but in an open-source package.

Qwen Code was forked from Gemini CLI and adapted with customized prompts and function calling protocols to unleash the capabilities of Qwen3-Coder.

For now, I'm adding Qwen Code to my terminal AI toolkit alongside Claude Code and Gemini CLI. Each has its strengths, but Qwen Code's integration with the new Qwen3-Coder models makes it useful for my low-budget coding projects.

Have you tried Qwen Code yet? What's your experience?

And just as I discovered the error in Gemini CLI terminal when running on PowerShell, Qwen Code has inherited the same error :)

Have you seen this?

Qwen Code Launch Error
Qwen Code Launch Error

Let's Connect!

If you are new to my content, my name is Joe Njenga

Join thousands of other software engineers, AI engineers, and solopreneurs who read my content daily on Medium and on YouTube where I review the latest AI engineering tools and trends. If you are more curious about my projects and want to receive detailed guides and tutorials, join thousands of other AI enthusiasts in my weekly AI Software engineer newsletter

If you would like to connect directly, you can reach out here:

Follow me on Medium | YouTube Channel | X | LinkedIn