The CLI works best for stable, predictable flows like docs, marketing pages, and controlled internal demos. For fast-changing product UI, the browser extension is usually the better starting point.
Prerequisites
Before you start, make sure you have:
- Chrome or Chromium browser
- A Stepshots account
- A Rust toolchain — only if you install with
cargo install; the prebuilt binary needs none
Installation
Install the prebuilt binary (macOS Apple Silicon, Linux x86_64/aarch64):
curl -sSL https://raw.githubusercontent.com/hauju/stepshots/main/install.sh | shOr install with Cargo (any platform with a Rust toolchain):
cargo install stepshots-cliSee Installation for other platforms and the browser prerequisite.
Initialize Your Project
Create a configuration file in your project directory:
stepshots initThis generates a stepshots.config.json file where you can configure the target URL, viewport size, and other settings.
Recording a Demo
Start a recording session:
stepshots recordThe CLI opens a headless Chrome instance and replays the steps from your config. Use stable selectors and explicit waits where needed.
The CLI captures screenshots at each step and bundles them into a .stepshot file.
Preview Before Recording
Before recording, preview a tutorial to check that every step works. Pass the tutorial key — preview replays that tutorial in a visible (non-headless) browser so you can watch each action and catch selector issues early:
stepshots preview my-tutorialUpload to Stepshots
Log in once — this opens your browser and stores a token locally:
stepshots loginThen upload your recording, passing the bundle file:
stepshots upload output/my-tutorial.stepshotThe CLI uploads the .stepshot bundle to your Stepshots account. You'll get a link to view and share your demo. Add --public to publish it immediately, or --demo-id <id> to replace an existing demo. In CI, set STEPSHOTS_TOKEN instead of running login.
Generate the config from a description (AI-assisted)
You don't have to hand-write steps. With an AI coding agent — Claude Code or Codex — and the Stepshots skill, you describe the flow in plain language and the agent inspects the page, picks stable selectors, and writes stepshots.config.json for you.
Install the skill from the repo:
cp -r skills/stepshots-cli-record ~/.claude/skills/Then describe what you want to capture, for example:
Record a demo of signing up for my app at
app.example.com: land on the homepage, click Get Started, enter an email, submit, and end on the dashboard.
The agent runs stepshots inspect <url> to discover selectors and produces a config like this:
{
"baseUrl": "https://app.example.com",
"viewport": { "width": 1280, "height": 800 },
"tutorials": {
"signup-flow": {
"url": "/",
"title": "Sign up for Example App",
"steps": [
{ "action": "click", "name": "Get started", "selector": "[data-testid='get-started-btn']",
"highlights": [{ "callout": "Start the signup flow", "position": "bottom" }] },
{ "action": "type", "name": "Enter email", "selector": "#email", "text": "demo@example.com" },
{ "action": "click", "name": "Submit", "selector": "button[type='submit']" },
{ "action": "wait", "name": "Dashboard", "selector": ".dashboard", "delay": 1500 }
]
}
}
}Review it, then record as usual:
stepshots record -t signup-flowYou stay in control: the agent writes the config, you edit anything you want, and the CLI does the capture — no manual scripting from scratch.
Record logged-in flows
Recordings run in a fresh browser, so sites you're normally signed in to appear logged out. To record an authenticated flow, log in once inside a persistent browser profile, then point recordings at the same profile:
# One-time: opens a visible browser — log in, then press Ctrl+C
stepshots browser https://example.com/login --profile-dir ~/.stepshots/profile
# Recordings (and preview/inspect) reuse the saved session
stepshots record --tutorial my-tutorial --profile-dir ~/.stepshots/profileSet STEPSHOTS_PROFILE_DIR to avoid repeating the flag.
Use a dedicated profile directory that only Stepshots touches — never point --profile-dir at your regular Chrome profile.
Keep demos fresh with verify
Apps drift over time — a redesign can break the selectors your demo relies on. Run stepshots verify to replay your tutorials against the live app and report which steps or annotations no longer match, without writing a new bundle:
stepshots verifyIt's built for CI: exit code 0 means everything is fresh, and --json emits a machine-readable report with a repair hint per failure. See the CI & Automation guide.
Tips for Great Demos
- Keep the flow stable — Prefer selectors and states that are unlikely to change often
- Keep it focused — 5-10 steps is the sweet spot for engagement
- Use annotations — Add highlights and callouts in the web editor after uploading
- Test before automating — Preview locally before relying on CI or scripts
- Test on mobile — Preview your demo at different viewport sizes