Skip to content

UI Basics

The Agent UI provides an interactive terminal interface for conversing with NEX, invoking tools, and managing sessions. It is designed to be lightweight, discoverable, and consistent across all agents that support interactive mode.

This page describes the core elements of the UI and how they behave during a typical chat session.

Key Features

  • Context-Aware Prompt Line: Shows your working directory, Git repository and branch (when applicable), active model, and recent usage statistics.
  • Slash Command Control: Built-in commands for help, session management, clearing history, and exiting the UI.
  • File Attachments via @path: Attach local files directly into the model context for review or editing.
  • Tool Visibility: Compact, readable display of tool calls and tool results during agent execution.
  • Persistent Sessions: Automatically saves and restores chat history across runs.
  • Autocomplete Support: Fast completion for slash commands and file paths.

What You See on Launch

When you start NEX in interactive mode, the UI displays a welcome panel that includes:

  • License check status
  • The installed NEX version
  • Quick-start tips for slash commands and file attachments

After the panel, NEX enters the main prompt loop and waits for your inputs.

The status line provides continuous feedback about where you are, what model is active, and how much context you are consuming.

Terminal Color Scheme

NEX supports light and dark terminal backgrounds. By default, NEX_COLOR_SCHEME=auto detects the background at startup and selects a matching palette. If detection is unavailable, NEX uses the terminal's COLORFGBG setting when available, then falls back to dark.

To select a scheme explicitly, set NEX_COLOR_SCHEME to light or dark in your .env or ~/.nex/config file, then restart NEX:

~/.nex/config
NEX_COLOR_SCHEME=light

Set it back to auto to restore automatic selection. For a single launch, use NEX_COLOR_SCHEME=light nex or NEX_COLOR_SCHEME=dark nex. Restart NEX after changing your terminal's background to select the scheme again.

Choose a matching background in your terminal application; NEX_COLOR_SCHEME controls NEX's palette. These startup-panel previews were rendered with NEX v5.85.0:

NEX startup panel with the dark palette on a dark terminal background

NEX startup panel with the light palette on a light terminal background

Entering Messages

Type your message at the prompt and press Enter.

  • Empty input is ignored.
  • Ctrl+C cancels the current request and prints a reminder to use /quit or /exit to leave the UI.
  • Ctrl+D exits NEX immediately.

Slash Commands

Slash commands control the session lifecycle and UI behavior. The following built-in commands are available:

Session Management (/session)

Chat sessions are stored by default under ~/.nex/sessions and are automatically saved as you interact with NEX.

  • /session list (or /session ls) — list recent saved sessions; add --all to include older sessions
  • /session load <id> — load a prior session; add --thinking to show thinking panels during replay
  • /session stats (or /session recap) — show usage statistics for the active session
  • /session export [file] — export the active conversation as Markdown; defaults to nex_session_<id>.md
  • /session prune [--days <n>] — ask for confirmation to delete saved sessions older than the specified age (default: 60 days), excluding the active session
  • /session rename <title> — rename the active session
  • /session remove <id> — delete a saved session (cannot delete the active one)
  • /session reset — start a new session with an empty conversation history

When you load a session, NEX replays the previous conversation, including tool calls and tool results, so you can resume work in context.

Autocomplete and Input Behavior

The Agent UI includes a line editor with built-in autocomplete:

  • Typing / offers slash command completions.
  • Typing @ offers file path completions.
  • If a completion menu is open and a completion is selected, pressing Enter accepts the completion first. Press Enter again to send the message.

This ensures that both commands and file mentions are quick and consistent to use.

Attaching Files with @path

You can attach local files to the model context by referencing them with @ in your prompt.

Example

Please review @src/foo.py

What happens:

  1. NEX resolves @... mentions relative to the current working directory.
  2. For each valid file, NEX prints a small 📎 Attached file notification.
  3. Text file contents are appended to your prompt in a fenced code block. PDFs are referenced for the agent to read with its PDF tools.

Note

  • Only valid file paths are attached (directories are ignored).
  • Very large files are truncated to keep prompts manageable.

Reading PDFs

Attach a PDF and ask about specific content, for example:

Example

Find the pages about supply voltage in @datasheet.pdf, then read those pages.

The PDF reader can search for a regular expression with find, returning page numbers and short matching snippets. It can read selected pages with pages, using a single page (12), a range (12-18), or a list (1,4,10-12). Supplying both limits the search to those pages.

Large documents are exported to .nex/pdf/ with a page map instead of filling the model context. The default inline limit is 40,000 characters, configurable through PDF_INLINE_CHAR_LIMIT; 0 disables that limit. If selected pages still exceed it, NEX reports the selection size and asks for fewer pages.

A document with no embedded text automatically uses OCR. For a document containing both text and scanned pages, the reader warns when the requested pages have no text layer; a blank page outside the selection does not trigger OCR. An incomplete search result does not establish that the scanned pages lack the requested term. Ask the agent to use tool_pdf_reader_ocr to read or search the scans. This requires the external OCR dependencies; missing dependencies or empty OCR output produce an error. OCR preserves original page numbers, including blank pages. Its pages option limits returned or searched text, but OCR still processes the document.

Tool Calls and Results

The Chat Agent can invoke tools for tasks such as running commands, reading or creating files, analyzing waveforms, and managing FPGA or ASIC flows.

When a tool is used, NEX displays:

  • A compact tool call line showing the tool name and a shortened argument preview
  • A compact tool result line showing a short preview of the returned content

This provides visibility into agent actions without overwhelming the terminal.

Status Line

At the bottom of each response, NEX prints a status line containing:

  • Current directory (with ~ used to abbreviate your home directory)
  • Repository info (when inside a Git repository), formatted as repo@branch
  • Active model name
  • Usage stats for the last request (input/output tokens as a percentage of context length)

Exiting and the Session Recap

When you exit using /quit, NEX prints a Session Recap table that includes:

  • Total input tokens
  • Total output tokens
  • Tool calls
  • Successful tool calls

This summary helps you understand how resource-intensive the session was and how often tools were invoked.

Tips

  • Use /session reset to reset the conversation without leaving the UI.
  • Use @path/to/file attachments for precise code reviews and targeted edits.
  • Use /session list and /session load to resume work across days. To resume on another machine, transfer the saved session files from ~/.nex/sessions first.