feat(terminal-capture): add streaming capture with GIF generation#2116
Merged
tanzhenxin merged 3 commits intomainfrom Mar 5, 2026
Merged
feat(terminal-capture): add streaming capture with GIF generation#2116tanzhenxin merged 3 commits intomainfrom
tanzhenxin merged 3 commits intomainfrom
Conversation
Add ability to capture multiple screenshots at intervals during long-running terminal output (e.g., progress bars). Optionally generates animated GIFs from captured frames using ffmpeg. Features: - Streaming capture at configurable intervals - Early stop when output stabilizes (3 consecutive unchanged frames) - Duplicate frame skipping - Animated GIF generation via ffmpeg concat demuxer - Auto-cleanup of output directory before each run - Configurable delay before starting captures Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Contributor
📋 Review SummaryThis PR introduces a valuable streaming capture capability to the terminal-capture tool, allowing for capturing multiple screenshots during long-running terminal output and optionally generating animated GIFs. The implementation is well-structured with clear documentation and handles edge cases appropriately. 🔍 General Feedback
🎯 Specific Feedback🟡 High
🟢 Medium
🔵 Low
✅ Highlights
|
Contributor
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
…IF timing - Add streaming-insight scenario for /insight command demo - Add progress.sh script to test PTY carriage return handling - Simplify generateGif with fixed frame durations (300ms normal, 1s edges) This enhances terminal capture testing with a real-world streaming scenario and cleaner GIF generation logic. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Add streaming capture capability to the terminal-capture tool, enabling screenshots to be captured at intervals during long-running terminal output (e.g., progress bars). Optionally generates animated GIFs from captured frames using ffmpeg.
Dive Deeper
This PR introduces a new
streamingoption in the scenario runner that allows capturing multiple screenshots during command execution rather than just before/after. This is particularly useful for demonstrating real-time output like progress bars, spinner animations, or any dynamic terminal content.Key features:
intervalMsandcountfor capturing frames at regular intervalsdelayMsto skip initial waiting phases (e.g., model thinking/approval time)Implementation details:
streamingproperty toFlowStepinterface with full TypeScript documentationReviewer Test Plan
npm run buildcd integration-tests/terminal-capture && npx tsx run.ts scenarios/streaming-shell.tsscreenshots/streaming-shell/streaming.gifis generated (requires ffmpeg)Testing Matrix
Linked issues / bugs
No linked issues
🤖 Generated with Qwen Code