tuistory
यह क्या करती है
यह स्किल टर्मिनल प्रोग्राम छिपे सेशन में चलाती है, ताकि एजेंट उनमें टाइप कर सके और जो दिखे उसे पढ़ सके। यह कमांड-लाइन ऐप और टेक्स्ट-आधारित इंटरफ़ेस टेस्ट करने वाले डेवलपर्स के लिए है।
कब इस्तेमाल करें
- ✓जब कोई इंटरैक्टिव टर्मिनल ऐप का टेस्ट करना चाहे।
- ✓जब टर्मिनल ऐप के बग को चरण-दर-चरण दोबारा पैदा करना हो।
- ✓जब हेडलेस वातावरण में टेक्स्ट-आधारित इंटरफ़ेस जाँचना हो।
Skill का लिंक
https://github.com/cline/cline/blob/main/.cline/skills/tuistory/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप हमारा कमांड-लाइन ऐप खोल सकते हैं, कुछ कमांड टाइप कर सकते हैं और बता सकते हैं कि स्क्रीन पर क्या दिखता है?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट प्रोग्राम को नाम वाले बैकग्राउंड सेशन में शुरू करता है और कीस्ट्रोक भेजता है। वह अपेक्षित टेक्स्ट दिखने का इंतज़ार करता है और स्क्रीन के स्नैपशॉट लेता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
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:
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):
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:
# 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)
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.tsis correct. - Snapshot after every action. TUIs are stateful; dialogs and errors can render over the view you expect.
snapshotreflects 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-idlewhen 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; useread/wait/snapshotto inspect without disrupting. --cols/--rowsaffect TUI layout (assertions are width-sensitive);--pixel-ratio 2gives sharper screenshots.
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:
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
अक्सर पूछे जाने वाले सवाल
क्या इसे असली स्क्रीन या डिस्प्ले चाहिए?
नहीं। स्किल कहती है कि यह असली टर्मिनल या डिस्प्ले के बिना पूरी तरह हेडलेस चलता है।
क्या कोई व्यक्ति सेशन देख सकता है?
हाँ। स्किल कहती है कि कोई व्यक्ति देखने या हस्तक्षेप करने के लिए उसी सेशन से जुड़ सकता है।
कमांड के विकल्प कहाँ मिलेंगे?
स्किल कहती है कि कमांड और सिंटैक्स के लिए टूल का अपना help आउटपुट ही मुख्य स्रोत है।
जानकारी
लेखक का मूल विवरण
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:tu
repo: cline/cline
लोकप्रियता
- GitHub स्टार
- 71k
- रैंकिंग में स्थान
- #3108
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
cline-sdk
71kयह आपके एजेंट को Cline SDK से AI एजेंट बनाना सिखाती है, जिसमें टूल, सेशन, इवेंट, मॉडल प्रदाता और मल्टी-एजेंट टीमें शामिल हैं।
create-pull-request
71kयह आपके एजेंट को साफ़ शीर्षक और विवरण के साथ GitHub pull request बनाने में मदद करती है, प्रोजेक्ट के टेम्पलेट का पालन करते हुए और पहले ब्रांच जाँचते हुए।
opentui
71kयह आपके एजेंट को OpenTUI से टर्मिनल यूज़र इंटरफ़ेस बनाने में मदद करती है, जिसमें लेआउट, कीबोर्ड हैंडलिंग, कंपोनेंट, एनिमेशन और टेस्टिंग शामिल हैं।
मिलती-जुलती skills
test-driven-development
311kयह आपके एजेंट को किसी भी फ़ीचर या सुधार से पहले पहले असफल होने वाला टेस्ट लिखना, उसे असफल होते देखना, फिर पास करने वाला सबसे छोटा कोड लिखना सिखाती है।
verification-before-completion
311kयह आपके एजेंट को किसी काम, सुधार या build के पूरा या पास होने का दावा करने से पहले असली जांच चलाकर उसका आउटपुट पढ़ना सिखाती है।
migrate-to-shoehorn
310kआपकी टेस्ट फ़ाइलों में जोखिम भरे type casts की जगह shoehorn लाइब्रेरी लगाती है, ताकि टेस्ट अधूरे डेटा से भी type checks पास कर सकें।