control-cli

Drive, inspect, and profile interactive CLI and TUI applications with local terminal harnesses.

3|Updated Apr 8, 2025
One-click install
npx skills add https://github.com/ZanzyTHEbar/dragonarchy --skill control-cli-zanzythebar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: control-cli
Source: https://github.com/ZanzyTHEbar/dragonarchy/tree/main/packages/opencode/.config/opencode/skills/control-cli
Command: npx skills add https://github.com/ZanzyTHEbar/dragonarchy --skill control-cli-zanzythebar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Testing interactive command-line and terminal UI applications manually is slow, non-repeatable, and hard to debug. This Skill provides a repeatable local harness to drive a CLI with deterministic input, capture transcripts, and profile startup, hangs, and memory growth without external services. ## Core Features & Use Cases - Deterministic CLI Driving: Launch a CLI in tmux or a PTY, send keystrokes one at a time, and wait for concrete screen patterns before each action. - Transcript Capture: Record before/after terminal output to reproduce bugs and verify fixes for prompts, interrupts, resize behavior, and layout. - Profiling Recipes: Measure startup regressions, capture CPU profiles and heap snapshots via the Node inspector, and diagnose hangs with stack samples. - Use Case: A Node-based TUI hangs after a specific keypress. Launch it in a tmux session with the inspector enabled, replay the keystroke sequence, capture the screen state, and collect a CPU profile to find the blocking function. ## Quick Start Ask the assistant to reproduce a CLI bug by driving the command in a tmux harness, capturing the screen before and after each input, and saving the transcript.

Frequently Asked Questions about control-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate testing of an interactive CLI application?

Launch the CLI in a detached tmux session, use capture-pane to read the screen, and send-keys to inject input one action at a time. Wait for a concrete screen pattern before each step, then save the transcript and kill the session cleanly.

How to profile a Node.js CLI for memory leaks?

Start the CLI with NODE_OPTIONS set to enable the inspector, take a heap snapshot, perform the suspect operation repeatedly, force garbage collection, and take a second snapshot. Comparing the snapshots reveals retained objects.

tmux vs PTY script for CLI test harnesses?

tmux is simpler for managed sessions with capture-pane and send-keys, while a Python PTY script gives deterministic waits when tmux is unavailable. Prefer a repo's own checked-in test or demo harness over either option.

Can I diagnose a CLI hang without a debugger attached?

Yes. Capture the current screen, active handles and resources, and a stack or CPU sample before interrupting the process. For Node CLIs, the inspector provides live evaluation and CPU profiles during the hang.

What are the limitations of tmux-based CLI testing?

tmux harnesses depend on screen-pattern matching, which can be brittle with rapid redraws or complex TUI layouts. For richer terminal control, use pty.fork() or a dedicated PTY library instead of basic capture-pane polling.