ML AI Code for VS Code
ML AI Code is a coding agent that runs on your machine. It reads your project, plans and makes changes, runs commands in a terminal you can see, checks its own work, and shows every edit as a diff you can keep or undo.
The extension bundles the ML AI Code engine (mlai serve). If you have a newer mlai CLI installed, the extension uses that one instead.
Getting started
- Install the extension and open a folder.
- Open ML AI Code from the activity bar, or press
Ctrl+Escape (Cmd+Escape on macOS).
- Choose Sign in. A browser page opens with a short code; confirm it there. The default server is
https://code.ml.ai.
- Describe what you want and press Enter.
Chat
- Modes: Guided makes changes and asks before risky steps, Plan writes a plan for you to review first, Ask answers without touching files, and Auto picks for you.
- The model picker lists ML AI Code models. Models that run on your machine are labelled "Offline model".
- Type while the agent works to steer it, or press Stop.
- History: search, rename, fork, and resume earlier chats. Open as many chats as you like in editor tabs.
- Context: the current file and selection are attached automatically (remove the chip if you don't want them). Type
@ for files (with line ranges), folders, symbols, problems, the git diff, terminal output, or a URL. Paste or drop images.
Reviewing changes
- Edits stream into your editor as inline diffs. Keep or Undo each change, or a whole file, from the CodeLens above it.
- Review All Changes opens the native diff editor. The changed-files bar under the chat lists everything this turn touched.
- Turn on auto-accept if you'd rather keep edits as they land.
- Every turn starts from a checkpoint. Restore files, the chat, or both.
- Commands and risky actions ask for approval in the chat first. Commands run in a terminal called "ML AI Code" so you can watch them.
- Plans open as a Markdown document. Comment on any line, then choose Approve or Revise. Long plans are split into phases in
PLAN.md.
In the editor
Ctrl+I / Cmd+I: edit the selection from an instruction, then press Tab to accept or Esc to reject.
- Tab completions and next-edit suggestions (setting
mlai.completions.enabled).
- Fix with ML AI Code on problems, a failing test in the Test Explorer, or a crash while debugging.
- Explain code or write tests from the context menu.
- Generate a commit message from the Source Control view.
The IDE bridge
During a chat the extension runs a small local server on 127.0.0.1 with a random port and a token that only that chat knows. The agent uses it to read open editors, the selection, problems, symbols, references and definitions, run tests and read their results, look at the debugger and terminal, and open files. Turn it off with mlai.ideBridge.
Cloud
- Run on Cloud Computer hands the current chat to a cloud computer and shows its progress in the status bar.
- The Agents Board runs several agents in parallel, each in its own git worktree.
- Review Working Tree reviews your uncommitted changes and leaves comments in the editor.
- The Cloud view keeps the cloud workspace you used in earlier versions.
Remote development
The extension runs where your code is (SSH, containers, WSL, and Codespaces), so the engine works on the remote files directly.
Settings
| Setting |
What it does |
mlai.server |
Server to sign in to. Default https://code.ml.ai. |
mlai.cliPath |
Path to an installed mlai CLI. |
mlai.enginePath |
Run a specific engine build. |
mlai.defaultMode |
Mode for new chats. |
mlai.autoAccept |
Keep edits as soon as they land. |
mlai.autoAttachContext |
Attach the current file and selection. |
mlai.diagnosticsFeedback |
Tell the agent about new problems in files it edited. |
mlai.ideBridge |
Give the agent the IDE tools above. |
mlai.planAsDocument |
Open plans as a Markdown document. |
mlai.completions.enabled |
Tab completions. |
Troubleshooting
Click the ML AI Code item in the status bar to see the engine status, restart it, or open its log. Prepare Diagnostic Report collects details that are safe to share.
| |