Skip to content
Powered by BridgeApp

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.

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).

The input is a multi-line editor. Standard text-editing keys plus a number of readline-style shortcuts.

KeyWhat it does
Left / RightMove cursor by character
Alt+Left / Alt+Right (or Ctrl+Left / Ctrl+Right)Move by word
Up / DownMove cursor by line within the input — but see “input history” and “follow-up queue” below for special cases
Home / Ctrl+ABeginning of line
End / Ctrl+EEnd of line
PageUp / PageDownScroll the transcript by a page
KeyWhat it does
BackspaceDelete previous character
DeleteDelete next character
Alt+Backspace / Ctrl+Backspace / Ctrl+WDelete previous word
Alt+Delete / Ctrl+DeleteDelete next word
Ctrl+UKill from cursor to line start
Ctrl+KKill from cursor to line end
KeyWhat it does
EnterSend the message (or accept the highlighted slash suggestion)
Shift+EnterInsert a newline
Alt+EnterInsert a newline
Ctrl+JInsert a newline
\ + EnterInsert 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).

You can paste large blocks. Magic Coder smooths over paste bursts so the UI doesn’t stall on long pastes.

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 suggestions
  • Tab — accept the highlighted one
  • Esc — 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.

Each workspace has its own history of inputs you’ve typed (stored at ~/.magic/known/<workspace-key>/history.jsonl).

  • Up when the input box is empty → recall previous inputs
  • Down to 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

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 selection
  • e — edit the selected follow-up
  • d — delete the selected follow-up
  • Enter while editing — save the change
  • Esc — 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.

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:

KeyAction
/ (or j / k)Move the selection
Enter (or y)Apply the highlighted action
aJump to the “approve” action
dJump to the “deny” action
nReject this command immediately
EscReject this command and skip to the next
Ctrl+CReject 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.”

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
  • / (or k / 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.

  • Mouse wheel
  • PageUp / PageDown
  • Up / Down arrows 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.

KeyWhat 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+DExit on empty input
/exit (or /quit)Exit cleanly

Esc does not quit. Two quick Escs within 500ms clear the current input draft (without exiting).

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-context is on)
  • mode:agent or mode:plan — the current runtime mode (mode:plan indicates you’re in plan mode)
  • feedback pending — when a plan-update prompt is waiting for your free-form feedback
  • N 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.

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.

/help opens a centered overlay. The actual contents:

  • Enter — send your message or accept a highlighted slash command
  • Shift/Alt+Enter / Ctrl+J (or \ + Enter / Alt+Enter / Ctrl+J inside tmux) — insert a new line
  • Esc + Esc — clear the current text input
  • / — open the slash commands menu
  • Tab — accept the current slash suggestion
  • Ctrl + 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.

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.

When you exit, Magic Coder prints a hint like:

Continue on any device:
coder --continue 8a3f2b1e-...-7d9c

Save the UUID. See Resuming threads.