Terminal client — work in progress
nxm-tui — Terminal chat client for any LLM server
A keyboard-driven TUI that connects to any OpenAI-compatible server (Nexum Inferentia, Ollama, LM Studio, NVIDIA NIM). Streaming SSE responses, agentic tool calls, a bounded agent loop and secret-safe key management — no server management, no secrets on disk.
Pure client: no model loading, no hardware detection. Open source under the MIT license.
Why I built it
The NXM inference engines (engine-mlx, engine-metal, nxm-memory) needed a lightweight, keyboard-driven frontend that works entirely in the terminal — streaming responses, agentic tool calls and per-provider API keys without ever writing secrets to disk.
What it is
A ratatui + crossterm TUI that speaks OpenAI-compatible SSE. It draws only on change (no 60 Hz busy redraw), renders Markdown with a pure-Rust V3 pipeline (ported from grok-build, syntect highlighting, cell-width-aware wrapping for CJK/emoji), and runs a bounded agentic loop with tool approval gating.
Key features
streaming chat
SSE token streaming, Markdown V3 render, reasoning / tool / metrics overlays (Ctrl+R / Ctrl+O / Ctrl+M)
agentic tools
read_file, list_resources, web_search, grep, search_replace via nexum-tools, with Y/N approval gate and risk badges
bounded loop
Hard cap 15 steps + stagnation breaker 3 identical calls; /continue resumes with a fresh Agent and the same transcript
keystore
Injectable KeyStore: env, OS keychain, or AES-256-GCM + Argon2id encrypted file. Keys in Zeroizing, never logged
mcp host
Spawns stdio MCP servers, serves sampling/createMessage bridging to the LLM backend; clean no-op when absent
Diagrams
Interactive diagrams generated from the source of truth in docs/diagrams/ — dark/light theme, motion and SVG/WebM export inside each viewer. Open any of them full-page on GitHub.
Architecture — components and boundaries

Agentic loop — bounded loop, approval gate, /continue

Chat stream sequence — SSE + tool call round-trip

Privacy & control
To manage privacy you need a harness like nxm-tui: one that runs entirely on your machine and gives you control over every iteration and every tool. No cloud dashboard, no hidden telemetry — the only network traffic is the chat request to the LLM endpoint you chose.
Every tool call passes a Y/N approval gate with risk badges (sensitive path, network egress, unknown tool). The agent loop is hard-capped at 15 iterations with a stagnation breaker at 3 identical calls, and /continue only resumes when you ask for it. Secrets live in a local KeyStore — env, OS keychain, or an AES-256-GCM encrypted file — wrapped in Zeroizing and never logged. MCP servers run as local stdio children; the sampling bridge never reads your conversation.
Tech details
Language
Rust, edition 2021 — bin + lib crate, tests/ external per project rules
TUI
ratatui 0.29 + crossterm 0.28, draw-on-change + 30 Hz idle polling
HTTP
reqwest 0.12, SSE streaming via futures StreamExt
Keystore
AES-256-GCM + Argon2id (keys.enc 0600), keyring 4.x, Zeroizing
Markdown
pulldown-cmark 0.13 + syntect default-fancy + anstyle bridge (V3 port)
Tools
nxm-tui-tools workspace member: read_file, list_resources, web_search, grep, search_replace (SSRF-guarded web_fetch)
MCP
stdio child host, JSON-RPC 2.0, sampling/createMessage bridge
Install
curl -fsSL https://raw.githubusercontent.com/dangranaz/nxm-tui/main/install.sh | sh
Prebuilt binaries for Apple Silicon macOS and Linux x86_64, or build from source with cargo build --release.
License
MIT
View on GitHub
Created by Daniele Oddo — AI Engineering Architect
Project: nxm-tui — github.com/dangranaz/nxm-tui — status: work-in-progress (0.1.0-wip)
Roadmap — work in progress
Features already planned in sessions and studies (wayfinder tickets, loop engineering, MCP roadmap). Status reflects the current branches.
1. /continue after halt
Resume the agent loop after a hard stop (budget cap or stagnation breaker) with a fresh Agent and the same transcript — branch work/loopeng-01-03, in progress
2. Plan mode
enter_plan_mode / exit_plan_mode tools with a write-abstaining manifest filter and a 🅿️ PLAN indicator in the mode bar — branch work/41-plan-mode, pending review
3. Todo tool + overlay
Agent-managed shared TodoList (add/complete/list) with a read-only checklist overlay (Ctrl+D) — branch feat/tools-todo
4. Per-task tool selection
Automatic manifest_for(task) selection (Core fail-safe + keyword match) unioned with manual overlay toggles — branch feat/tools-select-mechanism
5. MCP tools/call + approval
Invoke server-side MCP tools from the TUI with a human-in-the-loop approval overlay and persistent multiplexed sessions — MCP roadmap
6. Scrollback search UI
Wire the ported src/search.rs into the TUI: Ctrl+F search over history with next/prev navigation — ticket T5
7. Streaming markdown render
Incremental V3 render of the token stream (T14b) instead of batch re-render per message — md/streaming.rs
…
There is more — but I am not saying what yet 😉


