cli/skills/tuistory/SKILL.md
Control and monitor terminal applications. Supports running TUI processes in background. TMUX replacement for agents. Can control fully interactive TUI apps like claude or opencode. Use tuistory and read the skill when you need to: - Run background processes for agents like dev servers. prefer it over `tmux` because it waits for real output instead of guessing with `sleep` - Control interactive CLIs and TUIs by typing, pressing keys, clicking, waiting, and taking snapshots - Write Playwright-style tests for terminal apps with `vitest` or `bun:test` It has **2 modes**: - **CLI** (`tuistory`) for persistent background sessions and terminal automation. **Run `tuistory --help` first.** - **JS/TS API** (`launchTerminal`) for writing tests (like playwright for TUIs) and programmatic control in scripts.
npx skillsauth add remorses/kimaki tuistoryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Playwright for terminal apps. Use it to run background processes for agents, drive interactive TUIs, and write Playwright-style tests for CLIs and TUIs.
Prefer tuistory over tmux for agent automation. It is better because it reacts to terminal output with wait and wait-idle instead of wasting time on blind sleep calls. That makes scripts both faster and more reliable.
Every time you use tuistory, you MUST run these two commands first. NEVER pipe to head/tail, read the full output:
# CLI help — source of truth for commands, options, and syntax
tuistory --help
# Full README with API docs, examples, and testing patterns
curl -s https://raw.githubusercontent.com/remorses/tuistory/refs/heads/main/README.md
snapshot --trim after every CLI action to see the current terminal statewaitForText for async operations/ready/i when casing may vary.trimEnd: true in session.text() to avoid trailing whitespace in snapshots--cols and --rows to control terminal size — affects TUI layout--pixel-ratio 2 for sharp screenshot imagesUse an observe → act → observe loop, like Playwright but for terminals.
# start a server in the background
tuistory launch "bun run dev" -s dev
# wait for actual output instead of sleep 5
# use regex so this still matches Ready, READY, etc.
tuistory -s dev wait "/ready/i" --timeout 30000
# read everything the process printed
tuistory read -s dev
# later, read only the new output
tuistory read -s dev
Why this is better than tmux:
sleep# observe
tuistory -s app snapshot --trim
# act
tuistory -s app press enter
# observe again
tuistory -s app snapshot --trim
const session = await launchTerminal({ command: 'my-cli', cols: 120, rows: 36 })
const initial = await session.text({ trimEnd: true })
expect(initial).toMatchInlineSnapshot()
await session.type('hello')
await session.press('enter')
const output = await session.waitForText('hello', { timeout: 5000 })
expect(output).toMatchInlineSnapshot()
session.close()
development
Opinionated TypeScript npm package template for ESM packages. Enforces src→dist builds with tsc, strict TypeScript defaults, explicit exports, and publish-safe package metadata. Use this when creating or updating any npm package in this repo.
documentation
Best practices for creating a SKILL.md file. Covers file structure, frontmatter, writing style, and where to place skills in a repository. Use when the user wants to create a new skill, update an existing skill, write a SKILL.md, or asks how skills work.
documentation
Best practices for creating a SKILL.md file. Covers file structure, frontmatter, writing style, and where to place skills in a repository. Use when the user wants to create a new skill, update an existing skill, write a SKILL.md, or asks how skills work.
tools
Centralized state management pattern using Zustand vanilla stores. One immutable state atom, functional transitions via setState(), and a single subscribe() for all reactive side effects. Based on Rich Hickey's "Simple Made Easy" principles: prefer values over mutable state, derive instead of cache, centralize transitions, and push side effects to the edges. Resource co-location in the same store is also valid when lifecycle management is safer that way. Also covers state encapsulation: keeping state local to its owner (closures, plugins, factory functions) so it doesn't leak across the app, reducing the blast radius of mutations. Also covers event sourcing: keeping a bounded event buffer and deriving state with pure functions instead of mutable flags, making event handlers easy to test and reason about. Use this skill when building any stateful TypeScript application (servers, extensions, CLIs, relays) to keep state simple, testable, and easy to reason about. ALWAYS read this skill when a project uses zustand/vanilla for state management outside of React.