Token导航 LogoToken导航TokenDH.com
效率操作浏览器clawhub未标认证来源可访问clear审计提醒

tui-use推使用

Agent Skill

tui-use 用于辅助前端页面、组件、样式和交互逻辑开发,适合在 OpenClaw 中需要维护前端项目、生成组件或检查界面实现时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,999

周安装

85

GitHub Stars

1

下载量

840
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:tui-use(推使用)
来源仓库:https://github.com/zbflcy/tui-use
安装命令:
openclaw skills install tui-use
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install tui-use

简介

tui-use 通过 CLI 工具实现对终端用户界面(TUI)程序的自动化操作。

  • 适用于 OpenClaw 中控制 tmux、htop 或其他 TUI 应用的交互流程。
  • 支持按键模拟、窗口切换与状态轮询等基础控制能力。
  • 安装命令为 openclaw skills install tui-use,需确认目标 TUI 程序已启动且可被识别。
  • 建议在沙箱环境中测试脚本逻辑以防误操作影响主机系统。

SKILL.md

name
tui-use
description
Operate TUI (terminal user interface) programs through the tui-agent CLI tool. Use this skill whenever the user asks to interact with, automate, control, or test any terminal-based program — including editors (vim, nano, emacs), system monitors (htop, top, btop), file managers (ranger, mc), database clients (mycli, pgcli), or any ncurses/TUI application. Also trigger when the user mentions tui-agent, screen capture of terminal programs, sending keystrokes to running programs, or automating terminal workflows. Even if the user just says "open vim and edit a file" or "check what's running in htop", this skill applies.

TUI-Use: Operating TUI Programs via tui-agent

This skill teaches you how to use the tui-agent CLI tool to start, interact with, and control TUI (Terminal User Interface) programs. Think of tui-agent as your eyes and hands for terminal programs — it lets you see what's on screen, type text, press keys, click with the mouse, and wait for things to happen.

Prerequisites

tui-agent must be installed and available in PATH, you can clone from tui-use github. Install from the sibling tui-agent/ directory:

pip install -e tui-agent/

Architecture at a Glance

You (via Bash tool)  -->  tui-agent CLI  -->  Daemon (auto-started)  -->  PTY  -->  TUI Program
                     <--  stdout/JSON    <--  Unix Socket             <--  pyte virtual screen

The daemon starts automatically on first use — no manual setup needed.

Core Workflow

Every TUI interaction follows this pattern:

  1. Start a session (launches the TUI program)
  2. Wait for the program to be ready
  3. Capture the screen to see what's displayed
  4. Interact (type text, send keys, click, scroll)
  5. Capture again to verify the result
  6. Stop the session when done

This capture-act-capture loop is the fundamental rhythm. Always capture the screen before and after important actions so you can verify what happened.

Command Reference

Session Management

Start a TUI program:

