tui-use for Openclaw

A powerful terminal automation skill that enables AI agents to operate, interact with, and verify TUI programs like vim, htop, and nano through the tui-agent CLI.

zbflcy
v1.0.0
Apr 16, 2026
1
667
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install tui-use

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install tui-use using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is tui-use?

The tui-use skill provides a robust bridge between AI agents and Terminal User Interface (TUI) applications. By leveraging the tui-agent CLI tool, it allows for sophisticated control over terminal-based programs that typically require human interaction, such as text editors (vim, nano, emacs), system monitors (htop, btop), and file managers (ranger, mc). This Openclaw Skills extension acts as the 'eyes and hands' of the agent, providing visual feedback through screen captures and the ability to send precise keystrokes, mouse clicks, and scroll commands.

Built on a daemon-based architecture, tui-use manages a virtual screen (pyte) and a PTY session to ensure that complex ncurses applications render correctly. This allows for reliable automation of terminal workflows, including multi-step editing tasks, system monitoring, and database client interactions, all while maintaining state across a session-based lifecycle.

tui-use Use Cases

  • Automating file edits in terminal-based editors like vim or nano when direct file system access isn't sufficient.
  • Real-time system monitoring and process management using tools like htop or top.
  • Interacting with ncurses-based database clients (mycli, pgcli) for administrative tasks.
  • Navigating and operating terminal file managers like midnight commander or ranger.
  • Automating legacy terminal workflows that require specific keyboard sequences and visual verification.

How tui-use Works

  1. Session Initialization: The agent starts a named session using tui-agent, which spawns the TUI program within a virtual terminal.
  2. State Synchronization: A 'wait' command is issued to ensure the program has finished rendering or reached a specific text state.
  3. Visual Capture: The agent captures the current screen state (including cursor coordinates) to understand the TUI's layout and context.
  4. Interaction Execution: Based on the visual data, the agent sends specific commands: 'type' for printable characters, 'key' for special function keys, or mouse actions.
  5. Verification Loop: After every action, a new capture or diff is performed to verify the program reacted as expected.
  6. Cleanup: Once the task is complete, the session is formally stopped to release terminal resources.

tui-use Setup

To use this Openclaw Skills capability, you must have the tui-agent CLI installed in your environment. Follow these steps:

  1. Clone the repository and navigate to the tui-agent directory.
  2. Install the package in editable mode:
pip install -e tui-agent/
  1. Verify the installation by listing active sessions:
tui-agent list

tui-use Data Schema & Taxonomy

The skill manages terminal data through structured sessions and snapshots. The following table describes how data is organized:

Component Description
Session Name A unique identifier (e.g., editor) used to route commands to specific PTY instances.
Screen Capture A text-based representation of the terminal grid, often including ANSI escape sequence processing.
Snapshots Named screen states saved to disk for visual regression testing and diff operations.
Scrollback A buffer containing historical terminal output that has moved off the active screen area.
Metadata Includes terminal dimensions (rows/cols), cursor position (row/col), and session exit codes.

tui-use Advanced Features

  • Bracketed Paste Mode: Use the paste command to safely insert multi-line blocks of code into editors without triggering unintended command shortcuts.
  • Stability Monitoring: Implement --stable waits that pause execution until the terminal screen stops changing for a specified duration.
  • Visual Regression: Use the diff command to compare the live terminal state against a saved snapshot for high-precision automation.
  • Regional Capturing: Focus on specific terminal coordinates using --top, --left, --height, and --width to reduce token usage and noise.
  • Daemonized PTY: Automatic background daemon management ensures terminal sessions persist even if the primary agent process fluctuates.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*