Your AI agent can write code, query databases, and deploy apps. But it can't use vim.
This isn't a joke. Interactive terminal programs — vim, psql, tmux, Python REPL, any tool that expects real-time keystrokes — are the **#1 blocker preventing fully autonomous agents** from working in production.
Here's why, and how to fix it.
The Problem
AI agents work beautifully with **REST APIs**. Send a request, get a JSON response. Done.
But agents hit a wall with **interactive terminal programs**. These tools don't respond to API calls. They expect a **pseudo-terminal (PTY)** — a live, bidirectional session where the program redraws the screen in real-time, responds to keystrokes, and maintains state across interactions.
When an agent tries to edit a config file in vim, query a database via psql, or debug a Python REPL session, it fails. **The agent can't "see" the terminal. It can't send keystrokes. It can't interpret the redrawn screen.**
The result? Agents work great in demos (where everything is API-based) but stall in production (where real work happens in terminals).

The Solution: PTY Access for Agents
The missing primitive is **PTY-based terminal control**. Give the agent direct access to a pseudo-terminal, and it can:
- Open vim to edit config files
- Run `psql -d mydb` and interact with live database sessions
- Attach to tmux sessions, monitor long-running processes
- Debug Python REPL sessions, Node.js interactive mode, Rails console
A new tool called **tui-use** just launched on Hacker News (36 points) to solve exactly this. It wraps the PTY interface and lets agents send keystrokes, read terminal output, and maintain interactive sessions.
This isn't a niche problem. **Production agents need PTY access for:**
- Database CLIs (psql, mysql, mongosh)
- Config editors (vim, nano, emacs)
- Session managers (tmux, screen)
- Legacy systems with no API (and there are many)
- Debugging and troubleshooting workflows
At Atobotz, we now **deploy production agents with PTY access pre-configured**. This isn't a demo — it's infrastructure that handles real workloads.
Benchmarks: What PTY Access Actually Enables
Here's what changes when you add PTY access to your agent stack:
- **Database operations:** Agents can execute psql queries, inspect schemas, run migrations — all in interactive sessions. No API wrapper needed.
- **Config management:** Edits to `/etc/nginx/nginx.conf`, Dockerfiles, Kubernetes manifests — done in vim, just like a human would.
- **Debugging:** Attach to tmux sessions, tail logs in real-time, interact with REPL sessions. The agent sees what the human sees.
- **Legacy systems:** Any CLI tool that expects interactive input becomes agent-accessible. No API development required.
- **Call latency:** ~5ms per PTY operation (via tui-use) vs. ~80ms for alternative browser automation (Chrome DevTools MCP).
**Caveat:** PTY access gives the agent the same power as a human at a terminal. That means it can also break things. **You need guardrails:** read-only modes, command allowlists, session timeouts, and audit logs. Don't give an untested agent full PTY access to production.
The Business Impact
What does this mean in practice?
- **Faster incident response:** Agents can attach to production tmux sessions, tail logs, run diagnostic commands — and escalate to humans with context, not just "something is wrong."
- **Autonomous database maintenance:** Schema inspections, index analysis, query optimization suggestions — all without building custom APIs.
- **Reduced API development overhead:** Stop building REST wrappers for every CLI tool. Let agents use the existing interface.
- **Lower debugging time:** Agents that can debug like humans (interactive REPL, live log inspection) resolve issues faster than agents restricted to API calls.
The cost equation: **One engineer building API wrappers for 20 CLI tools takes 3 months. One agent with PTY access handles all 20 on day one.**
Strong Opinion
If your AI agent can't interact with a terminal, **you're building a demo, not a production system.**
REST APIs are great for clean, well-designed services. But the messy reality of software — config files, database consoles, legacy CLIs, debugging sessions — happens in terminals.
Agents that can't use terminals are agents that can't do real work.
At Atobotz, we include PTY access by default in every agent deployment. If you're still building agents that stall on vim, let's fix that.