Skip to content

Terminal

The terminal channel is matic's built-in CLI surface and the default way to interact with agents through matic chat. It reads from stdin, normalizes input into canonical Signals, routes them through the full signal pipeline, and renders agent responses to stdout with lightweight ANSI formatting. Unlike external channels that require credentials and webhook configuration, the terminal is always available, runs in-process with the CLI, and connects to the Daemon over IPC for signal routing.

This section covers how the terminal channel handles input, output, session state, formatting, and multi-agent collaboration at the interface layer.

stdin Signal Ingestion

How the terminal reads user input from stdin, parses @handle mentions and scope flags, and normalizes everything into canonical Signal and SignalPayload objects before entering the routing pipeline. See stdin Signal Ingestion.

stdout Event Emission

How agent responses flow back over IPC and are written to stdout, including streaming output, role labeling, timestamps, and message attribution. See stdout Event Emission.

PTY Session Binding

How matic chat maintains stateful sessions across turns, tracks conversation history and response ownership, and supports resumption with --resume <session-handle> after interruption. See PTY Session Binding.

ANSI and Formatting Constraints

The presentational layer applied to terminal output, including color coding for role labels, state transitions, mentions, and flow indicators. ANSI codes are purely visual; agents never see or reason about them. See ANSI and Formatting Constraints.

Interactive Prompt Rendering

How the terminal renders the input prompt, handles turn-taking between the user and the current response owner, and surfaces routing context without introducing modal interaction states. See Interactive Prompt Rendering.

Terminal Collab Mode Hints

How the terminal conveys collaboration intent through @agent handoffs, @group addressing, and delegation signals without enforcing collab protocols, which remain at the protocol layer. See Terminal Collab Mode Hints.