The interactive TUI
The TUI is the primary way to use Magic Coder today. It’s a terminal app: transcript on top, an input box at the bottom, a status line in between. This page covers what’s actually in front of you when you run it — including the parts that aren’t obvious until you’ve used it for a while.
Layout
Section titled “Layout”When you launch coder, you see four regions:
- Transcript — the conversation. User messages, assistant text, reasoning (“Thinking…”) steps, tool calls, command output, diffs.
- Top-right header — the workdir (compacted, e.g.
~/P/g/M/magic-coder-tui) and the git branch. - Status line (above the input) — current mode, token usage, connection state, email, version. See Status line cues below.
- Input box — multi-line editor. Where you type messages and slash commands.
Overlays appear above the input for: slash-command autocomplete, approval prompts, the help modal, the follow-up queue, and the ask-questions form (when an agent asks structured questions).
Typing
Section titled “Typing”The input is a multi-line editor. Standard text-editing keys plus a number of readline-style shortcuts.
Cursor movement
Section titled “Cursor movement”| Key | What it does |
|---|---|
Left / Right | Move cursor by character |
Alt+Left / Alt+Right (or Ctrl+Left / Ctrl+Right) | Move by word |
Up / Down | Move cursor by line within the input — but see “input history” and “follow-up queue” below for special cases |
Home / Ctrl+A | Beginning of line |
End / Ctrl+E | End of line |
PageUp / PageDown | Scroll the transcript by a page |
Editing
Section titled “Editing”| Key | What it does |
|---|---|
Backspace | Delete previous character |
Delete | Delete next character |
Alt+Backspace / Ctrl+Backspace / Ctrl+W | Delete previous word |
Alt+Delete / Ctrl+Delete | Delete next word |
Ctrl+U | Kill from cursor to line start |
Ctrl+K | Kill from cursor to line end |
Sending vs. inserting newlines
Section titled “Sending vs. inserting newlines”| Key | What it does |
|---|---|
Enter | Send the message (or accept the highlighted slash suggestion) |
Shift+Enter | Insert a newline |
Alt+Enter | Insert a newline |
Ctrl+J | Insert a newline |
\ + Enter | Insert a newline (the \ is consumed) |
The \ + Enter form is the recommended one inside tmux, which often eats Shift+Enter before it reaches the TUI. The /help modal automatically displays the right shortcut for your environment (Shift/Alt+Enter / Ctrl+J outside tmux, \ + Enter / Alt+Enter / Ctrl+J inside tmux).
Pasting
Section titled “Pasting”You can paste large blocks. Magic Coder smooths over paste bursts so the UI doesn’t stall on long pastes.
Slash commands
Section titled “Slash commands”Type / to open the suggestion menu. Magic Coder fuzzy-matches as you type. Tab or Enter accepts the highlighted suggestion. See Slash commands for the full list.
When the slash menu is open:
Up/Down— navigate suggestionsTab— accept the highlighted oneEsc— close the menu
A small inline preview shows the rest of the matching command in dim text (e.g., typing /lo previews gin or gout). Skill commands appear alongside the built-ins.
Input history
Section titled “Input history”Each workspace has its own history of inputs you’ve typed (stored at ~/.magic/known/<workspace-key>/history.jsonl).
Upwhen the input box is empty → recall previous inputsDownto move forward in history- Pressing any non-history key while browsing exits history mode but keeps the recalled text — you can then edit and send
Follow-up queue (don’t miss this)
Section titled “Follow-up queue (don’t miss this)”While the agent is generating, Enter doesn’t wait — instead it queues your message as a “follow-up” that the agent will see when its current turn finishes. You can keep queuing. Up to four queued follow-ups are visible above the input.
Inside the follow-up panel:
↑(when input is empty) — enter selection mode (highlight the latest queued item)↑/↓— move the selectione— edit the selected follow-upd— delete the selected follow-upEnterwhile editing — save the changeEsc— exit selection or editing without committing
Follow-ups are flushed into the conversation automatically as the agent finishes its current turn. This is a real productivity win — you can keep thinking and queuing while the agent does the previous batch.
Approving tool calls
Section titled “Approving tool calls”When the agent wants to run a shell command, apply a diff, delete files, or do anything else gated, the input panel becomes a menu and the transcript shows what’s being requested. The header is the tool name and the body is the diff or command being proposed.
Keys in the approval menu:
| Key | Action |
|---|---|
↑ / ↓ (or j / k) | Move the selection |
Enter (or y) | Apply the highlighted action |
a | Jump to the “approve” action |
d | Jump to the “deny” action |
n | Reject this command immediately |
Esc | Reject this command and skip to the next |
Ctrl+C | Reject this command (special: on a plan-update prompt, drops into free-form feedback) |
Available actions depend on the kind of pending approval:
- Approve once — run this time only
- Approve & remember — run AND record the decision so the same kind of command runs without asking next time
- Deny once — reject this run; the agent gets a refusal and decides what to do next
- Deny & remember — reject AND write a permanent deny rule
- Approve all — when multiple commands are queued, approve every queued one in order
- Provide feedback — for plan-update prompts, drop into a free-form feedback editor
If you started with --automagic, every approval prompt is auto-applied as “approve once.”
Ask-questions forms
Section titled “Ask-questions forms”The agent has a tool that lets it ask you a structured set of multiple-choice questions, with an optional “freeform” answer per question. When that fires, the input area becomes a form:
Tab/Shift+Tab— move between questions↑/↓(ork/j) — choose an answer option (the last option is “freeform”)- When the freeform option is selected, type a free-form answer; Enter saves it
Y/Enter— submit the form (only after every required question has an answer)N/Ctrl+C— reject the form and refuse to answer
This is the agent’s way of asking you a question — typically when it has a real ambiguity that won’t resolve from reading the code.
Scrolling the transcript
Section titled “Scrolling the transcript”- Mouse wheel
PageUp/PageDownUp/Downarrows when the input box is empty (only when not in input history mode and there’s no follow-up selection — those override)
The transcript auto-scrolls to follow new content unless you’ve scrolled up — in which case it stays where you are so you can read.
- Wheel — scroll the transcript (3 lines per tick)
- Right-click on a message (in terminals that forward right-click events) — copy that block to the clipboard
Right-click copy targets:
- Your messages
- Assistant reasoning steps (“Thinking…” blocks)
- Assistant text and preformatted blocks
- Individual tool calls (with their arguments and output)
Some terminals keep right-click for their own native context menu. In those terminals, the copy gesture won’t reach the TUI; use your terminal’s normal text-selection instead.
Stopping the agent and quitting
Section titled “Stopping the agent and quitting”| Key | What it does |
|---|---|
Ctrl+C (while agent is generating) | Stop the current run. Lets you redirect mid-loop. |
Ctrl+C (when idle) | Show “press Ctrl+C again to quit” hint; second press within 2 seconds exits |
Ctrl+D | Exit on empty input |
/exit (or /quit) | Exit cleanly |
Esc does not quit. Two quick Escs within 500ms clear the current input draft (without exiting).
Status line cues
Section titled “Status line cues”There’s a single status line above the input.
Bottom-left (when online):
- Token usage:
X% used (Yk out of Zk)— Y is your latest assistant turn’s input tokens; Z is the model’s max input window (or the long-context window if--allow-long-contextis on) mode:agentormode:plan— the current runtime mode (mode:planindicates you’re in plan mode)feedback pending— when a plan-update prompt is waiting for your free-form feedbackN pending hidden— when N tool-call approvals are suspended (e.g., during plan-mode review)
Bottom-right:
- Connection-state dot:
●colored — yellow=connecting, green=online, red=offline; no dot when unauthenticated - Your sign-in email (when online)
vX.Y.Z— your installed Magic Coder version
Top-right:
- Workdir, compacted (e.g.,
/Users/you/Projects/github.com/MathAndMagic/magic-coder-tui→~/P/g/M/magic-coder-tui) - Git branch (when in a repo)
If the server tells the client “you need to upgrade,” the top-right is replaced by a warning banner: Update required: upgrade your Magic Coder client. Run coder --help to see the version you have, then re-run the install script (or brew upgrade magic-coder) to update.
Login-only mode
Section titled “Login-only mode”When you’re not signed in, the input box accepts only this small set of slash commands:
/login— sign in/help— show help/exit(/quit) — exit/clear(/reset) — clear local conversation state/theme— change theme/long-context— toggle the long-context preference
Other slash commands and any free-form text are blocked from submission. Run /login to unlock the rest.
The /help modal
Section titled “The /help modal”/help opens a centered overlay. The actual contents:
Enter— send your message or accept a highlighted slash commandShift/Alt+Enter / Ctrl+J(or\ + Enter / Alt+Enter / Ctrl+Jinside tmux) — insert a new lineEsc + Esc— clear the current text input/— open the slash commands menuTab— accept the current slash suggestionCtrl + C— stop the current run, or press again to quit when idle- A docs link to
https://coder.bridgeapp.ai
Press any key to close.
Sleep behavior
Section titled “Sleep behavior”Long agent runs disable system sleep so your machine doesn’t doze off mid-loop. The default is auto — sleep is inhibited only while the agent is actively working. You can change this in ~/.magic/config.toml; see Sleep mode.
Exiting and resuming
Section titled “Exiting and resuming”When you exit, Magic Coder prints a hint like:
Continue on any device:coder --continue 8a3f2b1e-...-7d9cSave the UUID. See Resuming threads.