Termscope logo

Termscope

Organization
zenobi-us
termscope

Drive and inspect terminal applications programmatically. Use for TUI testing, visual regression, debugging rendering issues, and automating interactive CLI tools. Provides snapshot capture, keyboard/text input, text search, and a JSON-lines session protocol.

Overview

Publisherzenobi-us
Repositorydotfiles
Skill nametermscope
Stars
67
Forks
6
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by zenobi-us on GitHub. Read the source before you install it.

Installation

Install the Termscope AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zenobi-us/dotfiles.git /tmp/dotfiles
mkdir -p .claude/skills
cp -r /tmp/dotfiles/files/devtools/agent/bundles/developer/skills/devtools/termscope .claude/skills/termscope
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Termscope in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Termscope on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Termscope is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

termscope

Drive and inspect terminal applications — Playwright for the terminal.

Prerequisites

termscope must be installed and on $PATH. Verify:

termscope --version

If not installed:

curl -fsSL https://raw.githubusercontent.com/mwunsch/termscope/main/install.sh | sh

When to use termscope

  • Inspect the visual state of a TUI application
  • Debug rendering issues by capturing terminal snapshots
  • Run visual regression tests in CI
  • Automate interactive terminal applications (fill prompts, navigate menus)
  • Verify that a CLI tool produces expected output with styling

One-shot mode

Snapshot

Capture the terminal state of a command:

bash
# Plain text (default) — best for reading in context
termscope snapshot -- htop

# JSON — structured data for programmatic processing
termscope snapshot --format json -- my-app

# With custom terminal size
termscope snapshot --cols 120 --rows 40 -- btop

# Write to file
termscope snapshot --format svg -o screenshot.svg -- my-tui

Exec (linear sequence)

Chain actions left-to-right:

bash
# Wait for prompt, type, press enter, snapshot
termscope exec \
  --wait-for-text "Search:" \
  --type "hello" \
  --press RET \
  --wait-idle 200 \
  --snapshot \
  -- my-tui

# Assert text is present (exit 0/1 for CI)
termscope exec --expect "Error" -- my-app

Exec flags are processed in order. Each flag is a step.

Session mode (agent driving)

Start a persistent session:

bash
termscope session -- vim test.txt

Send JSON-line requests on stdin, receive JSON-line responses on stdout. Stderr is for diagnostics only — never protocol data.

Protocol

Request format: {"id": N, "method": "name", "params": {...}}

Response format: {"id": N, "result": {...}} or {"id": N, "error": {"code": "...", "message": "..."}}

Methods

snapshot — Capture terminal state

json
{"id":1,"method":"snapshot"}
{"id":1,"method":"snapshot","params":{"format":"json"}}

type — Send text characters

json
{"id":2,"method":"type","params":{"text":"hello world"}}

press — Send a key using Emacs notation

json
{"id":3,"method":"press","params":{"key":"RET"}}
{"id":3,"method":"press","params":{"key":"C-c"}}
{"id":3,"method":"press","params":{"key":"C-x C-s"}}

wait_for_text — Block until text appears

json
{"id":4,"method":"wait_for_text","params":{"pattern":"Ready","timeout":5000}}

wait_for_idle — Wait for output to settle

json
{"id":5,"method":"wait_for_idle","params":{"duration":200}}

query — Get terminal metadata

json
{"id":6,"method":"query"}
// Returns: cols, rows, cursor, cursor_style, cursor_visible, title, alt_screen

resize — Change terminal dimensions

json
{"id":7,"method":"resize","params":{"cols":120,"rows":40}}

close — End the session

json
{"id":8,"method":"close"}
// Returns: exit_code

Session lifecycle

  • Session starts when termscope session -- <cmd> launches
  • Session ends when: (a) agent sends close, (b) child exits, or (c) termscope receives SIGTERM
  • If child exits: {"event":"child_exit","exit_code":N} then EOF
  • Errors do NOT end the session — the agent decides what to do

Key notation

Emacs-style key notation:

NotationMeaning
C-cCtrl+C
C-xCtrl+X
M-xAlt+X
C-M-aCtrl+Alt+A
RETEnter
TABTab
ESCEscape
SPCSpace
DELBackspace
<delete>Forward delete
<up> <down> <left> <right>Arrow keys
<home> <end>Home/End
<prior> <next>Page Up/Down
<f1><f12>Function keys

Key sequences (space-separated): C-x C-s means Ctrl+X then Ctrl+S.

Output formats

  • text (default) — Numbered lines with header. Best for LLM token efficiency.
  • spans — Text + per-line style runs. For understanding UI structure.
  • json — Structured JSON with metadata and lines array.
  • html — Styled <pre> with <span> elements.
  • svg — Visual screenshot as SVG.

Common patterns

Navigate a list

json
{"id":1,"method":"wait_for_text","params":{"pattern":"Select:"}}
{"id":2,"method":"press","params":{"key":"<down>"}}
{"id":3,"method":"press","params":{"key":"<down>"}}
{"id":4,"method":"press","params":{"key":"RET"}}

Fill a text field

json
{"id":1,"method":"wait_for_text","params":{"pattern":"Name:"}}
{"id":2,"method":"type","params":{"text":"John Doe"}}
{"id":3,"method":"press","params":{"key":"TAB"}}

Wait for a prompt then respond

json
{"id":1,"method":"wait_for_text","params":{"pattern":"Continue? [y/n]"}}
{"id":2,"method":"type","params":{"text":"y"}}
{"id":3,"method":"press","params":{"key":"RET"}}

Check for errors

json
{"id":1,"method":"snapshot","params":{"format":"json"}}
// Check if any line contains "Error" or "fatal"

Test at multiple sizes

json
{"id":1,"method":"resize","params":{"cols":80,"rows":24}}
{"id":2,"method":"wait_for_idle","params":{"duration":200}}
{"id":3,"method":"snapshot"}
{"id":4,"method":"resize","params":{"cols":40,"rows":12}}
{"id":5,"method":"wait_for_idle","params":{"duration":200}}
{"id":6,"method":"snapshot"}

Frequently asked questions

What does the Termscope AI skill do?

Drive and inspect terminal applications programmatically. Use for TUI testing, visual regression, debugging rendering issues, and automating interactive CLI tools. Provides snapshot capture, keyboard/text input, text search, and a JSON-lines session protocol.

Why use Termscope on TypingMind?

Because you install it once and use it with any model. Termscope is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Termscope in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/zenobi-us/dotfiles/tree/master/files/devtools/agent/bundles/developer/skills/devtools/termscope. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Termscope?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Termscope?

As many as you like. As long as a model supports skills, you can use Termscope with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Termscope AI skill free?

Yes. It is published on GitHub by zenobi-us under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