Skip to content

Builder

Builder helps 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 Builder 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

Prerequisites

  • VS Code version is 1.93 or later.
  • (Windows only) PowerShell 6 or a later version is set up for the IDE. If this condition is not met, use the following steps to set up PowerShell:
    1. Install PowerShell 6 or a later version. For more information on installation, refer to this page.
    2. Return to Trae and open the Terminal.
    3. In the upper-right area of the Terminal, click + > Select Default Profile.
    4. The list of selectable default terminal files appears at the top of IDE.
    5. Select the file that contains the text \PowerShell{version_number}\xxx (usually detected automatically).

Note: The {version_number} should be greater than or equal to 6. Do not select the built-in older version of PowerShell, such as the Windows PowerShell.

Open Builder

  1. Open the side chat box using shortcut (macOS: Command + U; Windows: Ctrl+U).
  2. At the top left of the AI chat box, click Builder to enable the Builder mode.

Explore Builder

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 and files, allowing it to assist you more accurately with your development needs. You can reference code and files from the project using the #Context method and send them along with your questions to the AI assistant.

Generate and handle code changes

Based on your needs, the AI assistant will automatically generate code changes, including creating new files and editing the code in existing files.

Note: 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 for a file: Open the list of to-be-reviewed files and click a file to open it in the editor to review the code changes. Then, hover the cursor onto that file, and click the Accept or Reject button to accept or reject code changes for that file.

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

Once the AI assistant has completed your needs, it will provide a Preview button. Clicking this button will open a Preview window to showcase the outcome.

Revert to previous versions

You can revert the project to a version before a certain round of chat.

Note:

  • 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.
  1. Find the target chat bubble.
  2. At the left, click the Revert button.
  3. A dialog box showing the file(s) that this reversion impacts appears.
  4. Click the name of a file in the list.
  5. The file is opened in the editor and the changes going to happen show.
  6. Confirm the impact this reversion brings.
  7. If the impact is as expected, click the Confirm button.
  8. The AI assistant starts to revert this project.

Manage historical chats

Click the History button at the top right of the Builder window, and the History panel will appear, 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 chat entry and click the delete button that appears.

Your Ultimate AI-Powered IDE Learning Guide