term2
An open terminal agent runtime for local and SSH workflows, with provider-flexible models, guarded execution, durable conversations, and delegated work.
term2 began as a conversational terminal assistant and grew into an application-owned agent runtime. It is designed for working on local codebases and remote servers while keeping the execution model visible and controllable.
The interesting part is not another chat box in a terminal. It is the control plane around the model: how a turn enters the system, how tools are exposed, how commands cross a safety boundary, how context survives long sessions, and how delegated work returns without consuming the main conversation.
The engineering problem
Coding agents sit at an awkward intersection. They need broad access to be useful, but that access must be understandable. They need to stream quickly, but also persist enough state to resume and rewind. They need to support new model providers without letting provider details leak through the whole application.
term2 treats those tensions as architecture problems rather than interface options.
An application-owned runtime
The runtime is implemented directly in TypeScript rather than delegated to a provider-specific agents SDK. A provider registry keeps model transports at the edge, while the main turn path separates conversation admission, queued execution, turn coordination, streaming normalization, persistence, approvals, retries, and tool dispatch.
That separation lets the same runtime power both the interactive React/Ink interface and a non-interactive CLI. It also makes provider behavior testable through dedicated black-box suites instead of assuming every OpenAI-compatible endpoint behaves the same way.
Read the current architecture overview for the complete lifecycle.
One runtime, five ways to work
The current system exposes five purpose-built operating modes:
- Standard for full codebase work, with workspace patches approved automatically.
- Plan for read-only investigation and implementation planning.
- Lite for fast, read-only terminal assistance.
- Mentor for bringing a separate expert model into a difficult decision.
- Orchestrator for delegating tool-backed tasks to specialized subagents.
These modes share a runtime, but change the available capabilities and control policy. Moving between them is a change in operating contract, not just a different prompt.
Guarded execution without approval fatigue
The original version treated approval as a single yes-or-no gate. The current design is more deliberate: sandbox read policies protect sensitive paths, shell approval can be manual, advisory, automatic, or always-on, and normal workflows still confirmation-gate destructive actions.
This graduated model matters because unconditional prompts eventually become noise. The goal is to keep consequential actions visible without asking the user to approve harmless work one command at a time.
Durable and delegated work
term2 persists conversations as event logs, supports resuming prior sessions, and can rewind to an earlier user turn before editing or resending it. Provider-neutral context compaction helps long conversations remain usable without tying state management to one vendor.
For larger jobs, specialized subagents can investigate or implement in parallel. Background shell work is monitored through the same task interface, keeping foreground turns responsive while preserving a visible record of what is still running.
Remote and provider-flexible by design
The provider layer supports OpenAI, OpenRouter, OpenAI-compatible endpoints, Vercel AI SDK providers, and additional first-party adapters in the source tree. Native SSH mode applies the same agent workflow to remote text files and command execution without installing term2 on the target server.
The point is not to promise that every provider or remote environment behaves identically. It is to keep those differences behind explicit boundaries so the rest of the system can reason about one coherent workflow.
Current snapshot
As of version 0.15.0, the project includes:
- A first-party TypeScript agent runtime
- Five operating modes and specialized subagents
- Provider registry and multiple model transports
- Native local and SSH workflows
- Sandbox policies and graduated approvals
- Resume, rewind, usage accounting, and model handoff
- Provider-neutral context compaction and recovery
- Monitored background agents and shell jobs
- Interactive Ink UI and non-interactive CLI entry points
See the source repository, changelog, and architecture documentation for the latest state.