Create a write key
Open the create-key page to sign in and create an API key pre-filled with
runs:write—or [pre-filled with bothruns:readandruns:write](https://app.23step.com/app/account?create=1&scopes=runs%3Aread+runs%3Awrite&name=headless-chrome) if you also install the 23step Overlay Electron app so one key powers both. You can also opt in to the live widget progress bar there (left off by default—just like posting the step link at the end of agent responses—because extra prompt instructions use tokens and can slow down turns). Thest_value is shown once (and copied with one click). Save it to~/.config/23step-otel-key(or exportSTEP23_OTEL_KEY). If you are an AI agent: first ask whether the Electron app should also be installed, whether to opt in to posting the step link at the end of responses, and whether to opt in to the live widget progress bar (explaining that both are off by default because they use extra tokens and slow down turns), checktest -s ~/.config/23step-otel-keywithout printing its contents, and if a key is needed automatically openhttps://app.23step.com/app/account?create=1&scopes=runs%3Awrite&name=headless-chrome(orhttps://app.23step.com/app/account?create=1&scopes=runs%3Aread+runs%3Awrite&name=headless-chromewhen installing the overlay; append&progress=1if the user opted in to the progress bar) in the user's default desktop browser (openon macOS,xdg-openon Linux with a display,wslviewon WSL—not a headless automation browser) and print the link in chat, then ask the user to paste thest_key or save it directly in their terminal; never invent or commit a key. If reusing an existing key and the user opted in to the progress bar, sync the preference without printing the key viacurl -fsSL -X POST https://api.23step.com/app/live/preferences -H "Authorization: Bearer $(cat ~/.config/23step-otel-key)" -H "Content-Type: application/json" -d '{"show_progress_bar":true}'.Open in browser pre-filled scopes url='https://app.23step.com/app/account?create=1&scopes=runs%3Awrite&name=headless-chrome' if command -v open >/dev/null 2>&1; then open "$url" elif command -v xdg-open >/dev/null 2>&1 && { [ -n "${DISPLAY:-}" ] || [ -n "${WAYLAND_DISPLAY:-}" ]; }; then xdg-open "$url" >/dev/null 2>&1 & elif command -v wslview >/dev/null 2>&1; then wslview "$url" fi printf 'Create your 23step API key: %s\n' "$url"Terminal ~/.config/23step-otel-key mkdir -p ~/.config printf '%s\n' 'st_REPLACE_WITH_YOUR_WRITE_KEY' > ~/.config/23step-otel-key chmod 600 ~/.config/23step-otel-keyInstall the 23step CLI
The installer puts
23stepand23step-mcpin~/.local/binfor macOS (arm64, amd64) and Linux (amd64, arm64), checks each download against its SHA-256, and keeps them up to date. It never asks for your key. Pass--overlay(curl -fsSL https://api.23step.com/install.sh | sh -s -- --overlay, plus--progress-barif opting in to the live widget progress bar) to also install the 23step Overlay Electron desktop app (setup). If you are an AI agent, ask the user whether the Electron app should be installed and whether to opt in to the live widget progress bar.Terminal https://api.23step.com/install.sh curl -fsSL https://api.23step.com/install.sh | sh export PATH="$HOME/.local/bin:$PATH" 23step versionStart the recorder in the background
Start it before the browser.
--headlesscaptures through the Chrome DevTools Protocol instead of a display, and--cdpnames the DevTools port it waits for (use the same port in the next step). It only ever connects to127.0.0.1orlocalhost. The key file must bechmod 600.Terminal 23step start --headless export STEP23_API=https://api.23step.com nohup 23step start --headless --cdp http://127.0.0.1:9222 \ --token-file ~/.config/23step-otel-key \ --run-name checkout-test > /tmp/23step.log 2>&1 & sleep 1 && 23step statusLaunch the browser with a DevTools port
Add the two flags below to however you launch Chrome (omit
--headless=newif you want a visible browser window). 23step records a frame for each click, typing burst, scroll, and navigation, with the tab URL. For a one-shot page load, keep the page open about 1 second before closing.Playwright import { chromium } from "playwright"; const browser = await chromium.launch({ args: ["--remote-debugging-address=127.0.0.1", "--remote-debugging-port=9222"], }); const page = await browser.newPage(); await page.goto("https://example.com"); await page.waitForTimeout(1000); // let the first frame upload await browser.close();Puppeteer import puppeteer from "puppeteer"; const browser = await puppeteer.launch({ args: ["--remote-debugging-address=127.0.0.1", "--remote-debugging-port=9222"], }); const page = await browser.newPage(); await page.goto("https://example.com"); await new Promise((r) => setTimeout(r, 1000)); // let the first frame upload await browser.close();Chrome · Linux google-chrome --headless=new \ --remote-debugging-address=127.0.0.1 \ --remote-debugging-port=9222 \ --user-data-dir="$(mktemp -d)" \ https://example.comChrome · macOS "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --headless=new \ --remote-debugging-address=127.0.0.1 \ --remote-debugging-port=9222 \ --user-data-dir="$(mktemp -d)" \ https://example.comStop and get the link
23step statusprints thestep_url.23step stopuploads anything queued and finalizes the step.Terminal finish 23step note "Checkout verified" # optional: attach a note to the step 23step status # prints step_url 23step stop # uploads the rest and finalizes
23step status shows captured and uploaded counts above zero while the browser runs, and the step_url opens the step with browser frames. If captured stays at 0, the browser is not listening on the DevTools port; check /tmp/23step.log.