Agent skill

Tuistory Terminal Driver

by cline in cline/cline

Drives and tests terminal apps, especially the Cline CLI TUI, through named background PTY sessions that an agent can read, wait on, snapshot and type into.

Apache-2.0Auto-check passedTesting & QA

Install Tuistory Terminal Driver

skills CLI
$ npx skills add cline/cline --skill tuistory -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cline/cline tuistory --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cline/cline.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cline/skills/tuistory .claude/skills/tuistory && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tuistory
GitHub stars
70k
Token cost
~1.4k tokens
SKILL.md length
371 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
Apache-2.0

At a glance

Drives and tests terminal apps, especially the Cline CLI TUI, through named background PTY sessions that an agent can read, wait on, snapshot and type into.

  • Reproducing a bug in the interactive Cline TUI from a headless environment
  • SKILL.md covers Driving the Cline TUI headlessly, Background processes (instead…, Key rules and Writing e2e tests with the…
  • Calls bunx, curl and bun; reaches raw.githubusercontent.com; needs ANTHROPIC_API_KEY and CLINE_API_KEY
  • Running a long-lived dev server in the background without blocking a tool call

What it does

tuistory wraps a terminal command in a named background PTY session backed by a terminal emulator, so an agent's calls return instantly while a person can attach to the same session to watch or intervene, all without a real display. For the Cline CLI, the skill launches the TUI in an isolated temp home and data directory so it never touches real user config, using a dummy key to render the full chat UI or recorded cassettes to replay model turns, with a real provider credential needed only for live turns.

The core loop is observe, act, observe: wait reactively for expected text or a pattern instead of sleeping, then act, then take a fresh snapshot, since a dialog or error can render over the view an agent expects and a snapshot reflects what is actually visible rather than raw stream text. The same tool runs any long-lived background process, such as a dev server, with read returning new output since the last check. Command syntax puts options before the first separator and the child command after it, and every wait call needs an explicit timeout.

When your agent uses it

  • Reproducing a bug in the interactive Cline TUI from a headless environment
  • Running a long-lived dev server in the background without blocking a tool call
  • Writing or extending end-to-end tests for the TUI

Example prompts

  • “Launch the Cline TUI in a sandboxed session and wait for the chat prompt to appear.”
  • “Start the sidecar dev server in the background and tell me when it's ready.”
  • “Snapshot the current TUI screen so I can see what's actually rendered.”

Requirements

  • bun
  • tuistory as a devDependency of the CLI package

What it can do on your machine

Read from SKILL.md and the folder at commit fa840c7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • bunx
    • curl
    • bun

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • raw.githubusercontent.com

    Also links to:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • ANTHROPIC_API_KEY
    • CLINE_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Tuistory Terminal Driver loads about 1.4k tokens when it runs. Until then it costs about 177 tokens; SKILL.md has 371 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~177
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from cline/cline at commit fa840c7, republished under its Apache-2.0 licence (© cline). 371 words, ~1,409 tokens.

Download SKILL.mdSave it as .claude/skills/tuistory/SKILL.md (or your agent's skills folder).
name
tuistory
description
Drive and test terminal apps (especially the Cline CLI TUI in apps/cli) through tuistory — named background PTY sessions that agents can read, wait on, snapshot, screenshot, and type into. Like Playwright/tmux for terminals, with reactive waiting instead of blind `sleep`. Use this skill when you need to: - Manually test or reproduce bugs in the interactive Cline TUI (`bun run cli -i`) from a headless environment - Run a dev server or any long-lived/interactive process in the background without hanging your tool call - Write or extend Playwright-style e2e tests for the TUI (`bun run test:e2e:tuistory` in apps/cli) - Capture text snapshots or styled PNG screenshots of a TUI screen as evidence

tuistory

tuistory wraps any terminal command in a named background PTY session backed by a Ghostty terminal emulator. Agents interact with the session via short CLI calls that return instantly; humans can tuistory attach to the same session to watch or intervene. No real terminal or display (DISPLAY) is needed — it works fully headless, which makes it the preferred way for cloud agents to exercise the Cline TUI.

It is installed as a devDependency of @cline/cli, so the pinned binary resolves when you run from apps/cli:

bash
cd apps/cli
bunx tuistory --help   # source of truth for commands, options, and syntax

For full upstream docs: curl -s https://raw.githubusercontent.com/remorses/tuistory/refs/heads/main/README.md

Driving the Cline TUI headlessly

Launch the TUI in an isolated environment so you don't touch real user config (~/.cline):

bash
cd apps/cli
DATA_DIR=$(mktemp -d) && HOME_DIR=$(mktemp -d)
bunx tuistory -s cline --cols 120 --rows 36 \
  --env HOME=$HOME_DIR --env CLINE_DATA_DIR=$DATA_DIR \
  --env CLINE_DISABLE_CLINE_PASS_NOTICE=1 --env CLINE_TELEMETRY_DISABLED=1 \
  -- bun src/index.ts --provider anthropic -m claude-sonnet-4-6 -k test-key

The dummy -k test-key renders the full chat UI; only an actual agent turn would fail. For recorded LLM turns, use the VCR cassettes described in apps/cli/src/tests/helpers/env.ts (CLINE_VCR=playback + CLINE_VCR_CASSETTE). Real turns need a provider credential (e.g. ANTHROPIC_API_KEY, CLINE_API_KEY).

Then use an observe → act → observe loop:

bash
# Wait reactively for the chat view — never use sleep
bunx tuistory -s cline wait "What can I do for you?" --timeout 30000

# Act, then always observe the resulting screen state
bunx tuistory -s cline type "/settings"
bunx tuistory -s cline snapshot --trim
bunx tuistory -s cline press enter
bunx tuistory -s cline snapshot --trim

# Styled PNG of the current screen (prints the file path) — good for artifacts
bunx tuistory -s cline screenshot

# Full raw output stream (snapshot shows only the visible screen)
bunx tuistory read -s cline --all

# Tear down a session YOU started (double Ctrl+C exits the TUI cleanly)
bunx tuistory -s cline press ctrl c
bunx tuistory -s cline press ctrl c
bunx tuistory -s cline close

Background processes (instead of tmux)

bash
bunx tuistory -s my-server -- bun run dev:sidecar   # returns immediately
bunx tuistory -s my-server wait "/listening|ready/i" --timeout 30000
bunx tuistory read -s my-server                     # new output since last read
bunx tuistory -s my-server restart                  # after code changes

Key rules

  • Options before --, command after. Everything after the first -- is passed verbatim to the child: tuistory -s name --cols 150 -- bun src/index.ts is correct.
  • Snapshot after every action. TUIs are stateful; dialogs and errors can render over the view you expect. snapshot reflects what the user actually sees (occluded text does not count), unlike grepping the raw stream.
  • Wait, never sleep. wait "text" / wait "/regex/i" (case-sensitive by default) reacts as fast as the terminal updates; wait-idle when you don't know what to expect. Always pass --timeout.
  • Keys land instantly. Unlike sleep-based scripts, a queued second keypress can leak into the next view (e.g. one Enter both accepts a slash completion and submits it).
  • Never close a session you didn't start. Sessions are shared with humans (tuistory attach -s name) and other agents. Default to leaving sessions running; use read/wait/snapshot to inspect without disrupting.
  • --cols/--rows affect TUI layout (assertions are width-sensitive); --pixel-ratio 2 gives sharper screenshots.
Show full SKILL.md (52 more words)Show less

Writing e2e tests with the library API

apps/cli/src/cli.tuistory.e2e.test.ts (run: bun run test:e2e:tuistory) is the reference. The programmatic API runs in-process — no daemon:

ts
import { launchTerminal } from "tuistory";

const session = await launchTerminal({
	command: "bun",
	args: ["src/index.ts", "--provider", "anthropic", "-k", "test-key"],
	cwd: cliRoot,
	env: isolatedEnv, // see createCliEnv() in the reference test
	cols: 120,
	rows: 36,
	waitForDataTimeout: 30_000, // CLI cold start compiles a large TS graph
});

await session.waitForText("What can I do for you?", { timeout: 30_000 });
const screen = await session.text({ trimEnd: true }); // emulated screen state
await session.type("/settings");
await session.press("enter");
session.close(); // always close in test teardown

Screen-state assertions can check that stale UI is gone (expect(screen).not.toContain(...)), which stream-grepping harnesses cannot. session.text({ only: { bold: true } }) filters by style; session.read() returns the raw stream since the last read.

© cline, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .cline/skills/tuistory of cline/cline.

Open the folder on GitHubat commit fa840c7

Compare with similar skills

Tuistory Terminal Driver next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Tuistory Terminal Driver compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tuistory Terminal Driver this skillcline/cline70k—~1.4kAutomated safety check: PassApache-2.0
RStudio Selenium to Playwright Migrationrstudio/rstudio5.1k—~3.6kAutomated safety check: PassCustom licence
Verifymorapelker/hive470—~709Automated safety check: PassMIT
E2E Tests Studiomastra-ai/mastra29k—~4.3kAutomated safety check: PassCustom licence
Web Application Testinganthropics/skills180k51 repos~966Automated safety check: PassApache-2.0
Write and Verify Playwright Testsappsmithorg/appsmith41k—~2.9kAutomated safety check: NotesApache-2.0

Similar skills

  • Converts RStudio Python Selenium electron tests into TypeScript Playwright tests, checking each against a live RStudio before counting it as migrated.

    5.1k GitHub stars~3.6k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Verify

    morapelker/hive

    Build, launch, and drive this worktree's Hive app over CDP to verify a change end-to-end with playwright-cli

    470 GitHub stars~709 tokensUpdated 10 days ago
    Testing & QAAuto-check passed
  • E2E Tests Studio

    mastra-ai/mastra

    REQUIRED when modifying any file in packages/playground-ui or packages/playground.

    29k GitHub stars~4.3k tokensUpdated today
    Testing & QAAuto-check passed
  • Web Application Testing

    anthropics/skills

    Official

    Tests local web applications with Python Playwright scripts, checking frontend behavior, capturing screenshots and reading browser console logs.

    180k GitHub starsUsed in 51 repos~966 tokens
    Testing & QAAuto-check passed
  • Writes a Playwright end-to-end test from a prompt, runs it against a live Appsmith deployment and retries with fixes up to three times until it passes.

    41k GitHub stars~2.9k tokensUpdated yesterday
    Testing & QAAuto-check: notes
  • Official

    Drives a real browser from the command line with playwright-cli to open pages, interact, mock requests, save state and work with Playwright tests.

    5.4k GitHub starsUsed in 23 repos~2.8k tokens
    Testing & QAAuto-check passed

More from cline/cline

All 8 skills in this repo
  • Cline SDK Guide

    cline/cline

    Reference for building AI agents with the Cline SDK: the Agent runtime, ClineCore sessions, custom tools, plugins, events, providers, scheduling and multi-agent teams.

    70k GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Opens a GitHub pull request from your current branch with the gh CLI, after reviewing the commits and diff and gathering the details the PR needs.

    70k GitHub starsUsed in 1 repo~1.6k tokens
    Auto-check passed
  • Helps build terminal user interfaces with OpenTUI using its core imperative API or its React and Solid reconcilers, with references for layout, keyboard, animation and testing.

    70k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Guides publishing a one-time What's new dialog in the Cline desktop app: deciding if one is due, picking highlights from the changelog and editing one content file.

    70k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Covers preparing, tagging and publishing a Cline desktop app release on the stable, beta or nightly channel through the desktop-publish GitHub workflow.

    70k GitHub stars~4.5k tokensUpdated today
    Auto-check passed
  • Validates and publishes the standalone @cline/ui npm package through its own release workflow, separate from the Cline SDK runtime packages.

    70k GitHub stars~1.4k tokensUpdated today
    Auto-check passed

Questions about Tuistory Terminal Driver

What does Tuistory Terminal Driver do?

Drives and tests terminal apps, especially the Cline CLI TUI, through named background PTY sessions that an agent can read, wait on, snapshot and type into. tuistory wraps a terminal command in a named background PTY session backed by a terminal emulator, so an agent's calls return instantly while a person can attach to the same session to watch or intervene, all without a real display. For the Cline CLI, the skill launches the TUI in an isolated temp home and data directory so it never touches real user config, using a dummy key to render the full chat UI or recorded cassettes to replay model turns, with a real provider credential needed only for live turns.

When should I use Tuistory Terminal Driver?

Tuistory Terminal Driver fits situations like: reproducing a bug in the interactive Cline TUI from a headless environment; running a long-lived dev server in the background without blocking a tool call; writing or extending end-to-end tests for the TUI.

How do I install Tuistory Terminal Driver in Claude Code?

Run `npx skills add cline/cline --skill tuistory -a claude-code`. Or copy the skill folder (.cline/skills/tuistory in cline/cline) into .claude/skills/tuistory in your project. Claude Code loads it when a task matches its description.

How do I install Tuistory Terminal Driver in Codex?

Run `npx skills add cline/cline --skill tuistory -a codex`. Or copy the skill folder (.cline/skills/tuistory in cline/cline) into .agents/skills/tuistory in your project. Codex loads it when a task matches its description.

Can I use Tuistory Terminal Driver in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cline/cline --skill tuistory -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tuistory, .gemini/skills/tuistory, .github/skills/tuistory and .opencode/skills/tuistory in your project.

What does Tuistory Terminal Driver need to run?

Going by SKILL.md and its folder, Tuistory Terminal Driver needs the command-line tools its instructions call (bunx, curl and bun) and credentials named ANTHROPIC_API_KEY and CLINE_API_KEY. Our summary lists: bun; tuistory as a devDependency of the CLI package.

Does Tuistory Terminal Driver access the network?

SKILL.md names 2 domains. In commands or code: raw.githubusercontent.com; the agent is likely to contact it when it follows the instructions. As links in the text: github.com. This is read from the text; nothing was executed.

Is Tuistory Terminal Driver safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Tuistory Terminal Driver use?

Tuistory Terminal Driver is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tuistory Terminal Driver use?

About 1.4k tokens (SKILL.md is roughly 5.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Tuistory Terminal Driver?

Skills that share tags, products or a category with Tuistory Terminal Driver: RStudio Selenium to Playwright Migration (rstudio/rstudio, 5.1k stars), Verify (morapelker/hive, 470 stars), E2E Tests Studio (mastra-ai/mastra, 29k stars) and Web Application Testing (anthropics/skills, 180k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tuistory Terminal Driver?

cline (a GitHub organization) maintains it in cline/cline, which has 70,041 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 9, 2026.

Source: cline/cline on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.