3.6 KiB
WEB-AUTOMATION
Purpose
Automate rendered browsing, scraping, authentication, and multi-step browser flows with Playwright-compatible CloakBrowser.
What Ships In Every Variant
browse.tsfor direct navigation and screenshotsauth.tsfor form and Microsoft SSO login flowsscrape.tsfor markdown extractionflow.tsfor natural-language or JSON browser stepsextract.jsfor one-shot rendered JSON extractioncheck-install.jsfor install and wiring validationscan-local-app.tsfor configurable local-app smoke scans
Requirements
- Node.js 20+
- pnpm
cloakbrowserplaywright-core- Network access to download the CloakBrowser binary on first use
Install
Codex
mkdir -p ~/.codex/skills/web-automation
cp -R skills/web-automation/codex/* ~/.codex/skills/web-automation/
cd ~/.codex/skills/web-automation/scripts
pnpm install
npx cloakbrowser install
pnpm approve-builds
pnpm rebuild better-sqlite3 esbuild
Claude Code
mkdir -p ~/.claude/skills/web-automation
cp -R skills/web-automation/claude-code/* ~/.claude/skills/web-automation/
cd ~/.claude/skills/web-automation/scripts
pnpm install
npx cloakbrowser install
pnpm approve-builds
pnpm rebuild better-sqlite3 esbuild
OpenCode
mkdir -p ~/.config/opencode/skills/web-automation
cp -R skills/web-automation/opencode/* ~/.config/opencode/skills/web-automation/
cd ~/.config/opencode/skills/web-automation/scripts
pnpm install
npx cloakbrowser install
pnpm approve-builds
pnpm rebuild better-sqlite3 esbuild
Update To The Latest CloakBrowser
Run inside the installed scripts/ directory for the variant you are using:
pnpm up cloakbrowser playwright-core
npx cloakbrowser install
pnpm approve-builds
pnpm rebuild better-sqlite3 esbuild
This repo intentionally treats cloakbrowser as a refreshable dependency: update to the latest available compatible release, then regenerate the lockfile from that resolved set.
Verify Installation & Wiring
Run in the installed scripts/ folder:
node check-install.js
Expected checks:
cloakbrowserandplaywright-coreresolve correctlybrowse.tsis wired to CloakBrowser
If the check fails, stop and return:
"Missing dependency/config: web-automation requires cloakbrowser and playwright-core with CloakBrowser-based scripts. Run setup in this skill, then retry."
If runtime later fails with native-binding issues, run:
pnpm approve-builds
pnpm rebuild better-sqlite3 esbuild
Environment Variables
CLOAKBROWSER_PROFILE_PATHCLOAKBROWSER_HEADLESSCLOAKBROWSER_USERNAMECLOAKBROWSER_PASSWORD
There are no CAMOUFOX_* compatibility aliases in this migration.
Usage Examples
- Browse:
npx tsx browse.ts --url "https://example.com" - Scrape markdown:
npx tsx scrape.ts --url "https://example.com" --mode main --output page.md - Authenticate:
npx tsx auth.ts --url "https://example.com/login" - Natural-language flow:
npx tsx flow.ts --instruction 'go to https://example.com then click on "Login"' - JSON extract:
node extract.js "https://example.com" - Local smoke scan:
SCAN_BASE_URL=http://localhost:3000 SCAN_ROUTES=/,/dashboard npx tsx scan-local-app.ts
Local App Smoke Scan
scan-local-app.ts is generic. Configure it with:
SCAN_BASE_URLSCAN_LOGIN_PATHSCAN_USERNAMESCAN_PASSWORDSCAN_USERNAME_SELECTORSCAN_PASSWORD_SELECTORSCAN_SUBMIT_SELECTORSCAN_ROUTESSCAN_REPORT_PATHSCAN_HEADLESS
If SCAN_USERNAME or SCAN_PASSWORD are omitted, the script falls back to CLOAKBROWSER_USERNAME and CLOAKBROWSER_PASSWORD.