TRAE Tutorial
TRAE is launched by ByteDance as an AI-native programming product, combining the integrated development environment (IDE) with an AI assistant to help developers understand projects, write code, troubleshoot problems and complete development tasks.
An IDE can be understood as a programmer's workbench: the editor is for writing code, the terminal for running commands, debugging tools for locating problems, and version control for managing changes. TRAE adds AI on top of these tools, letting us describe requirements directly in natural language and then view the generated code and running results.
For example, we can enter "explain what this function does", or request "add a search feature to the current web page". When learning code, we can ask while reading; when implementing features, we can let the agent help break down tasks and modify files, then check the results ourselves.
Main Features of TRAE
- **Chinese interface and Chinese interaction:** supports describing requirements in Chinese, making it easier for beginners to understand operations and read replies.
- **AI Q&A and automatic programming:** can both explain code and analyze errors, and help implement features by working with project files.
- **IDE / SOLO dual modes:** you can operate step by step in the code editing interface, or let the AI plan and execute around a task; there is also an Agent window for centrally managing tasks.
- **CUE intelligent code completion:** provides completion and modification suggestions while writing code, reducing repetitive typing.
- **Continuing familiar development tools:** supports VS Code extensions and provides an entry to import configurations from VS Code or Cursor; after migration you still need to check that required extensions work properly.
- **Multiple model choices:** supports built-in models and custom models; you can switch as needed per task, or configure your own API Key.
- **Multi-platform support:** the desktop version offers Windows, macOS and Linux editions; choose the installer according to your OS and chip architecture.
What is TRAE suitable for?
| Use Cases | Requirements you can raise |
|---|---|
| Learning programming | "Please explain this JavaScript and give a simple example." |
| Building small tools | "Help me build a to-do list web page that supports adding, completing and deleting tasks." |
| Maintaining existing projects | "First read the relevant files, then add keyword search to the current list." |
| Troubleshooting | "Here is the error message and the reproduction steps; please locate the cause and propose a fix." |
I. Download, Install and Log in to TRAE
Download TRAE and start AI programming
Go to the domestic official website and choose the version suitable for your computer
** Go to the official site to download **
| Operating system | Download options |
|---|---|
| Windows | Choose the Windows installer |
| macOS (Intel) | Choose the Intel version .dmg installer |
| macOS (Apple Silicon) | Choose the Apple Silicon version .dmg installer |
| Linux | Choose the .deb or .rpm installer according to your distribution and architecture |
This section takes the macOS version of TRAE CN as an example.
First visit the TRAE official website, and download the installer according to your operating system and chip type.
Mac users can check the chip type in the Apple menu's About This Mac: choose the Apple Silicon version for Apple chips, the Intel version for Intel processors; Windows users should select the Windows installer at the download entry on the official site.
1. Drag TRAE into "Applications"
After the download completes, double-click to open .dmg the installer file. In the window that appears, hold the left-side TRAE CN icon and drag it to the right-side Applications folder.
Applications is the Mac "Applications" directory. Wait for the copy to finish, then open TRAE CN from "Applications".
This step is the Mac installation method. Windows users can simply follow the installation wizard after opening the installer.
2. Click Log In and choose Individual User
After starting TRAE, if a theme, language or configuration import guide appears, complete the setup as needed. After entering the main interface, click the green "Login" button on the right; you can also use the login entry in the top-right corner of the window.
After the identity selection window pops up, for personal learning or daily development choose "Individual User". Only choose "Enterprise User" when using an account assigned by your organization.
3. Complete login with a phone number
In the login page that opens, complete the following in order:
- Enter your phone number.
- Click 'Get verification code', and fill in the SMS verification code you received.
- Read the Terms of Service and Privacy Policy, and check the box to confirm your agreement.
- Click "Login".
You can also choose the Douyin or Apple login entry shown in the figure and complete authorization on the corresponding page.
4. Confirm login and return to the client
After the "Log in to use TRAE" page appears, click the green "Log in and open TRAE" button button in the upper right of the page.
If the browser asks whether to open the TRAE app, confirm opening it. To switch to another account, click "Log in with another account" and complete the login process again.
After returning to the client, check whether the account avatar is shown in the top-right corner. If the browser does not switch back automatically, you can open TRAE manually to check the login status.
II. Send the First Message
5. Start a conversation in the input box on the right
After logging in, there is no need to create a complex project yet. Type a simple question at the bottom of the right panel and click the bottom-right up-arrow button Send:
你好,我是编程初学者。请介绍一下你能帮我完成哪些开发任务,并用简单的例子解释 HTML、CSS 和 JavaScript 的作用。
After receiving a reply, you can keep asking, for example "give another example of a web page button". The left side in the figure is the changelog, not a page you must fill in; the current operations are mainly done in the conversation area on the right.
Ask questions first, then work on the project:
You can first try general concept Q&A directly. If you need the AI to create or modify local files, first open a project folder following the later steps.
III. Select a Model and Add a Custom Model
6. Select a model from the Auto entry
Click the button at the bottom-right of the conversation input box, "Auto" or the current model name, to expand the model list. Click an available model to select it for subsequent conversations.
For first-time use you can keep the default Auto, then compare different models once you are familiar with the conversation flow. The model list and numbers in the screenshot reflect the interface at the time of the screenshot and are not a fixed list of available models or a pricing commitment.
Beginners only need to distinguish two concepts first:
| Type | How to Use |
|---|---|
| Built-in models | Choose from the models available to the current account; there is no need to fill in a separate API Key for each model. |
| Custom models | Connect your own model service and fill in the API Key and other information as required by the provider. |
7. Add your own model as needed
If you already have an API Key from a model provider, you can click the bottom of the model list "Add Model", or go through Settings to enter the "Model" page. On the model management page click "+ Add Model".
**An API Key is the access credential for calling model services, not the TRAE login password.** Users without an API Key can skip this step and continue using the available built-in models.
When adding, choose the configuration method according to the service you use:
- **Preset provider:** select the provider and model, and fill in the API key provided by that provider.
- **Custom model:** fill in the API format, request URL, model ID and authentication information according to the provider's documentation.
For the first configuration you can keep the default values of the advanced parameters. After adding, return to the conversation area, select that model, and send a simple question to check the connection. If configuration fails, check the key, model ID and request URL against the error message.
Usage and fees for custom models are subject to the corresponding provider's documentation. Only fill the API Key into the model configuration; do not put it into tutorial screenshots, chat prompts or public code.
For configuration steps, refer to:TRAE built-in models and custom models documentation. Figure 7 shows the model management entry; the subsequent forms are subject to the actual client.
IV. Open Your First Project
1. Create a local practice directory
Create an empty folder on your computer and name it trae-todo. In TRAE, click "Open Folder" and select this directory.
Putting a project in its own folder makes it easy to confirm which files the AI created and modified. All subsequent operations in this tutorial take place in that directory.
2. Existing repositories can also be cloned and imported
If the project is already hosted on GitHub, you can choose "Clone Git Repository", then "Clone from GitHub", and follow the prompts to authorize and select the repository.
If you already know the repository address, you can paste the URL directly and then choose a local save location.
For this exercise, the empty folder just created is enough; there is no need to prepare a GitHub repository.
V. Switch IDE / SOLO Mode and Use the Agent
TRAE has multiple work entries, which can be confusing on first use. First remember:The top-left switches IDE / SOLO mode, and the top-right Agent button opens the Agent window.
| Entry point | Suitable for | Beginner's understanding |
|---|---|---|
| IDE mode | View files, manually edit code, and work with AI to complete features | Discuss with AI while reading the code |
| SOLO mode | Describe requirements around a task, and view the AI's execution process and output | Hand a clear task to the AI to drive forward |
| Agent window | Centrally initiate and manage agent tasks | A task-centric independent workspace |
The Agent also has another entry:
The bottom of the dialog box
@ Agent
is for selecting the agent that executes the task; the top-right
Agent ↗
is for opening the window. They are not the same button.
1. Switch from IDE to SOLO
In IDE mode, the left and center are mainly for viewing and editing project files, and the right is the AI conversation area. When you want to learn code while modifying a web page, you can use this mode first.
Move the mouse to the top-left IDE icon; a "Switch to SOLO mode" tooltip will appear. Click that entry to switch.
It is recommended to open the project folder you intend to work on before switching. That way, when you describe "modify the current project", the AI has a clear working directory.
2. Start a task in SOLO mode
After entering, the top-left shows a green SOLO icon. The left side shows the task list, and the right side is for entering requirements, reading the execution process and viewing replies.
- Confirm the target project at "Select Project" at the top.
- Click on the left "New Task"to start an independent task.
- Enter the specific requirement at the bottom and click the Send button.
- Observe the execution process; when an operation requiring confirmation appears, read the content before handling it.
- After completion, view the file changes and actually run to check the result.
For example, once you have a to-do list web page, you can send:
请为当前待办事项网页增加“全部、未完成、已完成”三个筛选按钮。
先阅读现有代码,再实现功能。
保留添加、删除和本地保存功能,兼容已有数据。
完成后列出修改的文件,并说明如何检查筛选结果。
If you want to return to the file editing interface, use the mode-switching entry in the top-left to go back to IDE. After the task list shows "Completed", you still need to check whether the actual result meets the requirements.
3. Open the Agent window
Click the top-right of the window "Agent ↗"to enter the Agent work window. This entry is separate from the IDE / SOLO mode switch in the top-left.
If you are currently only modifying one function or viewing a few lines of code, you can stay in the IDE; try the Agent window when you need to centrally track progress around a task.
4. Create a task in the Agent window
After entering, you can see the large input box in the center, as well as "New Task", the project and the task list on the left. The top-right "IDE ↗" is used to return to the IDE window.
For the first experience, it is recommended to keep using the local project:
- Click on the left "New Task".
- Confirm that the run location below the input box is "Local".
- If the task needs to read or write files, click "Select Folder"and select the practice project directory.
- Enter the requirement, keep the currently available default model settings, and click the up arrow to send.
- View progress in the task list on the left. If it shows "Pending Confirmation", open the task to view the content that needs confirmation.
You can first get familiar with the flow using a task that only analyzes and does not modify files:
请阅读当前项目,用适合初学者的语言说明:
1. 项目是做什么的。
2. 主要文件分别负责什么。
3. 如何在本地运行。
这次只分析,不修改文件,不安装依赖。
Tips for beginners:
Complete one task first before trying to handle multiple tasks at once. The "Manual Approval" prompt in the screenshot reminds you to pay attention to execution confirmations; decide whether to continue only after clearly seeing the command or the scope of changes.
Reference:TRAE Quick Start, SOLO Mode Overview. The figures in this section use actual interface screenshots provided by RUNOOB.
VI. Hands-on: Build a to-do list web page with AI
The following is an exercise designed for this tutorial, not an official demo project. We use the most basic HTML, CSS and JavaScript to reduce environment setup and focus on how to collaborate with AI.
1. First let the AI explain the implementation approach
Confirm that what is open is the trae-todo folder, and send in the conversation area:
我要制作一个待办事项网页,支持添加、完成和删除任务,刷新后保留数据。
请用初学者能理解的方式解释 HTML、CSS、JavaScript 各自负责什么,以及 localStorage 如何保存数据。
这一步先说明思路,不修改文件。
Understanding the approach first helps you judge whether the subsequently generated files and code meet expectations.
2. Send the full requirements and create files
In the conversation, select the built-in agent that can execute code tasks. The official documentation supports selecting it by entering @ or by clicking the current agent name. Send the following prompt:
请在当前文件夹中制作一个中文待办事项网页。
Technical Requirements:
- 使用 HTML、CSS 和原生 JavaScript。
- 创建 index.html、style.css 和 script.js。
- 不使用框架、构建工具、外部 CDN 或后端服务。
- 允许直接用浏览器打开 index.html。
Functional requirements:
1. 输入内容后点击按钮或按回车添加任务。
2. 不允许添加空白任务。
3. 支持完成、取消完成和删除任务。
4. 显示未完成任务的数量。
5. 使用 localStorage 保存任务及完成状态。
6. 页面重新打开后恢复数据;存储失败时给出提示。
7. 用户输入必须作为普通文本显示。
界面要求:白色背景、绿色按钮、卡片布局,适配手机。
请直接创建文件。完成后说明文件用途、打开方式,以及哪些功能已经验证、哪些需要我手动验证。
Reference:Create and manage custom agents: Select Agent
During execution, pay attention to file changes and operation prompts. After completion, you should be able to find the following files in the project directory:
| file | Purpose |
|---|---|
| index.html | The structure of the input box, buttons and task list |
| style.css | Colors, spacing and mobile layout |
| script.js | Logic for adding, completing, deleting and local saving |
3. Open the web page and verify
After saving the files, open it in a browser index.html. Check in the following order; do not just look at the AI's completion description.
- Add "Learn TRAE" and confirm the task appears in the list.
- Enter only spaces and confirm that no blank task is created.
- Mark a task as complete, then uncomplete it, and observe whether the count stays in sync.
- Refresh the page and confirm the tasks and completion status are preserved.
- Delete a task and refresh, confirming it does not reappear.
- Narrow the browser window and confirm it is still usable at phone width.
When opening a local HTML file directly, browsers may handle local storage differently. If saving fails and Python 3 is installed on the computer, you can run in the project directory
python3 -m http.server 8000
(on Windows you can use
py -m http.server 8000
), then visit
http://localhost:8000
. Keep the same access address during verification.
4. Fix problems with specific feedback
Suppose the completion status is lost after a refresh; you can give feedback like this:
问题:任务的完成状态没有保存。
复现步骤:添加两条任务,将第一条标记为完成,然后刷新页面。
实际结果:第一条任务恢复为未完成。
预期结果:刷新后仍保持已完成状态。
请检查保存和恢复逻辑,修复后说明原因,并列出验证步骤。
Giving "steps to reproduce, actual result, expected result" together reduces repeated guessing. After one problem is confirmed fixed, then continue adding features like search, categorization or export.
5. Review the changes
In SOLO mode, you can check this round of changes through the "View Changes" or "Code Changes" entry in the conversation. Focus on confirming whether the modified files are reasonable and whether original features still work.
It is recommended to save a version with Git after each runnable stage. This makes it easier to locate and roll back when later changes do not meet expectations.
VII. Use CUE to Assist in Writing Code
CUE provides completion and modification suggestions based on the code context. Find CUE in the Settings center to manage toggles such as Tab-Cue.
can be done during script.js Enter a comment in it and observe the completion suggestions:
// 统计尚未完成的任务数量
| Operation | Keyboard shortcut |
|---|---|
| Accept the current suggestion, or jump to the modification point as prompted | Tab |
| Reject the suggestion | Esc |
| Preview the code after acceptance | macOS:Option;Windows:Alt |
Before accepting, check that variable names and conditions fit the current project. Completion content depends on the context and may not exactly match the description in this tutorial.
Reference:Super Code Completion: CUE
VIII. Write Common Requirements as Project Rules
If you have to repeat requirements like "Explain in Chinese" or "Do not introduce frameworks" every time, you can save them as project rules. Global rules apply to multiple personal projects, while project rules apply only to the current project.
In the IDE window, go to Settings → Rules and Memory, create a project rule and choose a suitable way for it to take effect. The official documentation uses .trae/rules/ to save the project rules file.
Below is the rule body that can be used for this exercise. After creating a rule through the interface, keep the configuration part generated by the tool, then fill in these requirements:
请使用中文解释修改内容。
本项目使用原生 HTML、CSS 和 JavaScript,不引入框架或外部 CDN。
修改前先阅读相关文件,沿用现有命名和结构。
用户输入按普通文本渲染,不拼接为 HTML。
新增功能需要兼容已保存的数据。
完成后说明修改了哪些文件、如何验证,以及尚未验证的部分。
Reference:Rule
IX. Frequently Asked Questions
Why does the AI only explain and not create files?
First confirm that a project directory is open, then check whether an agent that can edit files is selected. Write the requirement as "Please create a file in the current project", and check whether there are pending permission prompts.
What if the generated web page does not open?
Confirm the file is saved and that the filename matches the CSS and JavaScript reference paths. Open the browser's developer tools to view the error and send the full error message and reproduction steps to the AI. Do not just say "it does not work".
Why does my interface differ from the figures?
Versions, modes and account-available features may differ. First distinguish whether you are currently in the IDE window or the Agent window, then compare the button labels. The figures are for locating features; actual operations are subject to the client.
Is a paid plan required?
This article does not assume any feature is permanently free. Before starting, check the available models, quota and feature notices of your current account; this exercise prioritizes capabilities the account already has.