Skip to main content

Interactive TUI for Sage AI agent

Project description

sage-tui

Interactive terminal user interface for the Sage AI agent framework.

Features

  • Split-screen layout with chat, status, and log panels
  • Streaming and batch response modes with animated thinking indicator
  • Collapsible tool call display with color-coded status (running, success, error)
  • Markdown rendering for agent responses
  • Permission modal for tool approval
  • Parallel subagent orchestration
  • Context window usage bar with color gradient
  • Token breakdown and session cost tracking
  • Auto-generated session titles via LLM
  • Input history navigation
  • Smart auto-scroll that respects manual scroll position
  • Log forwarding to TUI panel

Installation

uv add sage-tui

Or with pip:

pip install sage-tui

Requires Python 3.10 or later.

Quick Start

# Point directly at an agent definition
sage-tui -c /path/to/AGENTS.md

# Or use a config.toml
sage-tui --config /path/to/config.toml

# Or set the env var and just run
export SAGE_CONFIG_PATH=/path/to/config.toml
sage-tui

CLI Options

Option Description
--agent-config, -c PATH Path to AGENTS.md or directory containing one. Inferred from config.toml if omitted.
--config PATH Path to main config.toml. Also reads the SAGE_CONFIG_PATH env var.
--verbose, -v Enable debug logging.

Keyboard Shortcuts

Key Action
Enter Submit message
Shift+Enter / Ctrl+J Insert newline
Up / Down Navigate input history (single-line mode)
Ctrl+B Toggle status panel
Ctrl+L Toggle log panel
Ctrl+N New session (clear chat, reset agent)
Ctrl+S Toggle streaming / batch mode
Ctrl+O Orchestrate subagents (if available)
Ctrl+Q Quit
Y / N Approve or deny in permission modal

Layout

The TUI is divided into four areas:

  • Chat panel (left, flexible width) -- Conversation history with inline collapsible tool calls and a message input box at the bottom.
  • Status panel (right, 40 columns, hidden by default) -- Session info, context window usage bar, token breakdown, agent info, skills, and active agents. Toggle with Ctrl+B.
  • Log panel (bottom, hidden by default) -- Scrollable log viewer for the sage.* logging namespace. Toggle with Ctrl+L.
  • Status bar (bottom, 1 line) -- Agent state, model name, stream mode indicator, token usage, cost, and keyboard hints.

Configuration

There are three ways to configure which agent the TUI loads:

1. Direct agent path

sage-tui -c /path/to/AGENTS.md

Point at an AGENTS.md file or a directory that contains one.

2. Via config.toml

sage-tui --config /path/to/config.toml

The TUI reads the agents_dir and primary fields from config.toml to resolve the primary agent definition.

3. Auto-discovery

export SAGE_CONFIG_PATH=/path/to/config.toml
sage-tui

When no flags are given, the TUI reads the SAGE_CONFIG_PATH environment variable, locates config.toml, and resolves the primary agent from there.

A .env file in the working directory is loaded automatically via python-dotenv.

Streaming vs Batch

The TUI supports two response modes, toggled at runtime with Ctrl+S. In streaming mode, tokens appear incrementally as the model generates them, with an animated thinking indicator while waiting. In batch mode, the full response is displayed only after generation completes. Streaming is the default.

Development

See CONTRIBUTING.md for development setup and guidelines.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sage_tui-1.1.1.tar.gz (242.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sage_tui-1.1.1-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file sage_tui-1.1.1.tar.gz.

File metadata

  • Download URL: sage_tui-1.1.1.tar.gz
  • Upload date:
  • Size: 242.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sage_tui-1.1.1.tar.gz
Algorithm Hash digest
SHA256 0f47f65110ae925e0d8846f4a7b57d79c8c4f7165edad984a16ab5c6bf44d20a
MD5 3e6a33ae6787419aecf420667c39c631
BLAKE2b-256 1954492816b068ee6dcd86d1d5fd9f6a4e3a43e7bd53ac4c85dbe8e8acbce49a

See more details on using hashes here.

Provenance

The following attestation bundles were made for sage_tui-1.1.1.tar.gz:

Publisher: release.yml on sagebynature/sage-tui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sage_tui-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: sage_tui-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sage_tui-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8b24111a4a86825ecfcc65d4fc7652a2ae10d12d7c1abc9c5674f12e0686df77
MD5 a098d3d051a81277ddac006e336c09a2
BLAKE2b-256 69f66b1f315c11abe4d69a86075ee6196e0f112aa2afed5ab499043166beaefc

See more details on using hashes here.

Provenance

The following attestation bundles were made for sage_tui-1.1.1-py3-none-any.whl:

Publisher: release.yml on sagebynature/sage-tui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page