К основному содержанию
скилл CX Codex

terminal-control — скилл для Claude Code: установка и работа

Управляет интерактивными терминальными программами через termctrl: читает экран, отправляет ввод и ждёт нужный текст. Нужен для TUI, REPL и живых CLI-сессий.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add anomalyco/terminal-control --skill terminal-control -a claude-code
Открыть на GitHub

Что делает terminal-control

Скилл управляет терминальной программой в реальном PTY через termctrl. Он умеет запускать одноразовую команду с show или держать именованную сессию, читать видимый экран, отправлять текст и клавиши, ждать появления строки, менять размер окна и завершать процесс.

Для полноэкранных TUI следует проверять состояние через show, а не через logs, потому что журнал не равен содержимому alternate-screen интерфейса. Ввод отправляется атомами вроде text:help, enter и ctrl-c; после него скилл использует wait вместо пауз. Это повод проверять сценарии по экрану, а не по предположению о том, что интерфейс уже обновился.

Можно сохранять текстовые и PNG-артефакты, записывать .termctrl-таймлайн, ставить метки и экспортировать видео с планом монтажа. Для OpenTUI есть запуск с --host opentui. Записи, транскрипты ANSI, аргументы команд и введённый текст могут содержать чувствительные данные, поэтому их стоит сохранять только по необходимости.

Какие задачи решает

  • читать видимый экран полноэкранного TUI
  • отправлять команды и клавиши в живую CLI-сессию
  • ждать появления текста без искусственных пауз
  • проверять состояние именованной терминальной сессии
  • сохранять экранные артефакты и экспортировать запись

Примеры запросов агенту

  • Запусти my-terminal-app через termctrl, дождись Ready и покажи экран.
  • Создай сессию app, отправь text:help enter, дождись Commands и проверь результат.
  • Запиши работу my-terminal-app в artifacts/run.termctrl, поставь метки и экспортируй видео.

Как установить terminal-control

1Через Skills CLI (Vercel)

npx skills add anomalyco/terminal-control --skill terminal-control -a claude-code

2Вручную: положить файлы

~/.claude/skills/terminal-control/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/terminal-control/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Похожие

control-cli cursor Скилл собирает локальное тестовое окружение для проверки консольных утилит и TUI. Помогает находить утечки памяти, зависания и ошибки интерфейса без внешних сервисов. CX Codex +1 2 400установок opentui msmps Помогает агенту собирать терминальные интерфейсы на OpenTUI: от выбора Core, React или Solid до ввода с клавиатуры, анимаций и тестов. CX Codex +1 64 500установок ghostling-libghostty-terminal reason-machines Скилл показывает, как собрать минимальный терминальный эмулятор на C-библиотеке libghostty-vt с окнами и отрисовкой через Raylib. CX Codex +1 1 100установок terminal-ui pproenca Скилл с 42 правилами для терминальных интерфейсов на TypeScript: рендеринг, ввод с клавиатуры, промпты. Пригодится, когда пишете CLI на Ink или Clack. CX Codex +1 836установок tui-validate mikeyobrien Скилл снимает скриншот терминального интерфейса через freeze и оценивает его по критериям с помощью LLM. Пригодится после правок в TUI, чтобы поймать сломанную вёрстку. CX Codex +1 ★ 3 186звёзд репо terminal-inserts Liamrjohnston Скилл для Remotion-анимаций: рисует вставки с терминалом в сдержанном стиле, без неона и свечения. Сначала спрашивает формат и фон. CX Codex +1 938установок

Рядом в теме «Настройка агента: память, контекст, субагенты»

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →

Вопросы о terminal-control

Как установить terminal-control в Claude Code?

Выполните npx skills add anomalyco/terminal-control --skill terminal-control -a claude-code, затем повторите npx skills add anomalyco/terminal-control --skill terminal-control -a claude-code и откройте ~/.claude/skills/terminal-control/SKILL.md.

Что делает terminal-control?

Скилл даёт агенту инструкции для работы с termctrl: запуска сессий, чтения видимого терминального экрана, отправки ввода и ожидания текста. Он также описывает сохранение артефактов и запись таймлайна.

Как terminal-control работает с OpenTUI?

Для приложений OpenTUI, включая OpenCode, используется запуск с --host opentui. Экран можно читать обычным способом или через show app --format semantic.

Исходный текст

SKILL.md · MIT
---
name: terminal-control
description: Drive and verify terminal applications with the termctrl CLI in a real PTY - read visible screens, run named live sessions, send typed keyboard input, wait for text, save evidence, record timelines, and export edited videos. Use when an agent must operate or test a TUI, REPL, interactive CLI, shell process, or OpenTUI application.
---

# Terminal Control

Use `termctrl` to observe the actual visible terminal state and drive interaction deterministically.

## Start With The Smallest Workflow

Read a disposable terminal application's settled visible screen when no further interaction is required:

```bash
termctrl show -- my-terminal-app
```

Keep an application alive when interaction or repeated inspection is required:

```bash
termctrl start app -- my-terminal-app
termctrl wait app "Ready"
termctrl show app
termctrl send app text:help enter
termctrl wait app "Commands"
termctrl show app
termctrl stop app
```

