Getting started

Requirements

  • Node.js 18 or later.
  • A Chromium-based browser. slapify init finds Chrome, Chromium, Edge or Brave in their usual install locations. If none is found, or you prefer it, Chromium (about 170MB) is downloaded on first run.
  • An LLM, one of:
    • an API key for Anthropic, OpenAI, Google, Mistral or Groq,
    • Claude Code installed and logged in, to run on a Claude Pro or Max plan,
    • a ChatGPT Plus, Pro or Business plan, signed in with npx slapify login codex,
    • a local Ollama server.

Browser control goes through agent-browser, which installs with Slapify. If it is missing, slapify install installs it globally and downloads its browser.

Install

npm install -g slapify
# or use npx for every command
npx slapify init

slapify init

Run it in your project folder. It asks three things, then writes your config.

1. LLM provider and model.

ChoiceProviderNext prompt
1) Anthropic (Claude), the defaultanthropicPick a model, then the API key step
2) Claude Code CLIclaude-cliPick sonnet, opus, haiku or a custom id; init makes a test claude -p call to confirm your login
3) ChatGPT plan (Codex)codexOpens your browser to sign in with ChatGPT (skipped if already signed in), then lists the models your plan can use
4) OpenAIopenaiPick a model, then the API key step
5) Google (Gemini)googlePick a model, then the API key step
6) Mistral, 7) Groq, 8) Ollamamistral, groq, ollamaType a model id

2. API key (API providers only). Init looks for the provider's variable (ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_API_KEY, MISTRAL_API_KEY or GROQ_API_KEY) and offers a test call. The key is never written to config: config references it as ${ANTHROPIC_API_KEY} and so on. A key you paste at this prompt is only used for the test, so also export it in your shell or put it in .env.

3. Browser. Use a browser found on your system, download Chromium on first run, or enter a path.

npx slapify init -y skips the prompts and uses the defaults: Anthropic with claude-sonnet-4-6.

The .slapify folder

Init creates:

PathWhat it is
.slapify/config.yamlLLM, browser and report settings. Stealth and a persistent browser profile are on by default. See Configuration.
.slapify/credentials.yamlLogin profiles. Listed in .slapify/.gitignore so it is not committed.
tests/example.flowA sample flow.

These appear as you use it:

PathCreated by
.slapify/tasks/Every task session: <id>.json (state and memory) and <id>.jsonl (event log)
.slapify/browser-profile/The persistent Chromium profile, when browser.profile points here
.slapify/uploads/, .slapify/downloads/Files the agent may upload, and files it downloads
~/.slapify/chatgpt-auth.jsonChatGPT sign-in tokens for the codex provider

The CLI finds .slapify by walking up from the current directory, and loads a .env file from the current directory if there is one.

Set your key

export ANTHROPIC_API_KEY=your-key

Skip this for claude-cli (run claude once and sign in) and codex (npx slapify login codex).

Your first task

npx slapify task "Go to news.ycombinator.com and summarise the top 5 stories" --report

The agent reads the page, decides what to do, and prints status updates as it goes. When it finishes you get a summary, the session id, anything it saved to memory, and with --report an HTML report at slapify-task-reports/<session-id>.html. Add --headed to watch the browser, or --debug to see every tool call. Press Ctrl+C to stop; the report is still written.

See Task mode for everything else a task can do.

Your first flow

tests/example.flow, as created by init (most comments trimmed):

# Example Test - Getting Started with Slapify
Go to https://example.com
Verify page title contains "Example"
[Optional] Close any cookie consent popup
Click on "More information" link
Verify URL contains "iana.org"
npx slapify run tests/example.flow --report

Each line is interpreted and executed in the browser. The command prints a pass or fail line per step and exits 1 if any flow fails. See Flow mode.

Reports and recordings

WhatCommandWhere it goes
Task reportslapify task "..." --reportslapify-task-reports/<session-id>.html: tool timeline, summaries, perf data
Flow reportslapify run ... --reporttest-reports/<flow>-<timestamp>/report.html with screenshots, or test-suite-<timestamp>/ for several flows
Recordingslapify task "..." --record runs/demoframes/ (annotated screenshot per step), video.webm, steps.json, replay.html
Live viewadd --live to --recordhttp://127.0.0.1:8790/ while the run is going

video.webm needs ffmpeg. Slapify finds one on your PATH, or the copy Playwright downloads.

Other commands

CommandWhat it does
slapify fast <goal>Ultrafast mode, driven by a decision model. See Decision models and fast mode.
slapify serverStay online and take goals from Telegram
slapify login codex / slapify logout codexSign in to or out of a ChatGPT plan
slapify create <name> / slapify generate <prompt>Write a flow by hand, or have the agent run a goal and save the steps that worked
slapify fix <file>Analyse a failing flow and suggest or apply fixes (--auto, --headed)
slapify validate [files...] / slapify listCheck flow syntax / list flow files
slapify credentials / slapify fix-credentialsList credential profiles / repair profiles saved with JSON-string storage
slapify installInstall agent-browser and its browser