Skip to main content
Trinity
Guides/Agent Terminal

Agent Terminal

Browser-based xterm.js terminal providing direct access to the agent's Claude Code TUI, with mode switching between Claude, Gemini, and Bash.

How It Works

1

Open the agent detail page and click the Terminal tab.

2

The terminal connects via WebSocket to the agent container's PTY.

3

The default mode is the Claude Code TUI (interactive AI assistant).

4

A mode toggle in the terminal header switches between Claude, Gemini, and Bash.

5

The terminal supports resize and adapts to the browser window dimensions.

6

Per-agent API key control: toggle between the platform API key and your own Claude subscription in the Terminal tab.

Terminal Modes

Claude — Claude Code interactive mode. The default.
Gemini — Gemini CLI. Requires a GEMINI_API_KEY credential on the agent.
Bash — Raw shell access to the agent container.

Mode switching restarts the PTY process inside the container without dropping the WebSocket connection.

SSH Access

Generate ephemeral SSH credentials via the API or MCP.
ED25519 keys with configurable TTL, controlled by ops settings.
SSH ports: 2222–2262 (incrementing per agent).
MethodReference
APIPOST /api/agents/{name}/ssh-access
MCPget_agent_ssh_access(name)

System Agent Terminal

Admin-only browser terminal for the system agent (trinity-system).
Accessible via the System Agent page.

How It Works Internally

Each agent container runs an SSH server and a PTY multiplexer. The browser terminal connects through the backend's WebSocket proxy — agents do not need to expose ports directly.