MARS
Mission control for your terminal — a non-modal, Emacs-compatible terminal editor with a Claude-Code-style command bar, a built-in LLM agent, real terminal panes, and tmux/zellij-style persistent sessions. One tool, one set of keys.
███╗ ███╗ █████╗ ██████╗ ███████╗
████╗ ████║██╔══██╗██╔══██╗██╔════╝
██╔████╔██║███████║██████╔╝███████╗
██║╚██╔╝██║██╔══██║██╔══██╗╚════██║
██║ ╚═╝ ██║██║ ██║██║ ██║███████║
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝
Build & install
# put it on your PATH:
Quick start
Sessions are the default, tmux-style: a bare mars gets an auto-numbered session
that survives closing the window. Press any key to dismiss the startup banner.
Inside the editor, four keys carry you everywhere:
| Key | What it does |
|---|---|
Ctrl+Space |
search every command (type to filter, Enter to run) — works in terminal panes too |
! (in the bar) |
run a shell command in a terminal pane |
? (in the bar) |
ask the built-in agent anything ("how do I split the screen?") |
C-t |
travel mode: tabs, panes, splits — with an on-screen cheat panel |
C-g cancels anything. Every menu row shows its real keybinding, so the fast path
teaches itself as you go.
Moving around fast
Fast motion is bound to both ⌘ and ⌥ (Option). ⌘ reaches Mars only on
kitty-protocol terminals (kitty, WezTerm, Ghostty, recent iTerm2); on Terminal.app /
Warp the OS eats ⌘ — use ⌥ there (enable "Use Option as Meta" if offered). The
C-x jumps work on every terminal.
| Do this | Keys | Also |
|---|---|---|
Jump by code token (foo·.·bar·(·baz·)) |
⌘←/⌘→ or ⌥←/⌥→ |
M-b / M-f (word) |
| Page up / down | ⌘↑/⌘↓ or ⌥↑/⌥↓ |
PageUp / PageDown |
| Extend selection while jumping | add Shift (⌥⇧→) |
Shift+PageUp/Down |
| Next/prev blank-line block | C-x ] / C-x [ |
|
Next/prev definition (fn/def/class…) |
C-x } / C-x { |
|
Matching bracket ()[]{} |
C-x m |
Search doubles as teleport. C-s, type a word you can see — it jumps as you
type, with a 3/12 counter. Press Tab and every visible match gets a one-letter
label; press a label to teleport straight there. And you don't have to press Enter:
just start editing or hit a motion key — the search commits at the current match and
your key applies. C-s/C-r cycle matches, C-g cancels (restoring where you
started).
Sessions — replace tmux/zellij
Sessions keep your buffers, panes, and running shells alive when the window closes, the SSH connection drops, or you just walk away.
The daily rhythm:
- Start:
marsormars new work— everything from here on lives in the daemon. - Detach when you want the terminal back: press
C-tthenD— or just close the window. Both leave shells running and buffers intact. - Come back:
mars attach(ormars attach work). Your layout, buffers, and that build you left running in a terminal pane are exactly where you left them. If anything happened while you were gone — a shell exited, a watched task finished, files changed — onewhile away — …line greets you, failures first. Nothing changed → no briefing. - Finish for real:
C-x C-cinside the session quits it (with an are-you-sure prompt if anything is unsaved), ormars kill workfrom outside.
mars ls tells you the state at a glance:
SESSION STATUS
work detached — reattach: mars attach work
review attached
Safety nets, on by default: modified files autosave every 30s and on every
detach/disconnect (scratch buffers are never touched), and each daemon logs to
~/.local/state/mars/<name>.log — if a session ever dies, the postmortem is there.
Notes: one client per session — attaching from a second window takes over from the first (it gets a clean "another client attached" message). Attaching from a different-sized terminal just reflows.
The agent
Works out of the box with a free-tier key from any of:
# Groq (free tier) — defaults to qwen/qwen3-32b
# Google AI Studio (free tier) — gemini-3.1-flash-lite
# or any OpenAI-compatible endpoint (e.g. local Ollama):
# override the model for any provider:
Reasoning models (Qwen3, DeepSeek-R1) work — their <think> blocks are stripped from
answers automatically.
Then ? in the command bar, or from the shell:
The agent sees your screen — editor buffers, terminal output, your layout — so
"why did this build fail?" needs no copy-paste. It holds a conversation (C-l
starts a fresh one), and it can act: RUN: fires an editor action, TYPE: types
a shell command into your terminal pane, OPEN: jumps to a path:line from a stack
trace — always shown first, always one explicit Enter away, never automatic.
What that unlocks:
- Ask about a selection. Select code (
Shift+arrows orC-x h), then?— the exact selection goes along as context, not just the visible screen. - Reversible refactors. Ask "simplify this" / "add error handling" on a
selection: the panel shows
▶ Enter to replace the selection (N lines). Enter applies it as one undo step, so a singleC-/reverts the whole AI edit. - Triage.
C-x ?(or "why did this fail?" in the bar) grounds the agent in the focused terminal's output;C-x eexplains what's at the cursor. - Watch a pane. Kick off a long command, then
C-t w. When it exits or goes quiet (~20s), Mars leaves a one-line verdict at the bottom, failures first (✗ failed: linker error · build).Escdismisses. This fires even while detached — the daemon keeps watching, somars attachlater lands on the verdict. - Ask beyond the visible screen. Questions like "when did this first start failing?" or "does the error in the api tab match this code?" let the model request more context (the pane's full scrollback, or another tab); Mars supplies it and re-asks once, silently. You do nothing special.
- Shell translation. In a terminal pane,
Ctrl+Spacethen plain English ("find big files here") → the agent translates it to a shell command and shows it for you to confirm. Typed a real Mars command instead? It's recognized and run directly. (!still forces shell,?asks,@opens the file tree.)
With an agent connected, tabs you haven't named get a quiet auto-generated label
from their content (rename one yourself and it's yours forever; auto_name_secs = 0
turns it off).
Keys you already know
Mars speaks three dialects at once — whichever your fingers know:
- Browse files:
Ctrl+Spacethen@(orC-x d) opens a file tree on the left. Folders are bold + colored and collapsed — arrow to one andEnter/→expands it in place (←collapses); on a file,→previews it (reversible) andEnteropens it;../at the top steps up a directory. Start typing to fuzzy-filter the whole project to a shortlist;Esccloses. - Emacs:
C-x C-ssave ·C-x C-fopen ·C-sisearch ·C-k/C-ykill/yank ·C-x 2/C-x 3/C-x owindows ·M-xcommand bar - Modern/Mac:
C-c/C-vcopy/paste (system clipboard) · Shift+arrows select · typing replaces selection · mouse click/scroll/wheel ·⌘C/⌘Von kitty-class terminals - tmux/zellij:
C-ttravel hub ·M-{/M-}orC-PgUp/PgDnswitch tabs ·M-1..9jump to tab ·C-o/Ctrl+arrowsmove between panes ·C-|/C--splits · scrollback with the wheel orShift+PgUp/PgDn
Everything is remappable in ~/.config/mars/keys.json; behavior knobs (autosave
interval, scrollback depth, colors, timings, watch quiet threshold) live in
~/.config/mars/tuning.json, each with a plain-English description of what it does.
Troubleshooting
- Staircase output (lines drifting right, like
mars helpprinting diagonally): your shell's terminal was left in raw mode — usually by a force-killed program. Run anymarscommand (it repairs the terminal automatically on startup) orstty sane. M-…keys do nothing (macOS): enable "Use Option as Meta" in Terminal/iTerm — or use theCtrl-based twins (C-o,Ctrl+arrows), which always work.⌘chords do nothing:⌘only reaches Mars on kitty-protocol terminals (kitty, WezTerm, Ghostty, iTerm2 3.5+); elsewhere the OS keeps it. The⌥andM-…twins work everywhere.- A session shows
dead (cleaned up)inmars ls: the daemon crashed or the machine rebooted. Check~/.local/state/mars/<name>.logfor the reason; autosaved file changes are already on disk. - Fancy chords (
C-{,C--,⌘C) don't fire: they need a kitty-protocol terminal. The Alt-based twins work everywhere.
More
architecture_overview.md— a file-by-file tour of the code: what lives where and how the pieces connect.DESIGN.md— architecture rationale, tradeoffs, and how the pieces fit.key_design.md— the design doctrine and product vision (why the keys are what they are, and where Mars is going).AGENTS.md— instructions for AI coding agents working on Mars.