Skip to content

Inline Chat

Trae offers the inline chat box embedded within the code editor. You can invoke inline chat at any time during coding. Using inline chat enables you to maintain a better coding flow while chatting with the AI assistant.

Invoke Inline Chat

You can invoke inline chat in two ways:

  1. Place the cursor in the editor and use the shortcut (macOS: Command + I; Windows: Ctrl + I).
  2. Select any code in the editor and either use the shortcut (macOS: Command + I; Windows: Ctrl + I) or click the Edit button in the floating menu.

Express Your Needs

In the inline chat box, enter your request, such as adding comments to the selected code, explaining the selected code, optimizing the selected code, and more. Then, click the Send button on the right or press the Enter key on your keyboard.

Handle the Responses

After sending your request, the content generated by the AI assistant will be displayed in the editor in a diff format. You can review the code changes and choose to accept or reject them.

  • If you want to accept or reject all changes, click the Accept button (shortcut: Command + Enter for macOS; Ctrl + Enter for Windows) or the Reject button (shortcut: Command + Backspace for macOS; Ctrl + Backspace for Windows) at the bottom left of the dialog.
  • To accept or reject specific changes, click the ^Y button (shortcut: Control + Y for macOS; Alt + Y for Windows) or ^N button (shortcut: Control + N for macOS; Alt + N for Windows) at the top right of the content snippet.

Retry a Round of Chat

If the content generated by the AI assistant is not what you want, you can click the Retry button at the bottom left of the chat box to initiate another round of chat for the same question, allowing the AI assistant to answer again.

Your Ultimate AI-Powered IDE Learning Guide