tui-agent start --name <session-name> [--cols 120] [--rows 40] -- <command> [args...]
  • --name: A unique identifier for this session (you'll use it in all subsequent commands)
  • --cols/--rows: Terminal dimensions (default: 80x24). Use larger values for complex UIs
  • Everything after -- is the command to run

List active sessions:

tui-agent list

Check session status:

tui-agent status --name <session-name>

Stop a session:

tui-agent stop --name <session-name>
# Or stop everything:
tui-agent stop --all

Seeing the Screen

Capture full screen:

tui-agent capture --name <session-name>

Capture with cursor position:

tui-agent capture --name <session-name> --cursor

This appends cursor coordinates to the output — helpful for knowing where you are in an editor.

Capture a specific region:

tui-agent capture --name <session-name> --top 0 --left 0 --height 5 --width 40

Save a snapshot for later comparison:

tui-agent capture --name <session-name> --save my_snapshot

Compare current screen to a saved snapshot:

tui-agent diff --name <session-name> --snapshot my_snapshot

Read scrollback history (content that scrolled off the top):

tui-agent scrollback --name <session-name> --lines 200

Typing and Keys

Type text:

tui-agent type --name <session-name> "hello world"

Type text and press Enter:

tui-agent type --name <session-name> --enter "ls -la"

Send special keys:

tui-agent key --name <session-name> <key1> [key2] [key3...]

Important: key vs type — The key command only accepts special key names listed below. For regular characters (letters, numbers, symbols) like vim's i, o, dd, :wq, always use type. Use key only for keys that aren't printable characters.

Supported key names (case-insensitive):

  • Navigation: up, down, left, right, home, end, pageup, pagedown
  • Editing: enter/return, tab, backspace, delete, insert, space, escape/esc
  • Function keys: f1 through f12
  • Ctrl combos: ctrl-a through ctrl-z

Paste text (uses bracketed paste mode, safe for editors):

tui-agent paste --name <session-name> "multi-line\
text content"

Use paste instead of type when inserting multi-line content into editors — bracketed paste mode prevents the editor from interpreting line breaks as commands.

Mouse Operations

Click at a position (0-indexed row and column):

tui-agent click --name <session-name> --row 5 --col 10

Scroll up/down:

tui-agent scroll-up --name <session-name> --row 12 --col 40 --lines 3
tui-agent scroll-down --name <session-name> --row 12 --col 40 --lines 3

Waiting for Conditions

Waiting is critical for reliable automation. TUI programs take time to render, and acting too fast leads to errors.

Wait for specific text to appear on screen:

tui-agent wait --name <session-name> --text "Ready" --timeout 10

Wait for text to disappear:

tui-agent wait --name <session-name> --text "Loading..." --absent --timeout 15

Wait for screen to stop changing (stable for N seconds):

tui-agent wait --name <session-name> --stable 2.0 --timeout 10

Use --stable when you don't know exactly what text to expect, but need the program to finish rendering.

Resizing the Terminal

tui-agent resize --name <session-name> --cols 160 --rows 50

Best Practices

Always wait before capturing

TUI programs need time to render. After starting a session or sending input, always wait before capturing:

tui-agent start --name ed -- vim file.py
tui-agent wait --name ed --stable 1.0         # Wait for vim to fully load
tui-agent capture --name ed --cursor           # Now safe to read the screen

Use meaningful session names

Name sessions after their purpose, not the program:

  • Good: editor, monitor, file-browser
  • Bad: s1, test, abc

Capture before and after actions

This is how you verify that your actions had the intended effect:

tui-agent capture --name ed --save before_edit
tui-agent type --name ed "i"                   # Enter insert mode (single char, use type)
tui-agent type --name ed "new line of code"
tui-agent key --name ed escape                 # Escape is a special key, use key
tui-agent capture --name ed                    # Check the result

Choose appropriate terminal size

  • For simple programs (bash, basic TUIs): 80x24 (default) is fine
  • For editors or complex UIs: use 120x40 or larger
  • For programs with wide tables: increase cols to 160+

Clean up sessions when done

Always stop sessions you no longer need:

tui-agent stop --name ed

Or stop all sessions if you're done:

tui-agent stop --all

Handle errors gracefully

If a wait command times out (exit code 1), capture the screen to understand what happened instead of blindly retrying:

tui-agent wait --name ed --text "Success" --timeout 5
# If this fails, capture to see the actual state:
tui-agent capture --name ed

Common Workflows

Editing a File with nano

# Start nano
tui-agent start --name ed --cols 120 --rows 40 -- nano myfile.py
tui-agent wait --name ed --stable 1.0
tui-agent capture --name ed

# Type some code
tui-agent type --name ed "print('hello world')"
tui-agent key --name ed enter
tui-agent type --name ed "print('goodbye')"
tui-agent capture --name ed

# Save (Ctrl-O, then Enter to confirm filename)
tui-agent key --name ed ctrl-o
tui-agent wait --name ed --stable 0.5
tui-agent key --name ed enter
tui-agent wait --name ed --text "Wrote"

# Exit (Ctrl-X)
tui-agent key --name ed ctrl-x
tui-agent stop --name ed

Editing a File with vim

Note: vim may not respond to input on some platforms (see Platform Notes). If vim works in your environment:

# Start vim (use -u NONE to avoid config issues)
tui-agent start --name ed --cols 120 --rows 40 -- vim -u NONE -N myfile.py
tui-agent wait --name ed --stable 1.0
tui-agent capture --name ed

# Navigate to a specific line (e.g., line 10)
tui-agent type --name ed ":10"
tui-agent key --name ed enter
tui-agent capture --name ed

# Enter insert mode and add text
tui-agent type --name ed "o"                    # Open new line below (normal char, use type)
tui-agent type --name ed "    print('hello')"
tui-agent key --name ed escape                  # Back to normal mode

# Save and quit
tui-agent type --name ed ":wq"
tui-agent key --name ed enter
tui-agent wait --name ed --stable 1.0

Monitoring System with htop

# Start htop
tui-agent start --name mon --cols 160 --rows 50 -- htop
tui-agent wait --name mon --stable 2.0
tui-agent capture --name mon

# Search for a process
tui-agent key --name mon f3                     # F3 is a special key, use key
tui-agent type --name mon "python"
tui-agent key --name mon enter
tui-agent capture --name mon

# Scroll through the list
tui-agent scroll-down --name mon --row 25 --col 80 --lines 10
tui-agent capture --name mon

# Quit
tui-agent type --name mon "q"                   # Regular char, use type
tui-agent stop --name mon

Running a Shell Command and Reading Output

# Start a bash session
tui-agent start --name sh -- bash --norc --noprofile
tui-agent wait --name sh --stable 1.0

# Run a command
tui-agent type --name sh --enter "ls -la /tmp"
tui-agent wait --name sh --stable 1.0
tui-agent capture --name sh

# If output is long, check scrollback
tui-agent scrollback --name sh --lines 100

# Exit
tui-agent type --name sh --enter "exit"
tui-agent stop --name sh

Interacting with a ncurses Application

# Start any ncurses app (example: midnight commander)
tui-agent start --name fm --cols 120 --rows 40 -- mc
tui-agent wait --name fm --stable 2.0
tui-agent capture --name fm

# Navigate using arrow keys
tui-agent key --name fm down down down
tui-agent capture --name fm

# Press enter to open a directory
tui-agent key --name fm enter
tui-agent wait --name fm --stable 1.0
tui-agent capture --name fm

# Use function keys
tui-agent key --name fm f5                      # Copy dialog
tui-agent capture --name fm

# Quit
tui-agent key --name fm f10
tui-agent stop --name fm

Platform Notes

vim on macOS: The system vim (/usr/bin/vim) may not respond to type input when launched directly via tui-agent start. This appears to be related to how macOS vim detects terminal capabilities. Workarounds:

  • Use nano or pico instead — they work reliably with tui-agent
  • Use vim -u NONE -N to disable vimrc and run in nocompatible mode
  • Install a different vim build (e.g., via Homebrew: brew install vim)
  • For simple file edits, consider using shell commands (sed, awk) instead of a TUI editor

Other programs: Most terminal programs (bash, htop, mc, ncurses apps) work well out of the box with tui-agent. If a program doesn't respond to input, try increasing the wait time or using --stable with a longer duration.

Troubleshooting

"session not found" error: The session may have been stopped or the program exited. Check with tui-agent list.

Screen capture is empty or garbled: The program may not have finished rendering. Add a longer --stable wait or increase --timeout.

Keys don't seem to work: Some programs expect specific key sequences. Capture the screen to verify the program's current state (e.g., is vim in insert mode or normal mode?).

Program exited unexpectedly: Use tui-agent status --name <session> to check the exit code. The program may have crashed or received a signal.

Daemon not running: The daemon starts automatically. If issues persist, check if the socket file exists at /tmp/tui-agent-*.sock. You can manually start the daemon or simply retry the command.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

82.23%
按下载量换算691

安全审计

VirusTotal

可疑

ClawScan

可疑

Static analysis

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills