메뉴
HN
Hacker News 52일 전

AI 에이전트용 터미널 제어 도구 'tui-use' 공개

IMP
8/10
핵심 요약

웹 브라우저 제어 도구인 BrowserUse의 터미널 버전격인 오픈소스 도구입니다. 기존 AI 에이전트들이 접근하지 못했던 대화형 터미널 프로그램(vim, htop, DB 클라이언트 등)의 화면을 텍스트로 읽고 키보드 입력을 전달하여 완벽하게 제어할 수 있게 해줍니다. Claude Code, Cursor 등 주요 AI 코딩 에이전트와의 연동을 지원하여 AI의 자동화 범위를 획기적으로 확장한다는 점에서 실무적인 의의가 큽니다.

번역된 본문

tui-use는 BrowserUse와 유사하지만 터미널 환경을 위한 도구입니다. tui-use는 에이전트에게 bash가 닿을 수 없는 터미널의 영역, 즉 인간을 위해 만들어진 모든 REPL, 설치 프로그램, TUI 애플리케이션에 대한 접근 권한을 부여합니다.

tui-use란 무엇인가? AI 에이전트는 셸 명령을 실행하고, 파일을 읽고, API를 호출할 수 있습니다. 하지만 프로그램이 입력을 요구하는 순간 작동이 멈춥니다. 대부분의 CLI 도구가 에이전트가 아닌 인간을 위해 설계되었기 때문입니다. tui-use가 이 간극을 메웁니다. PTY(Pseudo-Terminal)에서 프로그램을 실행하고, 화면을 일반 텍스트로 관찰하고, 키 입력을 보냅니다. 모든 작업을 명령줄(Command line)에서 수행합니다. 인간이 터미널에서 조작할 수 있다면, 에이전트도 가능합니다.

사용 사례:

  • REPL 세션: Python, Node, psql, redis-cli에서 코드를 실행하고 출력을 검사하며 계속 진행할 수 있습니다. 대화형 세션이 필요할 때 더 이상 일회성 스크립트를 작성할 필요가 없습니다.
  • 대화형 스캐폴딩 도구: npm create, cargo new, create-react-app 및 작업 전 질문을 던지는 모든 CLI 마법사를 단계별로 진행할 수 있습니다.
  • 데이터베이스 CLI: 별도의 API나 ORM 레이어 없이 psql 또는 mysql에 연결하여 쿼리를 실행하고 스키마를 확인할 수 있습니다.
  • SSH + 원격 대화형 프로그램: 서버에 SSH로 접속하여 일회성 명령 실행에 그치지 않고 원격지의 대화형 프로그램을 계속해서 조작할 수 있습니다.
  • TUI 애플리케이션: 스크립트 작성이 불가능했던 vim, lazygit, htop, fzf 등의 전체 화면 프로그램을 탐색할 수 있습니다. Claude Code, Cursor, Codex, Gemini CLI, OpenCode 및 기타 AI 코딩 에이전트에 완벽하게 적합합니다.

주요 기능: 🖥️ 전체 VT 렌더링 — PTY 출력은 헤드리스 xterm 에뮬레이터에서 처리됩니다. ANSI 이스케이프 시퀀스, 커서 이동, 화면 지우기가 모두 올바르게 작동합니다. screen 필드는 항상 깔끔한 일반 텍스트입니다. 📸 스냅샷 모델 — 터미널 프로그램과의 상호작용은 다음과 같은 루프일 뿐입니다: 화면의 내용을 읽고, 입력할 내용을 결정하고, 반복합니다. tui-use는 이 루프를 명시적으로 만듭니다. 비동기 스트림이나 타이밍 추측, 부분 출력을 재조립할 필요가 없습니다. 🔍 하이라이트 — 모든 스냅샷에는 화면의 반전 비디오(inverse-video) 영역을 나열하는 highlights 필드가 포함되어 있습니다. 이는 TUI 프로그램이 선택된 항목을 나타내는 표준 방식입니다. 에이전트는 텍스트를 구문 분석하거나 커서 위치로부터 추측할 필요 없이 현재 활성화된 메뉴 옵션, 탭 또는 버튼을 읽을 수 있습니다. ⌨️ 풍부한 키 지원 — 텍스트, Enter, Ctrl+C, 방향키, F키 등을 전송할 수 있습니다. 전체 목록을 보려면 tui-use keys를 실행하십시오.

설치 방법 npm를 통한 설치 (권장): npm install -g tui-use

소스에서 빌드: git clone https://github.com/onesuper/tui-use.git cd tui-use npm install npm run build npm link

Claude Code 플러그인 안내: 플러그인을 사용하기 전에 반드시 CLI를 설치해야 합니다. 플러그인은 스킬 정의만 제공하며, 실제 PTY 기능은 CLI에서 제공합니다.

자체 호스팅 마켓플레이스에서 설치: 1단계: 마켓플레이스 추가 -> /plugin marketplace add onesuper/tui-use 2단계: 플러그인 설치 -> /plugin install tui-use@tui-use 3단계: 플러그인 새로고침 -> /reload-plugins 추가 에이전트 지원은 곧 제공될 예정입니다...

작동 원리 내부적으로 tui-use는 PTY 세션을 관리하는 데몬(Daemon)을 실행합니다. 사용자의 CLI가 HTTP를 통해 백그라운드 데몬과 통신하고, 데몬은 PTY를 통해 대상 프로그램(vim/htop 등)과 상호작용합니다. 이때 데몬 내부의 @xterm/headless 에뮬레이터가 렌더링을 담당하여 대상 프로그램의 출력을 깔끔한 텍스트 화면 내용과 메타데이터(하이라이트, 창 제목, 전체 화면 여부)로 구성된 하나의 완성된 스냅샷으로 반환합니다. 즉, 에이전트는 재조립이 필요한 원시 바이트 스트림이 아닌, 터미널의 완성된 '폴라로이드 사진'을 받게 됩니다.

