Agent Terminal

Agent Terminal is an open-source terminal automation harness created by Jason Kneen designed to let AI agents interact directly with command-line interfaces. Built on Microsoft's node-pty—the same pseudo-terminal library that powers the VS Code integrated terminal—it provides a headless execution environment for terminal applications. The tool operates either as an importable Node.js library, a standalone CLI utility, or a Model Context Protocol (MCP) server. Rather than executing standard stateless child processes, Agent Terminal maintains stateful terminal sessions, capturing raw screen buffer state as clean ASCII text and allowing agents to dispatch simulated keyboard inputs, control sequences, and interactive commands. What differentiates Agent Terminal is its focus on handling interactive CLI software such as text editors (vim, nano), REPLs (Python, Node), package managers, and setup wizards that normally break standard sub-process wrappers due to missing TTYs or complex cursor control codes. By exposing a full PTY layer via MCP or programmatic APIs, LLMs can inspect interactive terminal state and send keystrokes just like a human developer. Agent Terminal is distributed as open-source software under the MIT license and is available as an npm package. Because it acts as an execution harness, it is model-agnostic and can be integrated with any LLM client or orchestration framework that connects via JavaScript or the Model Context Protocol.

Tags: agent harness, ai agent, cli, OpenSource, terminal

Visit Agent Terminal