Running Commands Yourself (!)
Sometimes you already know the command: git log -5, npm test, ls build/. Asking the assistant to run it costs a reply and an approval click. Type it after a ! instead and it runs straight away in the conversation's workspace — no model call, no approval dialog.
!npm test
By default the assistant sees the command and its output at your next message, so you can follow up with "fix the failures above".
Running a command
- Type
!as the first character in the message box. The box switches to shell mode: a$chip, a monospace font, and a Run button instead of Send. - Type the command and press Enter (or Run).
- A run card appears in the conversation, with the output as it arrives.
Delete the ! to go back to a normal message. To send a message that really starts with !, type \! — the backslash is removed and the message goes to the assistant.
In shell mode, the Up and Down arrows recall the commands you ran earlier in this conversation. @-mentions, attachments and slash commands are off while you type a command.
In the terminal interface (TUI) it works the same way: start the line with !.
The run card
While the command runs, the card shows the latest output and the elapsed time, with two buttons:
- Stop ends the command.
- Move to background lets it keep running while you carry on with the conversation. It becomes an ordinary background process: the assistant can read its output later.
When it finishes, the card shows the exit code, how long it took, and the output (long output is folded; Show all pages through the full log). Colours in the output are shown as the terminal would show them. Copy copies the command with its output as plain text, and Rerun puts it back in the message box — it never runs anything by itself.
The card also says where the command ran — not sandboxed, sandboxed (the light sandbox) or isolated workspace — and whether it had the network (network or no network), the same facts an approval dialog shows for the assistant's commands. If a sandbox should have contained it but could not start, the card says not sandboxed (sandbox unavailable). How it ended is said plainly: stopped when you stopped it, timed out after … when it ran too long, and stopped: output limit when it printed more than the server keeps.
A command that starts with cd gets a reminder on its card that the directory carries over to your next ! command, but not to the assistant's commands.
In the TUI, Esc or Ctrl-C stops the command in the foreground, Ctrl-B moves it to the background, and Ctrl-T flips Agent sees this on the newest run. On a focused card, Enter shows all the output (or folds it again) and s flips Agent sees this; once the command has finished, r puts it back in the message box, c copies the command with its output, and n (shown when it applies) runs it again with the network.
What the assistant sees
Each run's card has an Agent sees this toggle. A new command comes up the way the last one's toggle stood — turn it off once and your following ! commands start private too (a conversation's first command starts on). At your next message, every run with the toggle on is added to the conversation ahead of your message: the command, its exit code, how long it took, and its output (shortened the way the assistant's own command output is). Turn the toggle off before sending your next message to keep a run to yourself; you still see the card.
Once you send a message, the toggles of earlier runs lock: the card then says Shared with the agent or Not shared.
Running a command never makes the assistant answer on its own. Nothing is sent to the model until you write a message.
Where it runs
A ! command runs exactly where the assistant's own commands would run in this conversation: the same workspace, the same sandbox, the same network rules. If the conversation has its own isolated workspace, your command runs in it — and on a brand-new conversation, your first command prepares that workspace, so it can take a few seconds (the message box says so while it waits). You can run a command straight from the start screen of a new conversation.
- Your first command starts at the top of the workspace, and each later one starts in the directory the previous one ended in, so
!cd srcfollowed by!lslistssrc. Only the directory carries over: variables youexportand other shell settings do not. The assistant's own commands still start at the top of the workspace. If the directory has disappeared meanwhile (you deleted it, or switched branches), the command runs at the top of the workspace and says so. - There is no terminal and no keyboard input. Programs that need one are refused before they start, with a suggestion:
vim,nanoandless(usecat),git log | less(drop the| less— the output shows in full anyway),top(usetop -b -n 1),man(use<command> --help), andpython3,node,psqlorssh hostwith nothing to run. - Pagers are switched off and git never asks for a password, so commands do not hang waiting for you.
- A command that runs longer than the server's limit (15 minutes by default) is moved to the background or stopped, depending on the server's configuration.
Files a command writes
A file your command writes — npm run build producing a report, sed -i changing a file, a script rendering a PDF — gets a Download card under the run card, on your side of the conversation, just like a file the assistant writes gets one on its side. In an isolated workspace every file the command wrote counts; otherwise only the files the command names as its output (> report.txt, -o out.pdf). Caches and dependency folders never get a card, and a command that writes more than 10 files gets none. The TUI shows no Download cards, for your commands or the assistant's.
Network access
With the light sandbox, commands run without network access unless the assistant (or you) asks for it. If a command failed because it needed the network — npm install, git fetch, curl — the card offers Rerun with network, which runs the same command once more with network access. Unlike Rerun, it runs straight away: a new run card appears with the result. It is offered only where it makes a difference: with no sandbox the network is already there, and an isolated workspace decides its network for the whole conversation.
The server's permission rules still apply: a command they block, with or without network, is refused and the card names the rule.
When it is not available
The message box tells you why when ! cannot run, and Run stays disabled:
- While the assistant is working (or waiting for your approval). Wait for it to finish, or stop it.
- While another command runs in the foreground. Stop it or move it to the background first. You cannot send a message meanwhile, either.
- Your account cannot run commands — your access profile does not include the shell, or the conversation is one a reviewer checks.
- It is turned off on the server (
tools.user_shell: off), or background processes are disabled on the server.
A command the server's permission rules block (for example a rule that blocks rm) is refused with the rule's name. Anything else you could have approved for the assistant, you can run yourself.