[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1395":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":14,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":15,"starSnapshotCount":15,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},1395,"tui-use","onesuper\u002Ftui-use","onesuper","tui-use lets agents interact with programs that expect a human at the keyboard — REPLs, debuggers, TUI apps, and anything else bash can't reach.","",null,"TypeScript",240,17,1,0,11,3.77,"MIT License",false,"main",true,[],"2026-06-12 02:00:27","\u003Cdiv align=\"center\">\n\n# tui-use\n\n**Like BrowserUse, but for the terminal.**\n\ntui-use lets agents interact with programs that expect a human at the keyboard — REPLs, debuggers, TUI apps, and anything else bash can't reach.\n\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-blue.svg)](LICENSE) [![npm](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Ftui-use.svg)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Ftui-use)\n\n\u003C\u002Fdiv>\n\n## What is tui-use?\n\nAI agents can run shell commands and call APIs — but they can't interact with programs that expect a human at the keyboard. The moment a REPL waits for input, a debugger hits a breakpoint, or a TUI app renders a menu, agents are stuck.\n\ntui-use fills that gap. Spawn any program in a PTY, read its screen as plain text, send keystrokes — all from the command line. Built for the cases where bash isn't enough: live debugging sessions with gigabytes of in-memory state, interactive REPLs, full-screen TUI apps.\n\n### Use cases\n\n- **Scientific computing & large in-memory state** — When your variables are arrays with millions of elements that took an hour to compute, you can't dump them to a log file. Drop an agent into a live Python interpreter or pdb session to debug, inspect, and optimize without losing the running process.\n- **Debugger sessions** — Drive GDB, PDB, or any interactive debugger. Set breakpoints, step through code, inspect variables — all from an agent, without restarting the process.\n- **REPL sessions** — Run code in Python, Node, or any interactive interpreter, inspect the output, and keep going. No more one-shot scripts when you need an interactive session.\n- **TUI applications** — Navigate vim, lazygit, htop, fzf, and other full-screen programs that were never designed to be scripted.\n\nPerfect for **Claude Code**, **Cursor**, **Codex**, **Gemini CLI**, **OpenCode** and other AI coding agents.\n\n### Why not tmux?\n\ntmux is great for humans — but it was never designed for agents.\n\n`tmux send-keys` has no way to signal when a program is done responding. Agents are stuck guessing: `sleep 2` and hope, or poll `capture-pane` in a loop.\n\ntui-use observes every PTY render event directly. `wait` blocks until the screen stabilizes — no sleep, no polling. `wait --text \">>>\"` goes further: wait for a semantic signal, not just silence.\n\n## Features\n\n- **🖥️ Full VT Rendering** — PTY output is processed by a headless xterm emulator. ANSI escape sequences, cursor movement, and screen clearing all work correctly. The `screen` field is always clean plain text.\n- **⏱️ Smart Wait** — `wait` blocks until the screen has been stable for a configurable idle window (debounce), so agents never need to guess how long to sleep. Use `wait --text \u003Cpattern>` for semantic signals — wait until the program tells you it's ready, not just until it goes quiet.\n- **📸 Snapshot Model** — Interacting with a terminal program is just a loop: read what's on screen, decide what to type, repeat. tui-use makes that loop explicit — no async streams, no timing guesswork, no partial output to reassemble.\n- **🔍 Highlights** — Every snapshot includes a `highlights` field listing the inverse-video spans on screen — the standard way TUI programs indicate selected items. Agents can read which menu option, tab, or button is currently active without parsing text or guessing from cursor position.\n\n## Installation\n\n**From npm (recommended):**\n\n```bash\nnpm install -g tui-use\n```\n\n**From source:**\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fonesuper\u002Ftui-use.git\ncd tui-use\nnpm install\nnpm run build\nnpm link\n```\n\n## OpenAI Codex Plugin\n\n**Note:** You must install the CLI (see Installation section above) before using the plugin — the plugin only provides skill definitions, the CLI provides the actual PTY functionality.\n\nThis repo includes a Codex plugin bundle at `plugins\u002Ftui-use` and a local repo marketplace at `.agents\u002Fplugins\u002Fmarketplace.json`.\n\n### Install from this repo\n\n#### Step 1: Open this repository in Codex\n\nStart Codex with this repository as the working directory, or restart Codex if it was already open while you cloned or updated the repo.\n\n#### Step 2: Open the plugin directory\n\n```\ncodex\n\u002Fplugins\n```\n\n#### Step 3: Install the plugin\n\nChoose the `tui-use local plugins` marketplace, open `tui-use`, and select `Install plugin`.\n\n#### Step 4: Start a new thread\n\nAsk Codex to use `tui-use`, or explicitly invoke the installed plugin\u002Fskill from the prompt.\n\n## Claude Code Plugin\n\n**Note:** You must install the CLI (see Installation section above) before using the plugin — the plugin only provides skill definitions, the CLI provides the actual PTY functionality.\n\n### Install from self-hosted marketplace\n\n#### Step 1: Add the marketplace\n\n```\n\u002Fplugin marketplace add onesuper\u002Ftui-use\n```\n\n#### Step 2: Install the plugin\n\n```\n\u002Fplugin install tui-use@tui-use\n```\n\n#### Step 3: Reload plugins\n\n```\n\u002Freload-plugins\n```\n\n**More agents coming soon...**\n\n## How It Works\n\ntui-use sits directly on the PTY event stream — every byte the program outputs flows through a headless terminal emulator in real time.\n\nThis is what makes `wait` possible:\n\n```\nprogram outputs → PTY → xterm emulator → render event\n                                        → debounce timer resets on each change\n                                        → 100ms of silence → wait resolves ✓\n```\n\n`wait --text \u003Cpattern>` goes further — it resolves the moment a known prompt appears, giving agents a semantic readiness signal rather than just a silence window.\n\nBehind the scenes, a daemon process manages PTY sessions so they persist across CLI calls.\n\n## CLI Interface\n\n### Core Commands\n\n```\ntui-use start \u003Ccmd>                            # Start a program\ntui-use start --cwd \u003Cdir> \u003Ccmd>                # Start in specific directory\ntui-use start --cwd \u003Cdir> \"\u003Ccmd> -flags\"       # Quote the full command to pass flags (e.g. git rebase -i)\ntui-use start --label \u003Cname> \u003Ccmd>             # Start with label\ntui-use start --cols \u003Cn> --rows \u003Cn> \u003Ccmd>      # Custom terminal size (default: 120x30)\ntui-use use \u003Csession_id>                       # Switch to a session\ntui-use type \u003Ctext>                            # Type text\ntui-use type \"\u003Ctext>\\n\"                        # Type with Enter\ntui-use type \"\u003Ctext>\\t\"                        # Type with Tab\ntui-use paste \"\u003Ctext>\\n\u003Ctext>\\n\"               # Multi-line paste (each line + Enter)\ntui-use press \u003Ckey>                            # Press a key\ntui-use snapshot                               # Get current screen\ntui-use snapshot --format json                 # JSON output\ntui-use scrollup \u003Cn>                           # Scroll up to older content\ntui-use scrolldown \u003Cn>                         # Scroll down to newer content\ntui-use find \u003Cpattern>                         # Search in screen (regex)\ntui-use wait                                   # Wait for screen change (default timeout: 3000ms)\ntui-use wait \u003Cms>                              # Custom timeout, e.g. wait 5000\ntui-use wait --text \u003Cpattern>                  # Wait until screen contains pattern\ntui-use wait --debounce \u003Cms>                   # Idle time after last change before resolving (default: 100ms)\ntui-use wait --format json                     # JSON output\ntui-use list                                   # List all sessions\ntui-use use \u003Csession_id>                       # Switch to a session\ntui-use info                                   # Show session details\ntui-use rename \u003Clabel>                         # Rename session\ntui-use kill                                   # Kill current session\ntui-use daemon status                          # Check if daemon is running\ntui-use daemon stop                            # Stop the daemon\ntui-use daemon restart                         # Restart the daemon\n```\n\n## Limitations\n\n- **TUI color\u002Fstyle info is mostly lost** — `screen` contains plain text only; colors and most formatting are stripped. Selected items and active elements are captured in `highlights` via inverse-video detection. Window title and fullscreen mode are captured in `title` and `is_fullscreen`.\n\n## Troubleshooting\n\n### Automatic Rebuild Fails\n\nThe installer automatically detects your platform and uses a prebuilt binary when available. If no compatible prebuild exists, it will automatically rebuild from source (requires build tools).\n\n**Build tools** (only needed if automatic rebuild fails):\n\n- macOS: `xcode-select --install`\n- Linux: `sudo apt-get install build-essential python3 g++`\n- Windows: Prebuilt binaries available (no build tools needed)\n\n## Development\n\n```bash\ngit clone \u003Crepo_url>\ncd tui-use\nnpm install\nnpm run build\nnpm link\n\n# Try it\ntui-use start python3 examples\u002Fask.py\ntui-use wait\ntui-use type \"Alice\"\ntui-use press enter\ntui-use wait\ntui-use kill\n```\n\n### Integration Tests\n\nA Claude Code skill is included for running the full integration test suite.\n\nRun the following command in Claude Code:\n\n```\n\u002Ftui-use-integration-test\n```\n\nClaude will execute the test suite in order and then report `PASS \u002F FAIL` for each, with actual screen output on any failure.\n\n## License\n\n[MIT License](LICENSE)\n","tui-use 是一个让代理能够与期望人类键盘输入的程序进行交互的工具，如REPL、调试器和TUI应用程序等。该项目采用TypeScript编写，具备全VT渲染能力，确保ANSI转义序列、光标移动及屏幕清除等功能正确无误；智能等待机制允许在屏幕内容稳定后继续执行，避免了不必要的延时或轮询；快照模型简化了终端程序的交互流程，使读取屏幕信息、决定输入内容的过程更加直观可控。适用于科学计算中需要处理大量内存数据、调试会话、REPL环境以及原本不支持脚本化的全屏TUI应用等场景，特别适合Claude Code、Cursor等AI编码助手使用。",2,"2026-06-11 02:43:30","CREATED_QUERY"]