Skip to content

CLI / TUI / Web

源码版本v2026.7.20

Responsibility

The interface layer is the other group of entry points (besides the gateway's messaging platforms) through which users reach the agent: CLI (hermes_cli/, a command-line subcommand system), TUI (ui-tui/, a TypeScript terminal UI + the tui_gateway/ Python bridge), Web (web/, a browser interface). All three ultimately feed user input into the agent's run_conversation and render the output back. They sit alongside the gateway layer — the gateway connects to external platforms; the interface layer connects to local users.

Key Files

CLI

TUI

Web

Data Flow

  1. CLI: hermes <subcommand> → parsed by hermes_cli/_parser.py → executed by the subcommand module (auth/backup/blueprint/...); conversation-type commands ultimately call AIAgent.run_conversation:6350.
  2. TUI: ui-tui/ (TS frontend) connects to tui_gateway/ws.py via WebSocket; tui_gateway bridges terminal events to the agent (tui_gateway/server.py holds the agent); output is pushed back to the frontend via tui_gateway/event_publisher.py.
  3. Web: web/ (Vite frontend) similarly connects to the agent through a backend, rendering the conversation and tool results.
  4. All three assemble their agent instance via init_agent:276 and share the same capability layer.

Summary

The interface layer = three shells (CLI/TUI/Web) + one tui_gateway bridge. They hold no business logic, only the input/output form. They sit alongside the gateway layer: the gateway connects to external messaging platforms; the interface layer connects to local terminals/browsers. ACP (see here) connects to the IDE, completing the full "reach surface".

Unofficial community learning site. Content based on the MIT-licensed NousResearch/hermes-agent source.