본문으로 건너뛰기
cccskills
무료GitHub에 공개

terminal-capture

Automate terminal interactions and capture screenshots before and after commands run. Define scenarios in TypeScript to review CLI appearance, document command flows, or record changing output such as progress bars, with optional animated GIFs.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Automates terminal UI screenshot testing for CLI commands. Applies when reviewing PRs that affect CLI output, testing slash commands (/about, /context, /auth, /export), generating visual documentation, or when 'terminal screenshot', 'CLI test', 'visual test', or 'terminal-capture' is mentioned.

연동 도구Playwright
설치 방법 보기

이럴 때 유용합니다

  • Review CLI appearance changes in a pull request
  • Capture slash command interactions
  • Create screenshots for usage documentation
  • Record progress output as screenshots or animated GIFs

포함된 파일(1)

  • SKILL.md7.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Terminal Capture — CLI Terminal Screenshot Automation

Drive terminal interactions and screenshots via TypeScript configuration, used for visual verification during PR reviews.

Prerequisites

Ensure the following dependencies are installed before running:

npm install       # Install project dependencies.
npx playwright install chromium   # Install Playwright browser (skip in CI: see note below)

CI / verify context: when QWEN_VERIFY_CHROMIUM=1 is set, the browser is already installed and PLAYWRIGHT_BROWSERS_PATH points at it. Do not run playwright install — it downloads ~170 MB and fails on system deps the agent user cannot install.

Architecture

node-pty (pseudo-terminal)
  → ANSI byte stream
  → xterm.js (Playwright headless)
  → Screenshot

