Codumentor logo Codumentor Enterprise

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

  1. 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.
  2. Type the command and press Enter (or Run).
  3. 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:

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.

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:

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.