CLI Reference
CLI Overview
Install and use the Refrain CLI.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Install and use the Refrain CLI.
npm install -g @refrainai/cli
pnpm add -g @refrainai/cli
npx @refrainai/cli <command>
| Command | Description |
|---|---|
generate | Generate a runbook by AI-driven browser exploration |
execute | Execute a runbook |
fix-runbook | Apply repair suggestions from an execution report to a runbook |
compose | Merge multiple runbooks into a single branching runbook |
runner | Start a remote browser runner |
serve | Start the API server for remote execution and Web Console |
| Option | Description |
|---|---|
--version, -v | Show version number |
--help, -h | Show help |
npx @refrainai/cli generate -- \
--url "https://app.example.com/login" \
--goal "Log in and export dashboard data" \
--output ./login-export.yaml \
--context ./context.md \
--secrets ./secrets.json \
--headless false \
--model "claude-sonnet-4-6" \
--model-provider anthropic
npx @refrainai/cli execute -- \
--runbook ./login-export.yaml \
--context ./context.md \
--secrets ./secrets.json \
--headless false \
--model "claude-sonnet-4-6" \
--model-provider anthropic
npx @refrainai/cli execute -- \
--runbook ./login-export.yaml \
--self-heal
npx @refrainai/cli fix-runbook -- \
--runbook ./login-export.yaml \
--report ./report.md
export ANTHROPIC_API_KEY="sk-ant-..."
export REFRAIN_API_KEY="rfn-eyJ..."
npx @refrainai/cli execute -- --runbook ./flow.yaml --api-key "rfn-eyJ..."