Core files:

  • integration-tests/terminal-capture/terminal-capture.ts Low-level PTY, xterm.js, and Playwright engine.
  • integration-tests/terminal-capture/scenario-runner.ts Scenario executor for config, interactions, and screenshots.
  • integration-tests/terminal-capture/run.ts CLI entry point for batch scenario runs.
  • integration-tests/terminal-capture/scenarios/*.ts Scenario configuration files.

Quick Start

1. Write Scenario Configuration

Create a .ts file under integration-tests/terminal-capture/scenarios/:

import type { ScenarioConfig } from '../scenario-runner.js';

export default {
  name: '/about',
  spawn: ['node', 'dist/cli.js', '--yolo'],
  // cwd is relative to this config file's location.
  terminal: { title: 'qwen-code', cwd: '../../..' },
  flow: [
    { type: 'Hi, can you help me understand this codebase?' },
    { type: '/about' },
  ],
} satisfies ScenarioConfig;

2. Run

# Single scenario
npx tsx integration-tests/terminal-capture/run.ts \
  integration-tests/terminal-capture/scenarios/about.ts

# Batch (entire directory)
npx tsx integration-tests/terminal-capture/run.ts \
  integration-tests/terminal-capture/scenarios/

3. Output

Screenshots are saved to integration-tests/terminal-capture/scenarios/screenshots/{name}/:

FileDescription
01-01.pngStep 1 input state
01-02.pngStep 1 execution result
02-01.pngStep 2 input state
02-02.pngStep 2 execution result
full-flow.pngFinal state full-length screenshot

FlowStep API

Each flow step can contain the following fields:

type: string — Input Text

Automatic behavior: Input text → Screenshot (01) → Enter → stable output → Screenshot (02).

{
  type: 'Hello';
} // Plain text
{
  type: '/about';
} // Slash command (auto-completion handled automatically)

Special rule: If the next step is key, do not auto-press Enter (hand over control to the key sequence).

key: string | string[] — Send Key Press

Used for menu selection, Tab completion, and other interactions. Does not auto-press Enter or auto-screenshot.

Supported key names: ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Enter, Tab, Escape, Backspace, Space, Home, End, PageUp, PageDown, Delete

{
  key: 'ArrowDown';
} // Single key
{
  key: ['ArrowDown', 'ArrowDown', 'Enter'];
} // Multiple keys

Auto-screenshot is triggered after the key sequence ends (when the next step is not a key).

streaming — Capture During Execution

Capture multiple screenshots at intervals during long-running output (e.g., progress bars). Optionally generates an animated GIF.

{
  type: 'Run this command: bash progress.sh',
  streaming: {
    delayMs: 7000,    // Wait before first capture (skip initial waiting phase)
    intervalMs: 500,  // Interval between captures
    count: 20,        // Maximum number of captures
    gif: true,        // Generate animated GIF (default: true, requires ffmpeg)
  },
}
  • delayMs (optional): Milliseconds to wait after pressing Enter before starting captures. Useful for skipping model thinking/approval time.
  • Captures stop early if terminal output is unchanged for 3 consecutive intervals.
  • Duplicate frames (no output change) are automatically skipped.

GIF prerequisite: If the scenario uses streaming with GIF enabled (default), check if ffmpeg is installed before running. If not, ask the user whether they'd like to install it:

# Check
which ffmpeg

# Install (macOS)
brew install ffmpeg

If the user declines, the scenario still runs. GIF generation is skipped with a warning.

capture / captureFull — Explicit Screenshot

Use as a standalone step, or override automatic naming:

{
  capture: 'initial.png';
} // Screenshot current viewport only
{
  captureFull: 'all-output.png';
} // Screenshot full scrollback buffer

Scenario Examples

Basic: Input + Command

flow: [{ type: 'explain this project' }, { type: '/about' }];

Secondary Menu Selection (/auth)

flow: [
  { type: '/auth' },
  { key: 'ArrowDown' }, // Select API Key option
  { key: 'Enter' }, // Confirm
  { type: 'sk-xxx' }, // Input API key
];

Tab Completion Selection (/export)

flow: [
  { type: 'Tell me about yourself' },
  { type: '/export' }, // No auto-Enter (next step is key)
  { key: 'Tab' }, // Pop format selection
  { key: 'ArrowDown' }, // Select format
  { key: 'Enter' }, // Confirm → auto-screenshot
];

Array Batch (Multiple Scenarios in One File)

export default [
  { name: '/about', spawn: [...], flow: [...] },
  { name: '/context', spawn: [...], flow: [...] },
] satisfies ScenarioConfig[];

Integration with PR Review

This tool is commonly used for visual verification during PR reviews.

Troubleshooting

  • Playwright error browser not found Cause: browser not installed. Solution: npx playwright install chromium (local dev only — in CI verify runs, this means the pre-install step failed; report it, do not install).
  • Blank screenshot Cause: process starts slowly or build failed. Solution: check build success and the spawn command.
  • PTY-related errors Cause: node-pty native module not compiled. Solution: npm rebuild node-pty.
  • Unstable screenshot output Cause: terminal output not fully rendered. Solution: add scenario wait time.

Full ScenarioConfig Type

interface FlowStep {
  type?: string; // Input text
  key?: string | string[]; // Key press(es)
  capture?: string; // Viewport screenshot filename
  captureFull?: string; // Full scrollback screenshot filename
  streaming?: {
    delayMs?: number; // Delay before first capture (default: 0)
    intervalMs: number; // Interval between captures in ms
    count: number; // Maximum number of captures
    gif?: boolean; // Generate animated GIF (default: true)
  };
}

interface ScenarioConfig {
  name: string; // Scenario name (also used as screenshot subdirectory name)
  spawn: string[]; // Launch command ["node", "dist/cli.js", "--yolo"]
  flow: FlowStep[]; // Interaction steps
  terminal?: {
    cols?: number; // Number of columns, default 100
    rows?: number; // Number of rows, default 28
    theme?: string; // Theme: dracula|one-dark|github-dark|monokai|night-owl
    chrome?: boolean; // macOS window decorations, default true
    title?: string; // Window title, default "Terminal"
    fontSize?: number; // Font size
    cwd?: string; // Working directory (relative to config file)
  };
  outputDir?: string; // Screenshot output directory (relative to config file)
}

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Write clear briefs for subagents and conversation forks, agents that inherit conversation history. Specify purpose, known findings, scope, and expected output while respecting each agent's existing role and separating research requests from implementation.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Writing a focused research brief for a subagent
  • Specifying files and constraints for implementation
  • Defining scope for an agent inheriting conversation history
QwenLM/qwen-code2.9만2026년 10월 19일 업데이트

Compare a feature implemented in Qwen Code with Codex or Claude Code under the same scenario. Capture communication and terminal records, inspect tool definitions and outputs, and guide fixes toward matching observable behavior.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Checking a reproduced feature against its reference agent
  • Comparing tool definitions and required arguments
  • Investigating differences in terminal output
QwenLM/qwen-code2.9만2026년 10월 19일 업데이트

Reproduce a Codex or Claude Code feature in Qwen Code or another command-line agent. Capture requests, terminal output, and state changes, then use that evidence to implement focused behavior and add a verification path.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Reproduce an existing agent's slash command
  • Inspect request formats and tool definitions
  • Compare terminal output and saved state
QwenLM/qwen-code2.9만2026년 10월 19일 업데이트

autofix

무료

Review local uncommitted changes, verify findings, and repeat focused repairs until the review converges or a blocker remains. Also supports Qwen Code issue fixes and review responses within workflows run through GitHub Actions.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Review and repair local uncommitted changes
  • Develop a focused fix for a selected issue
  • Verify and address pull request feedback
QwenLM/qwen-code2.9만2026년 10월 19일 업데이트

batch

무료

Apply the same operation across multiple files using parallel worker agents. The skill finds matching files, divides the work, and reports successes, failures, and skipped files, with a preview option before edits.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Add license headers across source files
  • Convert JavaScript files to TypeScript
  • Fix the same lint issue in multiple files
QwenLM/qwen-code2.9만2026년 10월 19일 업데이트

batch-api

무료

Prepare shared instructions for translating, rewriting, or extracting information from many independent files, then submit a plan through the DashScope Batch API. Processing runs asynchronously at half the realtime list price and delivers new files later.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Translate many documents using shared terminology
  • Rewrite independent files into a consistent format
  • Extract structured data from a collection of files
QwenLM/qwen-code2.9만2026년 10월 19일 업데이트

QwenLM의 스킬 모두 보기

이 스킬의 문제 신고