
Clickcast
io.github.AlexKay28由 GitHub 账号 AlexKay28 发布v0.4.4更新于 Oct 24, 2026
Drive a real Playwright browser: annotated screenshot + structured page state after every action.
概览
驱动真实的 Playwright 浏览器逐步操作网页,每次操作后返回带标注的截图和结构化页面状态。
- 可以做什么
- 在实时网页上逐步执行导航、点击、输入、滚动等操作
- 每次操作后返回带标注的截图,可选叠加像素网格坐标
- 读取结构化页面状态:标题、URL、控制台错误、页面错误和失败请求
- 枚举可交互元素及其无障碍角色与名称,便于选择选择器
- 按默认引擎、视口、设备、语言、深色模式和网格设置启动会话
- 适用场景
- 适合助手需要交互式探索或验证实时网页界面、并根据所见结果决定下一步的场景。适用于前端调试、在开发服务器或预发布环境上检查流程,以及页面的视觉验证。
- 运行要求
- 以本地 stdio 进程运行;需安装 MCP 附加组件(pip install 'clickcast[mcp]'),或通过 npx 使用 npm 封装包。需要 Python 3.10 及以上版本和 Playwright 浏览器引擎,通常为 Chromium(约 180 MB 下载);在 Linux 上安装系统库可能需要 sudo。未声明任何账号、API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 Clickcast,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
🎞️ clickcast — Playwright browser automation, screenshots, and GIF/MP4/WebP recording for AI agents
Give AI agents visual + structured feedback about live web UIs — and give humans deterministic demo reels while you're at it.
[PyPI version] [Python] [CI] [License: MIT]
What's new (v0.4.4) —
npx-installable npm wrappers (clickcast+clickcast-mcp) on top of the v0.3.0 highlights: live agent control via an MCP server, pixel-levelclickcast diff, accessibility semantics fused with the pixel-grid overlay, an official CI GitHub Action, Homebrew/apt packaging, and a self-healing first run. SeeCHANGELOG.mdfor the full notes.
See
docs/ONE_PAGE_NAVIGATION_ORDER_TIPS.mdfor the nine principles behind why this reel reads as legibly as it does — and the scenario template you can copy for your own reels.
clickcast drives a real browser through a website and hands back two things:
- A watchable reel — GIF / MP4 / WebP / raw frames.
- A machine-readable JSON sidecar — every step's selector, timings, per-step frame paths, discovered elements, and post-action page state (title, URL, console errors, failed requests). Versioned. See
docs/feedback-schema.md.
Point it at a URL and it will auto-discover the interactive elements and build a tour for you, or hand it a small YAML scenario for a scripted, repeatable walkthrough.
Install
One line, ready to run immediately after:
Broken down — pip install clickcast (requires Python ≥ 3.10) gets you the
CLI; clickcast install downloads Chromium (~one-time, ~180MB — kept out of
the pip package itself since it's versioned independently and every project
doesn't need every engine); --with-deps also pulls the system libraries
Chromium needs (Linux only, may prompt for sudo); clickcast doctor
confirms everything above actually worked.
Forgot the second step? Any command that needs a browser (auto, run,
shot, elements, mcp) detects a missing engine itself and offers to
install it right then instead of failing — say yes once and it retries
automatically. That prompt only fires in an interactive terminal; CI/scripted
runs fail fast with the exact fix command instead of hanging on stdin.
Homebrew (macOS/Linux)
apt (Debian/Ubuntu, .deb)
Both native packages skip the Chromium download (~180MB, versioned
independently of clickcast) and never install a second ffmpeg (clickcast
already bundles one via imageio[ffmpeg]) -- run clickcast install --with-deps chromium once after either install path. Full design rationale,
what's live today vs. what needs one-time bootstrapping, and the exact
bootstrap steps: docs/packaging/homebrew.md,
docs/packaging/apt.md.
npm (clickcast + clickcast-mcp)
Two npm packages -- thin Node wrappers whose postinstall provisions an
isolated Python venv and pip-installs the pinned PyPI clickcast, since
there's no way to ship clickcast's Playwright/Pillow/ffmpeg runtime as pure
JS. Built specifically because the MCP ecosystem's install pattern is
npx <package>, not pip install:
Both are published on the npm registry. To run against your working copy instead of the published version:
Full design rationale
(including why the shared provisioning code is a vendored copy rather than
a file: dependency), what's live today vs. what needs bootstrapping, and
the exact bootstrap steps: docs/packaging/npm.md.
For AI agents — copy this prompt into your chat
Paste the block below into your coding agent (Claude Code, Cursor, Copilot Chat, Codex, etc.) to teach it clickcast in one message. The agent will install the tool, verify the environment, generate a visual + machine-readable report for your project, and know how to gate CI on the results.
Once the agent has this, ask it something concrete like "run clickcast auto against http://localhost:3000 and tell me which clicks had DOM reactions" — it now has everything it needs.
Live agent control (MCP)
Everything above is batch mode: record a whole tour, then read back a GIF + sidecar. clickcast mcp is the live counterpart — an MCP server that drives one action at a time (goto/click/type/scroll/...) and hands back clickcast's richer per-call payload (annotated frame, page_state, grid coordinates, an enumerated error_code) instead of a bare screenshot, so an agent can react before deciding the next step.
Reach for mcp when an agent needs to explore and react live; reach for auto/run for a repeatable, one-shot artifact (CI, docs, release notes). Full tool reference, client config for Claude Code / Claude Desktop, and the schema doc: docs/mcp.md · docs/mcp-tool-schema.md.
First run — 30 seconds
Produces two files:
tour.gif— the reeltour.gif.json— the AI-consumable sidecar (schema_version: 4, spec atdocs/feedback-schema.md)
For a walkthrough of how an LLM agent consumes both, see docs/ai-integration.md.
Three modes
All three are deterministic, headless-by-default, and CI-friendly.
Commands
auto <url>
Discover interactive elements and record a click-tour.
run <scenario.yml>
Execute a YAML scenario. See Scenario format.
Flags: --out, --format, --headful, --slowmo MS, --url URL (retarget the first goto step — see below), --var key=value (repeatable — substitute {{ key }} inside the scenario), --no-sidecar.
CLI flags override the scenario's meta: block.
Point an existing scenario at a different environment with --url — no YAML edits, no {{ URL }} templating:
--url rewrites the first goto step's URL and wins over --var URL=.... Only the first goto is touched — later goto steps are usually intra-app navigation from the entry point, so they stay put.
shot <url>
Single screenshot.
Flags: --out, --full-page, --wait (load / domcontentloaded / networkidle / a selector / a number of seconds), --viewport, --device, --engine, --dark.
init [path]
Scaffold a starter YAML scenario. --from-auto runs discovery once and seeds the file with the top-scoring click steps.
Flags: --url, --name, --out, --from-auto, --force.
elements <url>
Dump the discovered interactive elements — useful for authoring selectors.
Each entry additionally carries an accessibility block (Playwright's own
role / accessible name / interactive state, fused with the pixel-grid
overlay's grid_cell when --grid is on) — see
docs/feedback-schema.md.
explore <url>
Map the site's state graph and emit explore.json — auto --traversal bfs minus everything that records (no frames, no annotator, no encoder), so mapping an app costs seconds instead of a reel shoot. Output shape: docs/explore-schema.md.
report-bug <sidecar.json>
Turn a sidecar into an actionable bug report — redacted by default, shareable as-is, or --open to launch a prefilled GitHub issue.
Flags: --json, --open, --redact/--no-redact (default on — sanitizes URLs, selectors, and visible text), --note.
feedback
Long-form usage feedback: record a session, then summarize it.
Subcommands: start, stop, status, list, summary.
doctor
Check Python version, playwright, engine binaries, ffmpeg, config path.
config
Read / write persistent defaults.
Set values land in the user TOML at clickcast config path. See Configuration for precedence.
install [engines…]
Wrapper over playwright install. Default engine: chromium.
mcp
Start a stdio MCP server for live agent control — see Live agent control (MCP) above and docs/mcp.md. Requires pip install 'clickcast[mcp]'.
Flags: --engine, --viewport, --device, --headful, --lang, --dark, --grid/--grid-pitch/--grid-color/--grid-style — all defaults for start_session when the connecting agent doesn't override them.
Scenario format
A scenario is plain YAML: a meta: block and a list of steps:. Full worked examples: docs/scenarios/.
Supported actions
Every step also accepts label, dwell, optional: true (don't fail the run if the selector is missing — sidecar records status: "skipped"), and repeat: N.
Variable substitution: {{ key }} inside any string, injected via --var key=value.
Python API
Fluent, chainable — every builder returns self:
Async variant for callers already inside a running event loop:
Discovery only, no reel:
Skip the sidecar with save(..., no_sidecar=True).
Pre-push iteration on a local static build
Building a static site and reeling it locally before pushing? Use Reel.serve_dir (or the standalone serve_directory helper) as a context manager — it starts a threaded HTTP server on a free port, yields the base URL, and tears the server down on exit. No more python3 -m http.server 8091 & invocations that leak past your shell session and collide with the next iteration.
Defaults are safe for dev iteration: loopback-only bind (127.0.0.1), OS-picked free port, ThreadingHTTPServer so parallel browser requests don't queue. Override any of them explicitly:
bind="0.0.0.0" exposes the server to your LAN — opt-in, not the default.
Reading the sidecar
Every recording run writes <out>.json alongside the media file.
Consumers that don't want to import clickcast can parse the JSON directly against the schema at src/clickcast/feedback/schema/v4.json. A standalone reference implementation lives at tests/consumer/read_sidecar.py.
See docs/ai-integration.md for the two-line agent-integration example and docs/feedback-schema.md for the full field-by-field walkthrough.
CI: 2-line regression gate
On GitHub Actions? .github/actions/clickcast
packages this recipe (plus the visual diff gate below, browser caching,
and a PR comment with the reel + a summary table) as a reusable Action —
see docs/ci/README.md. This section stays the
canonical recipe for every other CI platform, and for anyone who'd rather
not depend on a third-party Action for two lines of shell.
Every reel writes a JSON sidecar, but raw sidecars carry timestamps, frame
filenames, and query-string tokens — none of which are stable across runs.
For a proper CI regression gate, use clickcast assertions (or
Reel.assertions()) to distill the sidecar down to the shape that
actually matters: step count, per-step action / label / status, and the
per-step error counters.
The distilled shape is byte-identical across runs of the same scenario
against the same URL (schema: docs/assertions-schema/v1.json).
Diff it against a committed baseline; non-zero exit on drift.
Bootstrap the baseline once:
Then in CI (2 lines):
Exit 0 means the target UI produced the same step ordering, statuses, and
error-signal counts as when the baseline was captured; anything else is
real drift and the command prints per-line descriptions like
step 2: status changed 'ok' -> 'failed'.
Same signal from Python:
Excluded from the distilled shape on purpose: wall-clock timestamps,
per-step duration_ms, frames filenames, resolved URLs (including
query-string tokens), cursor_xy. If you need those in your gate too,
diff the raw sidecar with your own tooling — the assertion set is the
narrow "did the UI still behave" contract, not the wire-level snapshot.
Its visual companion: clickcast diff
assertions is structural — it never looks at a pixel. clickcast diff
(and Reel.visual_diff()) is the pixel-level companion: it pairs up two
sidecars' steps and pixel-diffs their frames, reporting a percent-changed
and a list of changed bounding regions per step, plus region-highlighted
diff images. Reach for assertions to catch "the flow broke" (wrong step
count, a step that started failing); reach for diff to catch "the flow
ran fine but the button moved / the color changed / the layout shifted."
The two compose — run both in CI for full coverage, or diff alone if
pixel drift is your only concern.
Exits non-zero when any step's changed pixel percentage exceeds
--fail-above, or when a step couldn't be paired with its baseline
counterpart at all (mismatched step counts fall back to label matching;
anything still unmatched is flagged rather than silently skipped).
--out collects the region-highlighted diff images plus a summary.json
for CI artifacts; --threshold tunes the per-pixel noise floor. Clickcast's
own overlays (progress bar, action label, actions panel, cursor + ripple)
are excluded from the diff by default — otherwise every run would flag its
own chrome as a regression — pass --no-exclude-overlays for a strict
raw-pixel diff. Same signal from Python via reel.visual_diff(run_path, baseline_path).
Configuration
Precedence (highest → lowest):
- CLI flags
- Scenario
meta:block CLICKCAST_*environment variables- Project
./clickcast.toml - User TOML (path via
clickcast config path) - Built-in defaults
Every Config field can be set at any of these layers: engine, viewport, device, headful, slowmo, lang, dark, proxy, fps, dwell, format, quality, loop.
Project TOML — flat or [defaults]-wrapped both work:
Env vars:
Output formats
--quality 1..30 trades size for fidelity (lower = better). --loop 0 loops forever; --loop 1 plays once.
How it works
- Session launches a Playwright browser at the requested viewport/device.
- Actions run one step at a time (
click,type,scroll, …) with normalised timings and cursor tracking. - Recorder captures a pre-frame + N padding frames per step (deterministic filenames, byte-identical copies for padding).
- PageStateCollector subscribes to page events for the sidecar.
- Encoder produces the final artifact; ReportBuilder finalises the JSON.
The annotator (clickcast.annotate.Annotator — click ripples, cursor trail, caption bar, progress bar) ships as a library API in v0.1. Automatic wiring into auto / run outputs is planned for v0.2 (see Roadmap).
Troubleshooting
- Blank frames — the site is a SPA; increase
--initial-wait, or addwait: networkidle(or a specific selector) to the first step. ffmpeg not found—imageio-ffmpegbundles a static binary; falls back if missing. Choosegif/webpif you'd rather skip MP4 entirely.- Selector not found —
clickcast elements <url>shows what's actually clickable. Or mark the stepoptional: true. - Can't reach an internal site — set
CLICKCAST_PROXY, orproxyin the scenariometa:block. - Chromium missing —
clickcast install. On Linux CI add--with-deps. - Sidecar shape changed — the current schema is versioned at
src/clickcast/feedback/schema/v4.json; every bump from v1 has been strictly additive (thegraphblock landed in v2), so older sidecars keep parsing. Seedocs/feedback-schema.mdfor each version's additive contract.
Contributing
Before opening a PR:
Cutting a release is documented in RELEASING.md.
Roadmap
v0.1 — Session · Actions · Recorder · Encoder · Discovery · YAML scenarios · CLI · Python API · Sidecar (schema v1) · Config precedence · Fixture test site · Docs.
v0.2 — everything on the original v0.2 list shipped during the v0.2–v0.4 line:
- On-frame HUD — shipped as the
--for-humanscomposite (--highlight-target,--title-card,--summary-card,--zoom-on-click, onboarding pace) with the annotation pipeline wired intoauto/run. - BFS UI exploration — shipped as
auto --traversal bfs(plus--seed-urlfor deterministic paths,visited-dedup, and the top-levelgraphsidecar block). No separateexplorecommand yet — see below. - Sidecar schema v2 with the
graphblock — shipped (schema is now at v4; every bump strictly additive). - Automatic annotation of
auto/runoutputs — shipped (annotate.pipeline+AnnotateConfig).
v0.5 (in development on the v0.5 line):
- Flagship: first-class
clickcast explore <url>— implemented (see Unreleased in the CHANGELOG): the state-graph command the v0.2 plan only gestured at. Same traversal/dedup internals asauto --traversal bfs, minus recording + encoding — returns a fastexplore.json(nodes = distinct page states, edges =(from, to, action, transition_kind), plus top discoveries per state). Structured-only, agent-first — the reel is opt-in. Contract:docs/explore-schema.md. Pillow 14 deprecation cleanup— done: the 28Image.getdatadeprecation warnings in pixel-assertion tests migrated to aflattened_pixelshelper (tests/_stubs.py) that prefersget_flattened_dataand falls back across the supportedPillow>=10.0range.- Sidecar schema maturity — the v0.1-era plan for a graph block (originally tracked in #29) landed at schema v2 and the schema has since matured to v4 with strictly additive bumps; any future v5 keeps that contract.
Related projects
vercel-labs/webreel — a TypeScript tool for authoring polished demo videos. Easy to confuse with this project given the similar name and overlapping output, so: clickcast is a Python tool aimed primarily at AI agents that need a visual modality onto a live web UI, and secondarily at humans who want reproducible demo reels. If you want hand-authored marketing videos, webreel is the better fit.
License
MIT © 2026 Alex Kay. See LICENSE.
来源:README.md,提交 4841b2f
工具
0版本历史
1- v0.4.4最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分