CLI 인터페이스 핵심 명령어 tui-use start # 프로그램 시작 tui-use start --cwd

# 특정 디렉토리에서 시작 tui-use start --cwd " -flags" # 플래그 전달을 위해 전체 명령어를 따옴표로 묶기 (예: git rebase -i) tui-use start --label # 레이블을 지정하여 시작 tui-use start --cols --rows # 커스텀 터미널 크기 지정 (기본값: 120x30) tui-use use # (후략)

원문 보기
원문 보기 (영어)
tui-use Like BrowserUse, but for the terminal. tui-use gives agents access to the parts of the terminal that bash can't reach — every REPL, installer, and TUI app built for humans. What is tui-use? AI agents can run shell commands, read files, and call APIs. But they stall the moment a program asks for input — because most CLI tools were built for humans, not agents. tui-use fills that gap. Spawn any program in a PTY, observe its screen as plain text, send keystrokes — all from the command line. If a human can operate it in a terminal, an agent can too. Use cases: REPL sessions — Run code in Python, Node, psql, or redis-cli, inspect the output, and keep going. No more one-shot scripts when you need an interactive session. Interactive scaffolding tools — Step through npm create , cargo new , create-react-app , and any other CLI wizard that asks questions before doing anything. Database CLIs — Connect to psql or mysql, run queries, check schemas, without needing a separate API or ORM layer. SSH + remote interactive programs — SSH into a server and keep operating interactive programs on the other end, not just run one-off commands. TUI applications — Navigate vim, lazygit, htop, fzf, and other full-screen programs that were never designed to be scripted. Perfect for Claude Code , Cursor , Codex , Gemini CLI , OpenCode and other AI coding agents. Features 🖥️ 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. 📸 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. 🔍 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. ⌨️ Rich Key Support — Send text, Enter, Ctrl+C, arrow keys, F-keys, and more. Run tui-use keys to see the full list. Installation From npm (recommended): npm install -g tui-use From source: git clone https://github.com/onesuper/tui-use.git cd tui-use npm install npm run build npm link Claude Code Plugin 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. Install from self-hosted marketplace Step 1: Add the marketplace /plugin marketplace add onesuper/tui-use Step 2: Install the plugin /plugin install tui-use@tui-use Step 3: Reload plugins /reload-plugins More agents coming soon... How It Works Behind the scenes, tui-use runs a daemon that manages PTY sessions: ┌─────────────┐ HTTP ┌─────────────┐ PTY ┌─────────────┐ │ tui-use │ ◄───────────► │ Daemon │ ◄─────────► │ Program │ │ (CLI) │ │ (background)│ │ (vim/htop) │ └─────────────┘ └─────────────┘ └─────────────┘ │ ▼ ┌─────────────┐ │ @xterm/ │ │ headless │ │ (xterm emu) │ └─────────────┘ The rendering pipeline: Target program outputs ANSI escape sequences (colors, cursor moves, screen clears) @xterm/headless renders them into a complete terminal screen state snapshot returns clean plain text screen content, plus metadata like highlights (inverse-video regions), title (window title), and is_fullscreen (alternate buffer detection) Agents get the a "polaroid" snapshot of the terminal — not a raw byte stream you need to reassemble. CLI Interface Core Commands tui-use start <cmd> # Start a program tui-use start --cwd <dir> <cmd> # Start in specific directory tui-use start --cwd <dir> "<cmd> -flags" # Quote the full command to pass flags (e.g. git rebase -i) tui-use start --label <name> <cmd> # Start with label tui-use start --cols <n> --rows <n> <cmd> # Custom terminal size (default: 120x30) tui-use use <session_id> # Switch to a session tui-use type <text> # Type text tui-use type "<text>\n" # Type with Enter tui-use type "<text>\t" # Type with Tab tui-use paste "<text>\n<text>\n" # Multi-line paste (each line + Enter) tui-use press <key> # Press a key tui-use snapshot # Get current screen tui-use snapshot --format json # JSON output tui-use scrollup <n> # Scroll up to older content tui-use scrolldown <n> # Scroll down to newer content tui-use find <pattern> # Search in screen (regex) tui-use wait # Wait for screen change tui-use wait <ms> # Custom timeout (default: 3000ms) tui-use wait --text <pattern> # Wait until screen contains pattern tui-use wait --format json # JSON output tui-use list # List all sessions tui-use use <session_id> # Switch to a session tui-use info # Show session details tui-use rename <label> # Rename session tui-use kill # Kill current session Daemon Commands tui-use daemon status # Check if daemon is running tui-use daemon stop # Stop the daemon tui-use daemon restart # Restart the daemon Limitations TUI color/style 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 . Windows not supported — requires Unix PTY (macOS/Linux). Windows support via ConPTY is planned. Troubleshooting Automatic Rebuild Fails The 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). Build tools (only needed if automatic rebuild fails): macOS: xcode-select --install Linux: sudo apt-get install build-essential python3 g++ Windows: Not yet supported Development git clone < repo_url > cd tui-use npm install npm run build npm link # Try it tui-use start python3 examples/ask.py tui-use wait tui-use type " Alice " tui-use press enter tui-use wait tui-use kill Integration Tests A Claude Code skill is included for running the full integration test suite. Run the following command in Claude Code: /tui-use-integration-test Claude will execute the test suite in order and then report PASS / FAIL for each, with actual screen output on any failure. License MIT License