CLI in CI
Use the LittleDemo CLI from scripts and CI jobs.
CI should use an API key, not the browser device flow.
Basic setup
bashnpm install -g @littledemo/cliexport LITTLEDEMO_API_KEY=ld_live_xxxlittledemo whoami
Generate without waiting
bashlittledemo demos create \ --project "$LITTLEDEMO_PROJECT_ID" \ --prompt "Refresh the onboarding overview" \ --template guided-tour \ --no-wait
Demo video in every PR
The recommended path is to generate the workflow from your repo:
bashlittledemo setup --pr-demos --yes
That creates .github/workflows/littledemo-pr-demo.yml. Add LITTLEDEMO_API_KEY as a repo secret, and either pass --project proj_... during setup or add LITTLEDEMO_PROJECT_ID as a repo secret. The generated workflow records same-repo, non-draft PRs and skips fork PRs by default.
The PR demo guide covers the generated workflow and the reusable GitHub Action (seangeng/littledemo/action@v1). Or do it directly:
bashnpx --yes @littledemo/cli record http://localhost:3000 \ --upload --project "$LITTLEDEMO_PROJECT_ID" \ --prompt "PR demo" --yes --json > result.json
Upload a PR recording
Use this after Playwright, Chrome DevTools, or another local recorder writes a video artifact.
bashlittledemo demos upload ./artifacts/pr-demo.mp4 \ --project "$LITTLEDEMO_PROJECT_ID" \ --prompt "Show the PR changes" \ --title "PR demo $GITHUB_SHA" \ --json > littledemo-upload.json
The JSON output includes shareUrl, embedUrl, and videoUrl for a follow-up PR comment step.
Prefer webhooks for deploy refreshes
If you only need to refresh existing demos after deploys, use the project webhook endpoint. It is simpler and does not require a live API key in that job.
bashcurl -X POST "https://littledemo.com/api/v1/webhooks/projects/$LITTLEDEMO_PROJECT_ID/refresh" \ -H "X-Webhook-Secret: $LITTLEDEMO_WEBHOOK_SECRET"