Termscopeのロゴ

Termscope

組織
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.

概要

公開者zenobi-us
リポジトリdotfiles
スキル名termscope
スター
67
フォーク
6
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    zenobi-usがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Termscope」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/zenobi-us/dotfiles/tree/master/files/devtools/agent/bundles/developer/skills/devtools/termscope
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでTermscopeを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にTermscopeを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Termscopeは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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"}

よくある質問

AIスキル「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.

TypingMindでTermscopeを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Termscopeはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにTermscopeをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/zenobi-us/dotfiles/tree/master/files/devtools/agent/bundles/developer/skills/devtools/termscopeを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Termscopeを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Termscopeで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもTermscopeを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Termscope」は無料ですか?

はい。zenobi-usがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