The core of Pywen is a command line interface (CLI) tool built on Python, which integrates the capabilities of AliCloud's latest big model of code, Qwen3-Coder, directly into the developer's terminal. It is specifically designed to handle all kinds of intelligent software engineering tasks, providing developers with an efficient and intelligent code assistant. Users can drive an advanced intelligent body system to perform complex development workflows, such as writing code, fixing bugs, refactoring projects and even creating complete application skeletons, through conversational natural language commands in a familiar command line environment.The design philosophy of the Pywen project is to provide a transparent and modularized architecture, which is not only a practical development tool, but also an ideal research platform. Researchers and developers can easily modify, extend, and analyze its inner workings, making it ideal for researching AI intelligences architectures, conducting ablation experiments, and developing new intelligences features.
Function List
- Qwen3-Coder Driver: Based on Qwen3-Coder-Plus, the latest code-specific large language model from Aliyun, it provides powerful support for code generation, understanding and debugging.
- Command Line Interaction: Interact with intelligences by typing natural language commands at the terminal to accomplish complex software development tasks.
- Modular Architecture: A modular design that is easy to expand and customize, facilitating research and development of new AI intelligences capabilities.
- Extensive toolset: Built-in file manipulation (create, edit, read), Bash command execution, structured problem decomposition and a series of utilities.
- YOLO mode: Provide a "one-touch confirmation" mode (
Ctrl+Y
), allowing intelligences to automate all operations from the command line to speed up workflow. - track record: Record in detail every thought and operation of an intelligent body (Agent) and generate trajectory files for debugging and behavioral analysis.
- Intelligent Configuration: A configuration wizard will be launched automatically when it is first run, guiding the user through the necessary settings such as API keys.
- Session statistics: You can track the number of API calls, Token consumption, and usage of various tools in real time.
Using Help
This help is based on the official documentation and is designed to enable users to quickly get started and become proficient in using Pywen.
1. Installation
Pywen is available as a Python package through thepip
command to install directly from the PyPI repository. Open your terminal and run the following command:
pip install pywen
Once the installation is complete, you will be able to use any path in the terminalpywen
Command.
2. First-time use and configuration
After installation, type directly into the terminalpywen
command to start the program:
pywen
If this is the first time you run it, Pywen will detect that there is no configuration file and automatically start a configuration wizard to help you set it up.
Configuration file not found, starting setup wizard...
API Key: [在这里输入你的Qwen API Key]
Base URL: https://dashscope.aliyuncs.com/compatible-mode/v1
Model: qwen3-coder-plus
...
✅ Configuration saved to pywen_config.json
You only need to follow the prompts to enter the API Key obtained from AliCloud Dashscope (Tongyi Qianqian) to complete the basic configuration. Configuration Filepywen_config.json
will be saved in the current directory.
3. Basic usage
Once the configuration is complete, Pywen goes to an interactive command line interface. Now you can give it tasks directly in natural language, as if you were talking to a human.
For example, you can try:
> 创建一个Python脚本来计算斐波那契数列
> 重构 main.py 里的函数,让它们更高效
> 修复这个项目里的bug,并为主要功能添加单元测试
> 创建一个新的Flask Web应用,并包含合理的文件结构
Pywen's intelligence will analyze your needs and invoke tools such as file manipulation, code generation, and shell commands to complete the task step by step.
4. System commands
Pywen provides a number of functions that begin with/
Built-in commands at the beginning for program management and information query:
/help
: Displays help information./tools
: Lists all the tools currently available to the smartbody./stats
: View statistics about the current session, such as the number of API calls and Token usage./clear
: Clear the screen and current dialog history./memory
: Viewing and managing the contents of an intelligence's memory./quit
: Exit the Pywen program.!<命令>
: Execute a Shell/CMD command directly without exiting Pywen, e.g.!ls -l
The
5. YOLO mode (use with caution)
This is an advanced feature for improving execution efficiency.
- Switching method: Press
Ctrl+Y
The YOLO mode can be turned on or off. - Default behavior: In normal mode, whenever the smart body needs to perform a potentially risky operation (e.g., modifying a file, executing a command), it requests confirmation from the user.
- YOLO model behavior: When turned on, all tool calls are automatically approved and no longer require manual confirmation by the user. This speeds up the execution of tasks considerably, but also removes security.
- Risk Warning: Since the AI may misinterpret instructions, it may perform incorrect or destructive operations in YOLO mode. Please use this mode with clear mission objectives and manageable risk.
6. Environment and configuration
Pywen throughpywen_config.json
file for configuration, and environment variables are also supported.
- configuration file: When the program starts, it reads the current directory of the
pywen_config.json
The - environment variable: You can also provide API keys by setting environment variables, which is especially useful in Continuous Integration (CI/CD) or Docker environments.
# Qwen API Key (必需) export QWEN_API_KEY="your-qwen-api-key" # 工具API Key (推荐配置,用于增强功能) export SERPER_API_KEY="your-serper-api-key" # 用于网页搜索 export JINA_API_KEY="your-jina-api-key" # 用于读取网页内容
- Configuring Priorities: Command Line Arguments > Profiles > Environment Variables > Defaults.
application scenario
- Rapid Prototyping
When you have a new idea, you can tell Pywen directly at the command line: "Create a backend service for a to-do list application with FastAPI, including database model and add, delete, and check APIs".Pywen will generate the project structure and write sample code for you, so that you can quickly enter the development phase of business logic. - Code refactoring and optimization
For old or inefficient code in your project, you can let Pywen take care of it: "Analyze thedata_processor.py
file's performance bottlenecks and refactor the functions in it to improve efficiency". Intelligence will read, analyze and modify the code while keeping the functionality intact. - Automated Testing and Debugging
You can hand over your entire project to Pywen with the instruction, "Write unit tests for all the public functions in this project and fix all the tests that fail." Pywen can call the test framework, execute the tests, analyze the error reports, and try to fix the bugs automatically. - AI Intelligent Body Architecture Research
For AI researchers, Pywen is an excellent platform for experimentation. Its modular design and transparent trajectory logging feature can be easily used to test new Agent decision logics, tool combinations, or memory mechanisms, and to validate research hypotheses by analyzing trajectory files.
QA
- Q: What is the relationship between Pywen and Qwen3-Coder?
A: Pywen is an upper-level application tool, and the Qwen3-Coder Pywen is the underlying driving engine. It can be understood that Qwen3-Coder is the "brain" responsible for thinking and generating content, while Pywen provides the "body" and "limbs" that allow this "brain" to interact with your computer's file system and command line, and provides a user-friendly command line interface. Pywen provides the "body" and "limbs" that allow the "brain" to interact with your computer's file system and command line, and provides a user-friendly command line interface. - Q: Is it free to use Pywen?
A: Pywen The software itself is open source and free (following the MIT license). However, it runs on calls to the Qwen model API provided by Aliyun Tongyi Qianqian (Dashscope).These API calls incur a cost, and you need to pay for your API Key usage according to Aliyun's official pricing. - Q: Why do I need to configure SERPER_API_KEY or JINA_API_KEY?
A: These are optional enhancement tools.SERPER_API_KEY
Gives the intelligence the ability to do web searches, so that it can go online to find information when it encounters a problem that is outside of its knowledge or requires up-to-date information.JINA_API_KEY
They allow intelligences to efficiently "read" and understand web content. Configuring them can greatly expand the boundaries of the intelligence's capabilities. - Q: What are the specific risks of the YOLO model?
A: The risk is that the AI may misinterpret your instructions. For example, when you ask to "clean up old log files", if your instruction is not clear enough, the AI may incorrectly recognize important configuration files as "old files" and perform the deletion action. In YOLO mode, this deletion will happen without your confirmation, which may result in project corruption or data loss.