DemoCI Documentation (v0.2.1)
Quickstart: Playwright & YAML to Synced Tour, Video, and Docs
Run locally in 30 seconds or drop directly into GitHub Actions. Exported tour/ folders are 100% static HTML/JS with zero external runtime dependencies.
1. Install CLI & Scaffold Starter Spec
npm install -D @shipcraftlabs/democi playwright npx playwright install chromium npx @shipcraftlabs/democi init npx @shipcraftlabs/democi run democi.yml --out ./democi-out
2. Playwright SDK Integration (`@shipcraftlabs/democi/sdk`)
Attach createDemoRecorder directly to existing end-to-end Playwright specs so every release updates interactive onboarding and docs automatically.
import { test } from '@playwright/test';
import { createDemoRecorder } from '@shipcraftlabs/democi/sdk';
test('onboarding flow', async ({ page }) => {
const demo = createDemoRecorder({
name: 'Workspace Onboarding',
outDir: './democi-out',
hideWatermark: false,
});
await page.goto('http://localhost:3000');
await demo.step(page, {
id: 'create-key',
title: 'Generate API credentials',
description: 'Mask customer PII selectors before capture automatically.',
selector: '[data-testid="create-api-key"]',
mask: ['.customer-email'],
action: 'click',
});
await demo.finalize();
});3. Automate on Every Push (GitHub Action)
name: Update Product Demos & Docs
on:
push:
branches: [main]
jobs:
democi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: devansh2396/democi@v0.2.1
with:
spec: democi.yml
out-dir: public/demo
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore(demo): sync tour, video & docs"
file_pattern: public/demo/*4. Self-Host Anywhere (`@shipcraftlabs/democi export-bundle`)
Copy the standalone interactive tour bundle directly into Vercel public/, S3, R2, or Mintlify/Docusaurus static assets:
npx @shipcraftlabs/democi export-bundle --in ./democi-out --out ./public/tour <!-- Drop into any website --> <script src="/tour/embed.js" data-democi-src="/tour/index.html" async></script>
5. Authenticated Apps, CDP & API Mocking (v0.2.1)
Capture logged-in dashboards in CI without fragile OAuth logins by saving Playwright session state, attaching via Chrome DevTools Protocol (--cdp-url), or mocking volatile API responses cleanly inside democi.yml:
# Save browser session state locally, then pass base64 via CI secret
npx @shipcraftlabs/democi auth save https://app.example.com --out auth.json
DEMOCI_STORAGE_STATE_B64="$(base64 < auth.json)" npx @shipcraftlabs/democi run democi.yml
# Attach directly to an existing Chromium session over CDP
npx @shipcraftlabs/democi run democi.yml --cdp-url http://127.0.0.1:9222
# Optional deterministic YAML route mocking inside democi.yml
routes:
- url: "**/api/billing/summary"
status: 200
body: '{"plan":"Team","status":"active"}'