live-panel
VerifiedBuild a terminal-style, always-running animated architecture diagram (a "live panel") from a JSON config and render it to an mp4. Use when the user wants a system, agent or org architecture diagram that looks like a monitoring dashboard in a terminal window - fixed layout, glowing packets on the wires, scrolling log, counters, bars that flip state - as a screen-recording-style video or a live web page, instead of a static picture or a step-by-step reveal. 中文:当用户要做"活的"架构图、agent 树或系统监控面板风格的动画(mp4 视频或循环网页)时使用——终端里一直在跑的监控面板外观,固定布局、线上流动的数据包、滚动日志、翻转的计数器和状态条;不是静态图,也不是分步演示。
scripts/render.py
View on GitHub#!/usr/bin/env python3
"""Render a live-panel config to an H.264 mp4: step window.seek(t) frame by frame, screenshot, pipe into ffmpeg.
python3 scripts/render.py --config examples/codex-agents/config.json --out out.mp4
Chrome and ffmpeg are looked up on PATH (Chrome also under /Applications on macOS) unless --chrome / --ffmpeg are given.
Runs on Linux and macOS; on Windows use WSL (the Chrome DevTools pipe needs POSIX fd passing).
"""
import argparse, os, subprocess, sys, tempfile
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
import livepanel as lp
def main():
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
ap.add_argument("--config", required=True, help="path to the JSON config")
ap.add_argument("--out", required=True, help="output .mp4")
ap.add_argument("--width", type=int, help="video width (default: config canvas.width)")
ap.add_argument("--height", type=int, help="video height (default: config canvas.height)")
ap.add_argument("--duration", type=float, help="seconds (default: config canvas.duration)")
ap.add_argument("--fps", type=int, help="frames per second (default: config canvas.fps or 30)")
ap.add_argument("--chrome", help="Chrome/Chromium executable (default: search PATH, and /Applications on macOS)")
ap.add_argument("--ffmpeg", help="ffmpeg executable (default: search PATH)")
ap.add_argument("--template", help="alternative template.html")
ap.add_argument("--crf", type=int, default=16)
ap.add_argument("--audio", choices=["silent", "none"], default="silent", help="add a silent AAC track (some chat apps treat silent-less mp4 as a GIF)")
ap.add_argument("--html-out", help="also keep the generated self-contained page here (opens live in any browser)")
ap.add_argument("--keep-frames", help="also write PNG frames into this directory")
ap.add_argument("--no-sandbox", action="store_true", help="pass --no-sandbox to Chrome (auto when running as root)")
a = ap.parse_args()
chrome = lp.find_chrome(a.chrome)
ffmpeg = lp.find_exe(a.ffmpeg, ["ffmpeg"], "ffmpeg")
tmpdir = tempfile.mkdtemp(prefix="livepanel-page-")
page = a.html_out or os.path.join(tmpdir, "page.html")
cfg = lp.build_page(a.config, page, a.template)
cw, ch, cdur, cfps = lp.canvas(cfg)
w = a.width or cw; h = a.height or ch
fps = a.fps or cfps; dur = a.duration or cdur
n = int(round(fps * dur))
w -= w % 2; h -= h % 2 # yuv420p needs even sizes
cmd = [ffmpeg, "-y", "-loglevel", "error", "-f", "image2pipe", "-framerate", str(fps), "-c:v", "png", "-i", "-"]
if a.audio == "silent":
cmd += ["-f", "lavfi", "-i", "anullsrc=r=44100:cl=stereo", "-shortest", "-c:a", "aac", "-b:a", "32k"]
cmd += ["-c:v", "libx264", "-preset", "medium", "-crf", str(a.crf), "-pix_fmt", "yuv420p", "-r", str(fps), "-movflags", "+faststart", a.out]
os.makedirs(os.path.dirname(os.path.abspath(a.out)), exist_ok=True)
if a.keep_frames:
os.makedirs(a.keep_frames, exist_ok=True)
ff = subprocess.Popen(cmd, stdin=subprocess.PIPE)
with lp.Chrome(chrome, w, h, True if a.no_sandbox else None) as br:
br.open("file://" + os.path.abspath(page) + "?manual")
for i in range(n):
br.seek(i / fps)
png = br.shot()
if a.keep_frames:
Path(a.keep_frames, f"f_{i:04d}.png").write_bytes(png)
ff.stdin.write(png)
if i % fps == 0:
print(f"\r{i}/{n} frames", end="", file=sys.stderr, flush=True)
err = br.eval("window.__error||''")
if err:
print("\npage errors:", err, file=sys.stderr)
ff.stdin.close(); rc = ff.wait()
print(f"\nwrote {a.out} ({n} frames, {w}x{h}@{fps})", file=sys.stderr)
sys.exit(rc)
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |