Chat mode (the agent)

chat is a mode plugin, like commander. esc :a Enter (or :a on the F10 line) swaps commander out, and the chat docks above the prompt in the same slot. esc :c brings commander back. The conversation stays while you switch, and a running turn keeps running.

It answers questions about your terminal and can act on it through tools, like Grok Bot: it can run commands in a terminal on this computer and read their output. Every computer action (typing, running, writing) first shows an approval card with the real command, folder, path or tab, and waits for you: Allow, Allow all or Deny. Nothing runs without that answer.

The chat window

The layout follows grokbot-tui, with rounded corners:

Fullscreen: ⤢ in the header (or the host's F, or its ⤢ at the bottom of the panel) makes the chat fill the terminal space it has; ⤡ or F again gives the shell its rows back. The choice is kept like the panel's height ([window] dock_full).

Commands in the input

Command Does
/hf [words] open the Hugging Face browser, searching for the words if given
/model switch model (as m)
/new new chat (as l)
/revoke turn Allow all off
/help list these

Tab completes the commands, file paths (a word starting /, . or ~ that is not a command) and earlier messages. Start a message with // to send a leading /. ↑ on an empty input brings back the last message.

Allow, Allow all, Deny

Each card is Mouser's approval popup, never drawn by the chat, and answered only with a click or its keys (y, a, n/Esc), after a short arming delay:

The default is always to ask.

Running commands

mouser.terminal_run runs a command line on this computer in your shell ($SHELL -c, cmd /C on Windows), with no terminal and stdin closed, and returns its output and exit code to the model:

To type into a tab's own shell instead (so you see it there), the model uses mouser.shell_run, which asks the same way.

Models from Hugging Face

⌕ models in the header, h, /hf, or "⌕ Search Hugging Face…" at the top of the model picker opens the browser in the chat's frame:

  1. Type part of a name (qwen 0.5b, gemma) and press Enter: the GGUF models that match, most downloaded first, with downloads (↓) and likes (♥). Tab completes earlier searches and the ids shown.
  2. ↑/↓ and Enter, or a click, opens a model: its card summary, downloads, likes, license, task, architecture, parameters, context length, last update, and its GGUF files by quantization (Q4_K_M, Q8_0, F16, …) with sizes, ✓ when installed. It also says what Mouser can tell before downloading: "supported architecture, not load-tested" when the bundled llama.cpp knows its architecture (the file itself is only tried on the first message), or "won't run" and why, with no Install, for an architecture it doesn't know or a model that is not a chat model (embeddings, speech).
  3. Choose a quantization (the smallest Q4 is preselected) and click Install (or Enter). Mouser's popup asks first with the repository, file, size, license and folder. The download shows a progress bar here (and in the chat's status line once the browser is closed); cancel stops it, and Install again resumes it. Each file is checked against the SHA256 Hugging Face publishes.
  4. When it is done it is the current model (gemma-local/NAME), so the next message uses it. An installed one shows Use instead of Install.

Esc goes back from a model to the list, then closes the browser (it keeps the search). More in Models (mouser model hf does the same from the command line).

Pictures, video and sound

A picture, video or sound named in a message or in a tool's output (a Markdown image or link such as ![plot](https://github.com/WeirdBrains/mouser/blob/main/docs/tmp/plot.png), or a local path like /tmp/out.wav or ~/Pictures/cat.jpg) gets a player under it:

Click a picture or ⤢ to open it fullscreen within the chat's space: it flies from the thumbnail with the same ease-in-out and dimmed backdrop as commander's viewer (off with reduced motion). There, Space (or a click on a video) plays and pauses, ←/→ seek 10 s, and Esc, f, Enter or ⤡ close fly it back. Video and sound use Mouser's own player (ffmpeg and ffprobe on PATH; sound through your [audio] output, docs/preferences.md) and stop when you leave the chat.

Reading files needs the files.read permission, asked the first time: until then each one shows "▶ show NAME here (allow reading files)". Web URLs are not fetched; only files on this computer are shown.

Keys

Keys are plain and work while chat has the keyboard (switching to it with esc :a, a click, or ctrl+alt+k; Esc or ctrl+alt+k gives it back, docs/modes.md). All keys can be remapped in modes.toml under [chat.keys]; ctrl+shift+k lists them.

Key Does
i (or click the input) type a message; Enter sends, Ctrl+U clears
esc, x, Ctrl+C, the cancel button cancel the running turn (the stream stops, an open card is denied, a running tool is told to stop: MCP servers get notifications/cancelled, and a stdio server that hasn't stopped within 1 s is killed and reconnected)
y / a / n card: Allow / Allow all (this chat) / Deny
m (or click the model name in the header) switch model: "Search Hugging Face…", then the configured models; Esc keeps the current one. The choice becomes the default (as mouser model default) and applies from the next message
h search Hugging Face for a model to install
l new chat
PgUp / PgDn, wheel scroll the transcript
click a tool row show or hide its output
click a link in a message open it (web, mail and file links only)

Your messages and the model's replies are drawn as Markdown: headings, bold and italic, inline code, code blocks on a background (syntax highlighted by their language tag), lists, quotes, links and tables (Markdown rendering). A reply that is still streaming in is laid out as far as it has come; the rows above stay where they are.

Cards are answered only with these alt keys or a click, so ordinary typing can never approve anything. With nothing running, esc leaves the input and keys go back to the shell.

Context menu

Right-click (or . while chat has the keyboard; docs/modes.md §Context menus):

"Delete from view" only hides the row; the agent's history is unchanged (a new chat clears it). Approval cards are still answered only in Mouser's popup.

What it sees

Each message carries the active tab's place (folder or remote host), its visible screen and the last 200 scrollback lines (CONTEXT_LINES).

Tools and permissions

Tools Names Permission
The terminal (chat only) mouser.terminal_run asks on every call (shell.type), unless Allow all is on
Mouser's own (the P2 MCP server's, in-process) mouser.screen_read, mouser.shell_run, mouser.file_sync, mouser.set_theme, … reads run unless the broker says never for chat; shell, file and theme changes ask on every call unless Allow all is on
Connected MCP servers and MCP plugins (P3) SERVER.TOOL, plugin:NAME.TOOL the server's broker entry (mcp-server:NAME / plugin, tool.NAME); ask shows the card (Allow all covers these too)

Tool-provider plugins are MCP plugins, so they appear in the second row once enabled. Names sent to the model replace dots with __ (mouser__shell_run). mouser plugin permissions chat shell.type=never blocks a capability for the chat.

Picking a model

If there is no usable default model (none set, a hosted preset without a key, or the local model not downloaded), esc :a opens a picker in the dock instead of the chat. A message typed before that is kept and sent once a model is ready. A chat restored at launch (the last mode) does not open the picker until you use it.

The picker lists: Gemma 4 E2B local (default, ~2.84 GB), Gemma 4 E4B local (~4.59 GB), OpenAI, xAI, OpenRouter, Kimi (Moonshot), Anthropic, Google, and a custom OpenAI- or Anthropic-compatible URL. ↑/↓ and Enter or a click choose; Esc steps back.

Model

The chat uses mouser model default at each turn (docs/models.md). gemma-local is built in (mouser model local enable), or runs through mouser model local url. Any configured provider works too. The header shows provider/model.

Limits and transcripts

Code

Layout

The input line and status sit above the host's dock chrome (the ⤢ fullscreen button and the focus hint at the bottom), so they are never covered. See dock_chrome_height in mouser-mode-api.

As a plugin program

plugins/chat (mouser-chat) is the chat mode as a separate program, built only on mouser-mode-api with its markdown feature. Installed as a transport = "mode" plugin named chat, it is the chat mode (hotkey a; Mouser has no built-in chat since 1.4.0). It needs the agent.use permission. Opening chat the first time asks for that grant (via the approval popup) when the plugin calls agent.models / agent.state — it does not hard-fail with "is not allowed". The agent itself still runs inside Mouser: the plugin sends agent.send / agent.cancel / agent.clear and draws the transcript from agent.state events, so your keys and models never leave Mouser. Tool-call cards are drawn by Mouser's approval popup, not the plugin; the plugin only shows "waiting for your answer". The header's model button lists agent.models and sets the default with agent.set_default; agent.revoke_all turns Allow all off (it is turned on only in Mouser's popup). The Hugging Face browser uses models.hf_search, models.hf_details, models.hf_install (Mouser asks, downloads and sends models.download progress) and models.hf_cancel. Media files are read only with files.read.

Keys: i type, Enter send, x cancel, m model, h Hugging Face, l clear, PageUp/PageDown scroll. With no model the picker offers the Hugging Face search; hosted providers are set up in the preferences mode or with mouser model add. Tested through Mouser's StdioMode with a fake provider in plugins/chat/tests/through_mouser.rs.

Source: docs/chat.md