Skip to content

Pipeline Patterns

Add --json before any command for machine-readable output:

Terminal window
websketch --json validate capture.json
websketch --json render capture.json
websketch --json fingerprint capture.json
websketch --json diff before.json after.json

Success: { "ok": true, ... }

Error: { "ok": false, "error": { "code": "WS_...", "message": "..." } }

Exit codes still apply in JSON mode — use $? or set -e in scripts.

Use fingerprinting to detect layout regressions without maintaining pixel baselines:

Terminal window
# Capture the page (via extension or programmatic capture)
# Then compare fingerprints
BEFORE=$(websketch fingerprint baseline.json)
AFTER=$(websketch fingerprint current.json)
if [ "$BEFORE" != "$AFTER" ]; then
echo "Layout changed!"
websketch diff baseline.json current.json
exit 1
fi

The --llm flag on render-ascii produces output optimized for language model consumption:

Terminal window
websketch render-ascii --llm capture.json

This includes:

  • Page URL and viewport dimensions in a header
  • The ASCII wireframe
  • A legend explaining the bracket notation ([BTN:label], [NAV:name], etc.)

Feed this directly into an LLM context window for UI understanding without vision capabilities.

For agents that use the Model Context Protocol, websketch-mcp exposes these same operations as MCP tools — no shell access required.