Invoke an Agent from a Terminal
- Desktop, mobile and web
- All plans
What it does
Every dev command or shell pane has an Invoke an agent button in its bottom-right corner, always visible, whatever the output says. It opens the same picker as the lightning (quick agent) button: an agent tier (Fast, Powerful, Expensive) or a provider, then a model and an effort. The picked quick agent starts right away with "Fix the problem shown in this terminal output" plus the last lines of the terminal as its first message. Optionally, the command runs again on its own once the agent ends its turn, so you see at once whether the fix worked.
Where to find it
The Invoke an agent pill at the bottom right of any dev command or shell pane (Commands, ad-hoc Terminal tabs, detached command windows). When a smart hint is shown, it sits just above the pill.
On the phone: the lightning button in the header of a terminal screen, next to Stop (dev commands, shells, and SSH terminals that go through the computer).
How to use it
- Click Invoke an agent.
- Pick a tier (one click launches it) or a provider, then a model (the effort and context rows sit under the model list).
- The agent's terminal opens in place of the command pane and starts working on the error.
- To run the command again after the fix, switch Run the command again once fixed on in the same menu before picking the agent. The row shows the exact line that will run; it only appears when the pane has a command to run (a saved dev command, or the last line typed in a shell).
Settings
terminalInvokeRerun(global, the Run the command again once fixed row of the Invoke an agent menu): run the terminal command again when the invoked agent ends its turn. Default off. Remembered for the next time and synced with your account.- The tiers themselves are configured with a right-click on a tier row (see Multi-Provider Support).
Agent tools (MCP)
settings_get / settings_set read or change terminalInvokeRerun.
Providers
All providers. The tiers and the provider list are the same as the lightning button's.
Mobile
Yes. Every terminal screen of the iOS and Android app has the same button, as a lightning icon in its header next to Stop. It opens a sheet with the same choices as the desktop menu: the agent tiers (one tap launches), then provider, model, effort and account, then Run the command again once fixed with the exact line it will run. The agent is created and runs on the computer, with the terminal's last lines as its first message, and the phone opens its console right away. The re-run switch is the same setting as on the desktop: flipping it on the phone changes it everywhere.
Not shown: on an SSH session the phone opened directly (without the computer), and when the computer is offline. An older desktop app answers with a message asking to update it.
Limits
- The agent receives roughly the last 40 lines of the terminal (about 2,500 characters).
- The re-run waits for the end of the agent's turn: a turn that ends on a question does not trigger it, and closing the agent or the command pane cancels it. It fires once, at most a few hours after the launch.
- The re-run restarts the pane the same way as its reload button: a long-running process is stopped and started again.
- SSH tabs: the agent can be invoked, the re-run is not offered.
Common questions
- Can I choose a cheap or a strong model for the fix? Yes, pick the Fast, Powerful or Expensive tier, or a precise provider, model and effort.
- Will the command run again by itself? Only with Run the command again once fixed on, after the agent ends its turn.
- What is the difference with smart hints? Smart hints only appear on known errors and pick a specialist; this button is always there and lets you pick the agent.
- Can I fix a crashed dev server from my phone? Yes: open its terminal in the mobile app and tap the lightning button in the header. The agent runs on the computer; the command can run again by itself once it is fixed.
Related
- Smart Hints: the automatic chip shown on known errors.
- Dev Terminals: the panes where the button lives.