Always stop named sessions after use unless the user explicitly wants the live process retained.

Keep an application visible and human-controlled in the current terminal pane while exposing the
same session controls to agents:

```bash
termctrl run -- /usr/bin/nvim
termctrl run editor -- nvim
```

The form without `NAME` uses the executable basename (`nvim`) and fails on a name collision; it
never chooses a suffixed name. Pass an explicit name when running multiple copies.

## Choose The Correct Observation

- Use `show` for current visible screen text. Prefer it for reasoning about full-screen TUIs.
- Use `logs` for readable retained output from normal-screen tools and log-like commands.
- Use `save --format ... --out ...` only when a persisted artifact is required.
- Use `video` only after explicitly recording a timeline with `--record`.

Do not treat logs as the visible state of an alternate-screen TUI.

Named-session reads return immediately by default. Add settling only when intentionally waiting for
quiet output. `wait` defaults to five seconds; set `--timeout` only when choosing another limit.

For fast demos, keep the session alive, omit `--pace-ms` unless slow typing is intentional, and
combine a known transition into one shell call:

```bash
termctrl send app text:help enter && termctrl wait app "Commands" && termctrl show app
```

The wait ends as soon as the text appears; its timeout is a maximum, not a fixed delay. Do not
insert sleeps between these commands. Inspect text during interaction, save PNGs only for visual
checks or requested evidence, and export video after driving the app. With MCP, prefer `interact`
with `waitFor` to combine keyboard input, readiness, and a screen read in one tool call.

## Drive Input Precisely

Send plain text with `text:<value>` and named keys as separate input atoms:

```bash
termctrl send app text:/connect enter
termctrl send app down enter
termctrl send app ctrl-c
printf '%s' 'multiline prompt' | termctrl send app --stdin
```

Use `wait` after sending input instead of sleeping or assuming that the interface has updated.

For mouse-enabled applications, use typed mouse commands with zero-based cell coordinates:

```bash
termctrl mouse app move 12 4
termctrl mouse app click 12 4
termctrl mouse app down 12 4
termctrl mouse app move 20 4
termctrl mouse app up 20 4
```

`move` hovers when no button is held; down/move/up drags. `--button right` or `middle`, `--shift`,
`--alt`, and `--ctrl` are optional. The app must enable mouse reporting; hover requires any-event
tracking. Coordinates outside the resized viewport fail. Do not work around disabled reporting
by injecting raw escape sequences. Restart older named sessions if the command requests it.

For recorded demos, opt into `video --pointer-overlay` to show mouse input with smooth travel,
subtle press compression, and fades. This defaults to 60 fps and does not delay actual input.
Use `--pointer-reduced-motion` to keep fades only. Trim/speed/hold edits stay on the same source
clock. Only typed mouse commands provide overlay evidence; raw bytes and forwarded human input
do not. `show`/`save` remain plain terminal evidence, separate from the video overlay.

## Operate OpenTUI Applications

Use the OpenTUI host handshake for applications such as OpenCode:

```bash
termctrl start app --host opentui --cols 112 --rows 34 -- opencode
termctrl wait app "/connect"
termctrl show app
termctrl show app --format semantic
```

Use `resize` when the application requires more visible area. Use `restart app` to reuse stored launch settings after a deliberate application restart.

## Retain Evidence Deliberately

Save only requested formats:

```bash
termctrl save app --format txt --format png --out artifacts/current
```

Record demos only when the user wants a retained timeline or video. Add markers while the session is running, inspect them after stopping, then export with an explicit edit plan:

```bash
termctrl start app --record artifacts/run.termctrl -- my-terminal-app
termctrl wait app "Ready"
termctrl mark app ready
termctrl send app text:demo enter
termctrl wait app "Done" --timeout 60000
termctrl mark app done
termctrl stop app
termctrl markers artifacts/run.termctrl
termctrl show --recording artifacts/run.termctrl --at-marker done
termctrl video artifacts/run.termctrl --edit artifacts/run-edit.json --footer --out artifacts/run.mp4
```

Use edit-plan `speed` values conservatively when terminal text should remain readable. Use `hold_ms` or `--tail-ms` when the final frame is the payoff. Pass `--footer` when a polished demo should show the clip caption, elapsed timecode, and `TERMINAL CONTROL` branding in a bottom footer; omit it for ordinary videos.

Treat `.termctrl` recordings, ANSI transcripts, screen artifacts, command arguments, and terminal input as potentially sensitive. Do not retain them unless needed, and do not expose their contents unnecessarily.

## Recover From Problems

- Run `termctrl status app` to inspect state and launch settings.
- Run `termctrl list` to discover running named sessions. Add `--state`, `--command`, or `--cwd` when narrowing discovery; use `--all` only when retained exited or unavailable entries are relevant.
- MCP agents can pass `state`, `command`, or `cwd` to `list_sessions` and use `get_session_status({ name })` for complete structured status without parsing CLI output.
- If a session socket path is too long, set `TERMCTRL_RUNTIME_DIR` to a short private directory under `/tmp` before starting sessions.
- If `termctrl` is unavailable, install Terminal Control with `cargo install terminal-control` or ask the user which installed binary to use.

© anomalyco · MIT · anomalyco/terminal-control

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой