docs/developers/architecture.md
This document provides a high-level overview of Qwen Code's architecture.
Qwen Code is primarily composed of two main packages, along with a suite of tools that can be used by the system in the course of handling command-line input:
packages/cli)Purpose: This contains the user-facing portion of Qwen Code, such as handling the initial user input, presenting the final output, and managing the overall user experience.
Key Functions:
/help, /clear, /model), at commands (@file for including file content), and exclamation mark commands (!command for shell execution).packages/core)Purpose: This acts as the backend for Qwen Code. It receives requests sent from packages/cli, orchestrates interactions with the configured model API, and manages the execution of available tools.
Key Functions:
packages/core/src/tools/)Purpose: These are individual modules that extend the capabilities of the Qwen model, allowing it to interact with the local environment (e.g., file system, shell commands, web fetching).
Interaction: packages/core invokes these tools based on requests from the Qwen model.
Common Tools Include:
A typical interaction with Qwen Code follows this flow:
packages/cli.packages/cli sends the user's input to packages/core.Qwen Code offers multiple ways to configure its behavior:
.qwen/settings.json)~/.qwen/settings.json)