# hty > **Puppeteer for the terminal.** Let AI agents drive any interactive CLI — editors, REPLs, auth flows, scaffolding wizards — by reading the screen and sending keys. ## Get Started - [Introduction](https://hty.sh/get-started/introduction.md): hty gives AI agents, scripts, and CI pipelines a way to use interactive terminal programs — without a human at the keyboard. You start a na… - [Quick Start](https://hty.sh/get-started/quickstart.md): Install hty and walk through a complete example: driving `git add -p` to stage specific hunks. This is the same workflow an AI agent uses —… - [Installation](https://hty.sh/get-started/installation.md): You can install hty in three ways: a one-line shell script that auto-detects your platform, a Homebrew tap, or building from source with Zi… ## Core Concepts - [Sessions](https://hty.sh/concepts/sessions.md): An hty session is a pseudoterminal (PTY) process managed by the hty background server. Because the server persists across individual CLI in… - [Background Server](https://hty.sh/concepts/server.md): hty separates the CLI you type into from the process that actually runs your terminal sessions. The background server is the component that… - [Session Logs](https://hty.sh/concepts/session-logs.md): Every session hty manages is automatically recorded to a log file on disk. Recording starts the moment the process spawns and ends when the… ## Commands - [list](https://hty.sh/commands/list.md): Show all sessions the server knows about, including sessions that are still running and those that have exited or been killed. Also scans l… - [run](https://hty.sh/commands/run.md): Start a program in a new detached PTY session. The session runs in the background — use `watch`, `snapshot`, or `attach` to interact with i… - [snapshot](https://hty.sh/commands/snapshot.md): Capture the current state of a session’s terminal screen. - [send](https://hty.sh/commands/send.md): Deliver input to a running session’s PTY, exactly as if a user had typed it. You can send plain text, symbolic key names, raw bytes, or a s… - [wait](https://hty.sh/commands/wait.md): Block your script until a session reaches a specific condition — text appears on screen, a regex matches, the display stops changing, or th… - [kill](https://hty.sh/commands/kill.md): Send SIGKILL to a session’s process. The process is terminated immediately. The session record stays in the server — `hty list` continues t… - [delete](https://hty.sh/commands/delete.md): Remove the session record from the server and delete the log file from disk. If the session is still running, hty kills it first. - [logs](https://hty.sh/commands/logs.md): Stream the event log for a session. Works on running and exited sessions. - [replay](https://hty.sh/commands/replay.md): Re-feed recorded output events through a fresh in-memory VT engine and render the result in your terminal. You see the session play back ex… - [watch](https://hty.sh/commands/watch.md): Connect to a running session and render its terminal screen in real time inside your terminal. Strictly read-only — you cannot send input. - [attach](https://hty.sh/commands/attach.md): Bidirectional live connection to a running session: renders the session’s screen live **and** forwards every keystroke you type into the se… - [keys](https://hty.sh/commands/keys.md): `hty send --key` accepts symbolic key names instead of raw bytes, making scripts easier to read and write. Run `hty keys` at any time to pr… ## Guides - [AI Agents](https://hty.sh/guides/ai-agents.md): AI agents can use hty to interact with any terminal program the same way a human would — by reading the rendered screen and typing. Because… - [CI Automation](https://hty.sh/guides/ci-automation.md): Some programs require interactive input even in CI — they prompt for confirmations, display menus, or wait for keystrokes that have no non-… - [Remote Observation](https://hty.sh/guides/remote-observation.md): hty’s `$HTY_SOCKET` environment variable lets you point any hty client at a remote server’s Unix socket forwarded over SSH. With a single S… - [Session Replay](https://hty.sh/guides/session-replay.md): hty automatically records every session from the moment it starts. You can replay a session later like a video, feeding its recorded output… ## Reference - [Exit Codes](https://hty.sh/reference/exit-codes.md): hty uses structured exit codes so shell scripts can react to specific error conditions without parsing JSON output. Check `$?` immediately… - [Environment Variables](https://hty.sh/reference/environment-variables.md): hty reads several environment variables to control its behavior without requiring config files. You can set them per-command inline or expo… - [Socket Protocol](https://hty.sh/reference/socket-protocol.md): The hty CLI is a thin client over a Unix domain socket protocol. Every command you run — `hty snapshot`, `hty send`, `hty wait` — serialize… ## Optional - [Full documentation](https://hty.sh/llms-full.txt): every page above concatenated into a single file.