magi-code 0.63.3

Repository-aware CLI coding agent for terminal work
Documentation
# Mission Control TUI

[Feature docs index](README.md) · [Repository README](../../README.md)

## Purpose

Use the opt-in ratatui Mission Control interface, activity tree, transcript, modals, autocomplete, model/thinking controls, and keyboard shortcuts.

## Details

`magi-code --tui` launches the opt-in Mission Control interface. It cannot be combined with `--print` or trailing prompt arguments, and it requires both stdin and stdout to be TTYs. For non-interactive use, pipes, or automation, use `--print`.

The prompt border displays running status/cancel actions on lower left and active provider/model/current effective `Thinking` level on lower right. Footer left shows `📂cwd: <cwd> - branch: <branch>` when branch available, footer right shows `MAGI-CODE vX.Y.Z`.

`write` calls appear in the transcript and activity tree as `writing` while running, then reconcile to success or failure when the tool completes. `hash_edit` calls appear in the transcript and activity tree while running, then reconcile to success or failure when the tool completes. Completed successful `hash_edit` activities show a readable applied unified-diff-style preview in the Selected Activity Detail pane only. When tool-call hooks are enabled and `hooks.show_in_tui` is `true`, matching before/after hooks appear as child activity rows under the related tool with running, success, or failure status plus sanitized phase/label/tool metadata; default `false` keeps successful hook runs quiet. Provider context injection rows use separate `hooks.injected_content` gates: `show_in_transcript` displays distinct local/system transcript rows, `show_in_activity_tree` displays activity rows under the related tool/message when available or as root rows otherwise, and both gates default to `false`. `hooks.show_in_tui` does not control provider context injection visibility. `hooks.injected_content.style` defaults to `content`, showing redacted/truncated injected content; `metadata` hides injected content and shows only label, status, item count, and byte count. These settings only affect Mission Control display and do not enable provider context injection itself. Typing `/` as the first prompt character opens slash-command suggestions for `/help`, `/login`, `/logout`, `/setmodel`, `/models`, `/skills`, `/sessions`, `/system-prompt`, `/new`, and `/quit`. Typing `@` anywhere in the prompt opens fuzzy file-tag suggestions for regular files under the active working directory; accepted suggestions insert slash-normalized relative tags such as `@src/lib.rs`. Typing `$` anywhere in the prompt opens fuzzy skill-tag suggestions for enabled discovered skills; accepted suggestions insert literal tags such as `$rust-dev`. Skill tags are prompt text only: they do not auto-load skills or add provider/session metadata. Typing `#` anywhere in the prompt opens context-tag suggestions for `#tree` and `#git-status`; accepted suggestions insert literal tags and never execute commands or submit the prompt. Context tags expand only after prompt submission in top-level `--print`, classic shell, and Mission Control prompts: `#tree` injects bounded `tree` output, `#git-status` injects bounded `git status` output, commands run in the active working directory through guarded bash execution, and command failures appear as bounded context blocks.

## Controls

| Key | Behavior |
| --- | --- |
| `Enter` | Submit prompt when Prompt is focused. Accept autocomplete when suggestions are visible. |
| `Shift-Enter` | Insert newline in prompt. |
| `Ctrl-C` | Clear input, or exit when input is empty. |
| `Ctrl-D` | Exit. |
| `Alt-1` | Focus Activity Tree. Plain `Up` / `Down` move active activity selection. |
| `Alt-2` | Focus Selected Activity Detail. Plain `Up` / `Down` scroll activity detail. |
| `Alt-P` | Focus Prompt and close help. Subsequent typing edits the prompt. |
| `Esc` | Focus prompt, close help/modal, or cancel active modal action. |
| `Tab` | Accept autocomplete suggestions when visible. In the `/sessions` modal, move focus between session list and preview. |
| `Shift-Tab` | Cycle primary-agent selection normally. In the `/sessions` modal, move focus back to the session list when the terminal delivers `BackTab`; terminal-dependent. |
| `Alt-T` | Cycle the active model's thinking level and persist it. Unsupported providers/models show a diagnostic and keep provider defaults. |
| `Ctrl-T` | Compatibility alias: focus Activity Tree. |
| `Ctrl-Shift-Right` / `Ctrl-Shift-Left` | Switch to activity-focused columns, or restore transcript-focused columns. `Alt-Right` / `Alt-Left` remain secondary aliases where terminals deliver them. |
| `F1` or `/help` | Toggle/open help overlay. |
| `Up` / `Down` | Route by focused pane or active modal/autocomplete: prompt cursor, transcript scroll, Activity selection, selected activity detail scroll, suggestions, or picker rows. |
| `Alt-E` / `Alt-C` | Expand or collapse all activities. While a prompt is running, `Alt-C` instead requests cancellation of that active prompt and does not submit editor text. |
| `Alt-F` / `Alt-R` | Select the first failed or running activity. |

During a running prompt, the prompt lower-left border shows `[Alt-C] to cancel` next to the activity/status label while cancellation is still actionable. Cancellation stops at the next safe runtime boundary; an already-started blocking provider request or tool may finish its current blocking call before Mission Control reports the run as settled and accepts the next prompt.


During OpenAI Codex login, Mission Control shows wrapped OAuth instructions in a modal. `Ctrl-Y` copies the URL, `Ctrl-O` opens it in the OS browser, and pasted fallback input is treated as transient/redacted.


The Activity tree and Selected Activity Detail panes show tool and subagent lifecycle state. Generic diff activity output remains available in Selected Activity Detail. Footer branch status, `#git-status` context injection, and Git-aware autocomplete remain available; Mission Control does not expose a separate Git list or diff pane.
The `/sessions` modal opens as an expanded session switcher. When terminal space permits, left column lists sessions newest-first and marks current session; right column previews selected session with first and most recent user/assistant conversational messages. Preview ignores tool-only, hook, context-cache, title, and diagnostic events, and displayed text is sanitized/redacted. Controls: `Tab`/terminal-delivered `Shift-Tab` changes modal focus, `Up`/`Down` moves list or scrolls preview by focus, mouse wheel scrolls hovered column, `Enter` switches from either focus, and `Esc` closes without switching.

---

[Back to feature docs](README.md) · [Back to repository README](../../README.md)