basant307/AI_Governance_Project
045
1# Quickstart2 3> ๐ Welcome to Qwen Code!4 5This quickstart guide will have you using AI-powered coding assistance in just a few minutes. By the end, you'll understand how to use Qwen Code for common development tasks.6 7## Before you begin8 9Make sure you have:10 11- A **terminal** or command prompt open12- A code project to work with13- An API key from Alibaba Cloud ModelStudio ([Beijing](https://bailian.console.aliyun.com/) / [intl](https://modelstudio.console.alibabacloud.com/)), or an Alibaba Cloud Coding Plan ([Beijing](https://bailian.console.aliyun.com/cn-beijing/?tab=coding-plan#/efm/coding-plan-index) / [intl](https://modelstudio.console.alibabacloud.com/?tab=coding-plan#/efm/coding-plan-index)) subscription14 15## Step 1: Install Qwen Code16 17To install Qwen Code, use one of the following methods:18 19### Quick Install (Recommended)20 21**Linux / macOS**22 23```sh24curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen-standalone.sh | bash25```26 27**Windows**28 29```powershell30irm https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen-standalone.ps1 | iex31```32 33> [!note]34>35> It's recommended to restart your terminal after installation to ensure environment variables take effect.36 37### Manual Installation38 39**Prerequisites**40 41Make sure you have Node.js 22 or later installed. Download it from [nodejs.org](https://nodejs.org/en/download).42 43**NPM**44 45```bash46npm install -g @qwen-code/qwen-code@latest47```48 49**Homebrew (macOS, Linux)**50 51```bash52brew install qwen-code53```54 55## Step 2: Set up authentication56 57When you start an interactive session with the `qwen` command, you'll be prompted to configure authentication:58 59```bash60# You'll be prompted to set up authentication on first use61qwen62```63 64```bash65# Or run /auth anytime to change authentication method66/auth67```68 69The first-run menu lets you connect a model provider. Choose one of:70 71- **Alibaba ModelStudio** โ the recommended setup. Opens a sub-menu:72 - **Coding Plan**: for individual developers, with an included weekly quota and diverse model options. See the [Coding Plan guide](https://bailian.console.aliyun.com/cn-beijing/?tab=coding-plan#/efm/coding-plan-index) ([intl](https://modelstudio.console.alibabacloud.com/?tab=coding-plan#/efm/coding-plan-index)) for setup instructions.73 - **Token Plan**: usage-based billing with a dedicated endpoint, aimed at teams and companies.74 - **Standard API Key**: connect with an existing API key from Alibaba Cloud ModelStudio ([Beijing](https://bailian.console.aliyun.com/) / [intl](https://modelstudio.console.alibabacloud.com/)). See the API setup guide ([Beijing](https://bailian.console.aliyun.com/cn-beijing/?tab=doc#/doc/?type=model&url=3023091) / [intl](https://modelstudio.console.alibabacloud.com/ap-southeast-1?tab=doc#/doc/?type=model&url=2974721)) for details.75- **Third-party Providers** โ choose a built-in provider (DeepSeek, MiniMax, Z.AI, ModelScope, OpenRouter, Requesty, and more) and connect with an API key.76- **Custom Provider** โ manually connect a local server, proxy, or unsupported provider.77 78> โ ๏ธ **Note**: Qwen OAuth was discontinued on April 15, 2026. If you were previously using Qwen OAuth, please switch to one of the methods above.79 80> [!note]81>82> When you first authenticate Qwen Code with your Qwen account, a workspace called ".qwen" is automatically created for you. This workspace provides centralized cost tracking and management for all Qwen Code usage in your organization.83 84> [!tip]85>86> To configure authentication, start Qwen Code and run `/auth`. Use `/doctor` to check your current configuration at any time. See the [Authentication](./configuration/auth) page for details.87 88## Step 3: Start your first session89 90Open your terminal in any project directory and start Qwen Code:91 92```bash93# optional94cd /path/to/your/project95# start qwen96qwen97```98 99You'll see the Qwen Code welcome screen with your session information, recent conversations, and latest updates. Type `/help` for available commands.100 101## Chat with Qwen Code102 103### Ask your first question104 105Qwen Code will analyze your files and provide a summary. You can also ask more specific questions:106 107```108explain the folder structure109```110 111You can also ask Qwen Code about its own capabilities:112 113```114what can Qwen Code do?115```116 117> [!note]118>119> Qwen Code reads your files as needed - you don't have to manually add context. Qwen Code also has access to its own documentation and can answer questions about its features and capabilities.120 121### Make your first code change122 123Now let's make Qwen Code do some actual coding. Try a simple task:124 125```126add a hello world function to the main file127```128 129Qwen Code will:130 1311. Find the appropriate file1322. Show you the proposed changes1333. Ask for your approval1344. Make the edit135 136> [!note]137>138> Qwen Code always asks for permission before modifying files. You can approve individual changes or enable "Accept all" mode for a session.139 140### Use Git with Qwen Code141 142Qwen Code makes Git operations conversational:143 144```145what files have I changed?146```147 148```149commit my changes with a descriptive message150```151 152You can also prompt for more complex Git operations:153 154```155create a new branch called feature/quickstart156```157 158```159show me the last 5 commits160```161 162```163help me resolve merge conflicts164```165 166### Fix a bug or add a feature167 168Qwen Code is proficient at debugging and feature implementation.169 170Describe what you want in natural language:171 172```173add input validation to the user registration form174```175 176Or fix existing issues:177 178```179there's a bug where users can submit empty forms - fix it180```181 182Qwen Code will:183 184- Locate the relevant code185- Understand the context186- Implement a solution187- Run tests if available188 189### Test out other common workflows190 191There are a number of ways to work with Qwen Code:192 193**Refactor code**194 195```196refactor the authentication module to use async/await instead of callbacks197```198 199**Write tests**200 201```202write unit tests for the calculator functions203```204 205**Update documentation**206 207```208update the README with installation instructions209```210 211**Code review**212 213```214review my changes and suggest improvements215```216 217> [!tip]218>219> **Remember**: Qwen Code is your AI pair programmer. Talk to it like you would a helpful colleague - describe what you want to achieve, and it will help you get there.220 221## Essential commands222 223Here are the most important commands for daily use:224 225| Command | What it does | Example |226| --------------------- | ------------------------------------------------ | ----------------------------- |227| `qwen` | start Qwen Code | `qwen` |228| `/auth` | Change authentication method (in session) | `/auth` |229| `/doctor` | Check current authentication and environment | `/doctor` |230| `/help` | Display help information for available commands | `/help` or `/?` |231| `/compress` | Replace chat history with summary to save Tokens | `/compress` |232| `/clear` | Clear terminal screen content | `/clear` (shortcut: `Ctrl+L`) |233| `/theme` | Change Qwen Code visual theme | `/theme` |234| `/language` | View or change language settings | `/language` |235| โ `ui [language]` | Set UI interface language | `/language ui zh-CN` |236| โ `output [language]` | Set LLM output language | `/language output Chinese` |237| `/quit` | Exit Qwen Code immediately | `/quit` or `/exit` |238 239See the [CLI reference](./features/commands) for a complete list of commands.240 241## Pro tips for beginners242 243**Be specific with your requests**244 245- Instead of: "fix the bug"246- Try: "fix the login bug where users see a blank screen after entering wrong credentials"247 248**Use step-by-step instructions**249 250- Break complex tasks into steps:251 252```2531. create a new database table for user profiles2542. create an API endpoint to get and update user profiles2553. build a webpage that allows users to see and edit their information256```257 258**Let Qwen Code explore first**259 260- Before making changes, let Qwen Code understand your code:261 262```263analyze the database schema264```265 266```267build a dashboard showing products that are most frequently returned by our UK customers268```269 270**Save time with shortcuts**271 272- Press `?` to see all available keyboard shortcuts273- Use Tab for command completion274- Press โ for command history275- Type `/` to see all slash commands276 277## Getting help278 279- **In Qwen Code**: Type `/help` or ask "how do I..."280- **Documentation**: You're here! Browse other guides281- **Community**: Join our [GitHub Discussion](https://github.com/QwenLM/qwen-code/discussions) for tips and support282 