What is Trae Builder?
The Trae Builder mode can help you develop a complete project from scratch. You can seamlessly integrate it into your project development process.
In the Builder mode, the AI assistant utilizes various tools based on your needs when responding. These tools include those for analyzing code files, editing code files, running commands, and more, making the responses more precise and effective.
How does the Builder mode work?
In the Builder mode, the AI assistant actively reads the contents of the current project files, breaking down tasks, and executing them step by step. This includes:
- Extracting relevant context
- Creating or modifying files
- Generating and running commands
- Analyzing the status of command execution
Enable the Builder mode
- Open the side chat box using shortcut command + U
- At the top left of the AI chat box, click Builder to enable the Builder mode
Explore the Builder mode
The Builder mode offers a range of practical features that effectively assist you in developing a project from 0 to 1 with precision and efficiency.
Add contexts
The AI assistant can understand the context of the current project, including code, files, and folders, allowing it to assist you more accurately in fulfilling your development needs. For more information, refer to "Context".
Input multimodal content
You can add images in the chat, such as error screenshots, design drafts, reference styles, and more, to express your needs more accurately and efficiently. For more information, refer to "Multimodal input".
Generate and handle code change
Based on your needs, the AI assistant will automatically generate code changes, including creating new files and editing the code in existing files.
To let you preview code changes, Trae automatically saves the code changes generated by the AI assistant. If you reject the code changes, they will be deleted from the disk.
You can accept or reject code changes, including:
Handle all code changes in multiple files: Click the Accept All or Reject All buttons in the file list above the input box to bulk accept or reject all code changes in the current project.
Handle all code changes in a file: In the editor, open the file and click the Accept (shortcut: Command + Enter) or Reject (shortcut: Command + Backspace) button in the top prompt bar to bulk accept or reject all code changes within the current file.
Handle a single code change: Click the ^Y or ^N button in the upper right corner of a specific code change in the editor to accept or reject that particular change.
Generate and run commands
Based on your needs, the AI assistant will timely recommend necessary Shell commands for you to run. You can choose to run or skip a command, and the AI assistant will proceed with the subsequent tasks based on your actions.
After clicking Run, the command will be executed in the terminal of Trae. Once the command has run, the AI assistant will automatically read and analyze the result. If there are any issues during execution, the AI assistant will analyze the causes and provide suggested solutions.
If the command runs successfully, you can click the Terminal button at the top right of the command card to view the execution logs of that command in the terminal.
Preview the outcome
Once the AI assistant has completed your needs, it will provide a Preview button. Clicking this button will open a Webview window in Trae to showcase the outcome.
During the preview, if you continue to interact with the AI assistant and modify your needs, the outcome will update in real time within the Webview window.
At the top right of the Webview window, you can click the Open in Browser button to open the window in your browser and preview the outcome.
Revert to previous versions
You can revert the project to a version before a certain round of chat.
- Reversions cannot be undone
- Only supports reverting a project in the latest Builder window
- Only supports reverting a project to a version within the latest 10 rounds of chat
To revert:
- Find the target chat bubble
- At the left, click the Revert button
- A dialog box showing the impacted files appears
- Click a file name to preview changes in the editor
- Confirm the impact and click Confirm if acceptable
- The AI assistant will begin the reversion
Manage historical chats
Click the Show History button in the top right of the Builder window, and the History panel will appear on the left side, displaying all historical chats from both the Chat mode and the Builder mode.
To view a specific historical chat, click on the corresponding entry to jump to that part.
If you need to delete a historical chat, hover over the desired entry and click the Delete button on the right side. Note that deleted chats cannot be restored.