Skip to content

How to Use Inline Chat in Trae

Inline chat works as an embedded AI partner within your code editor. You can invoke it at any time during coding to maintain better flow while getting AI assistance.

Invoke Inline Chat

There are two ways to invoke inline chat:

  1. Place your cursor in the editor and press Command + I
  2. Select code in the editor and either:
    • Press Command + I, or
    • Click the Edit button in the floating menu

Express Your Needs

In the inline chat box, you can enter various requests like:

  • Adding comments to selected code
  • Explaining selected code
  • Optimizing selected code And more. Click Send or press Enter to submit your request.

Handle Responses

The AI assistant's generated content will appear in the editor in diff format. You can review and manage code changes:

Accept or Reject All Changes

  • Click Accept (Command + Enter) at the bottom left to accept all changes
  • Click Reject (Command + Backspace) at the bottom left to reject all changes

Handle Individual Changes

  • Click ^Y (Control + Y) to accept a specific change
  • Click ^N (Control + N) to reject a specific change

Retry Responses

If you're not satisfied with the AI's response, click the Retry button at the bottom left of the chat box. This will prompt the AI assistant to generate a new response to your original request.