The AI Command Loop
AITerm's core AI flow is propose → approve → run. The AI never silently runs a command it generated. It writes an editable command into the input bar and waits for you. Nothing reaches the shell until you approve the exact text in the bar.
This is the single most important thing to understand about the default AI command loop: the AI drafts for your command line; you still approve the exact command before it runs. The optional agent modes are a separate, explicit opt-in — see The Autonomous Agent.
Step by step
- You type a plain-English request in the input bar.
- AITerm asks your selected provider for a shell command.
- The proposed command appears in the input bar, selected and editable.
- AITerm evaluates it and shows a risk badge when it's useful.
- You edit it if you want to.
- Press Return to approve exactly what's in the bar. Press Escape to discard it.
- AITerm re-checks that exact command through the security gate, then runs it.
"Approve" always means "run the exact command currently shown in the bar." If you edit the proposal, the edited version is what gets evaluated and run — the AI's original suggestion has no special standing.
Suggestions as you type
As you type in the input bar, AITerm shows a dimmed completion ahead of the cursor when something in your own history matches what you've started. Press the right arrow to accept it, or Escape to dismiss it — the first Escape clears only the suggestion, never the line you're writing.
Suggestions come from both things the bar accepts. Start typing a command you've run before and it completes the command. Start typing a request you've asked before and it completes the request, marked so you can see that Return will consult the AI rather than run something. AITerm prefers what you ran in the folder you're in now, then what you ran most recently, and it won't offer back a command that failed.
Accepting a suggestion only fills in the text. Nothing runs, and nothing is sent anywhere, until you press Return — at which point a command goes through the security gate exactly as if you had typed it, and a request is translated fresh rather than reusing whatever it produced last time.
Matching happens entirely on your Mac against your own history; no part of this involves a model or the network. Turn it off in Settings ▸ Terminal ▸ Input.
A worked example
Type:
show the 10 biggest files under this folder
AITerm might propose:
du -ah . | sort -rh | head -n 10
with a Safe badge. Read it, tweak the 10 if you like, and press Return. If instead you'd asked to "delete all the .log files," the proposal would carry a Destructive badge, and depending on your Safety Profile you'd get a confirmation before it could run.
Risk badges
Every proposal is tiered so you can judge it at a glance:
- Safe — ordinary read-only or low-risk commands.
- Caution — commands that modify files or state but aren't broad destructive operations.
- Destructive — commands that can delete, reset, overwrite, or run unseen code. These show a stronger warning and may require confirmation depending on your profile.
- Irreversible — the most severe tier: machine-wide and cannot be undone. Stricter profiles block these outright.
Click the badge to open the risk popover. It explains the reason in plain language, can offer a safer alternative when one exists, and for eligible destructive commands can offer a dry-run preview, a rollback hint, or a back up, then run action. See Safety and Security.
One execution chokepoint
There is exactly one path to the shell: a command must pass the security gate before it runs. This is true whether the command came from the AI, from a slash command, from a runbook, or from an agent step.
- If the gate returns a confirmation, nothing runs until you choose to run anyway or pick a safer/backup action.
- If the gate blocks a command, it is never sent to the shell.
Typing directly instead
You don't have to use the AI at all. Click inside the terminal pane and type on the shell line like any terminal — in that mode the status shows the AI gate is off, and you're driving the raw shell. See Terminal Basics for how direct typing and the AI bar hand off to each other.
Related pages: Terminal Basics, Safety and Security, Slash Commands Reference, Privacy and Data Handling.