Getting started
Install
npx slapify init
This scaffolds a config file and installs the required browser binaries via Playwright.
Set your LLM provider
Slapify is LLM-provider agnostic. Export the appropriate key before running:
# OpenAI export OPENAI_API_KEY=sk-... # Anthropic export ANTHROPIC_API_KEY=sk-ant-...
Run your first autonomous task
slapify task "Go to github.com/trending and summarise the top 5 repos" --report
Slapify will:
- Launch a browser (headless by default)
- Plan a series of steps to accomplish the goal
- Navigate, click, and type autonomously using screenshot-driven reasoning
- Generate an HTML report with screenshots when
--reportis passed
Run a flow test
slapify run tests/smoke.flow --report
A .flow file is a plain-text script describing a user journey:
Navigate to https://example.com Click "Sign in" Type "[email protected]" in the email field Click the submit button Assert the page contains "Welcome"
Programmatic usage
import { BrowserAgent, runPerfAudit } from "slapify";
const agent = new BrowserAgent();
await agent.launch();
const result = await runPerfAudit("https://example.com", agent);
console.log(result.scores);
await agent.close();
Next steps
- Task mode for autonomous agent flags and report format
- Flow mode for the
.flowfile format and CI setup - API reference for the full Node.js SDK