Overview
Thegenerate command opens a browser, lets AI explore your web app based on a goal you describe, and outputs a structured runbook. The runbook can then be executed unlimited times with zero AI cost.
Prerequisites
- Node.js 18 or later
- An AI provider API key (see Set Up Your AI Provider)
- A context file (recommended) describing the target app
Step-by-step
Prepare context and secrets
Create a If the workflow needs credentials, create a
context.md file with supplementary information about your target app — login URLs, navigation hints, special UI patterns, and business rules:secrets.json file. All values are treated as sensitive and masked in logs:Run the generate command
| Flag | Description |
|---|---|
--url | Start URL (required) |
--goal | What AI should accomplish (required) |
--output | Where to save the runbook (required) |
--context | Path to context markdown file |
--secrets | Path to secrets JSON file |
--headless false | Show the browser window to watch AI in action |
Watch AI explore (optional)
With
--headless false, you can watch AI navigate your app in real time.If AI gets stuck or goes off track, you can intervene by pressing Enter or p to pause, then provide guidance or abort.AI will also detect when it’s stuck in a loop and ask for your guidance automatically.Review the generated steps
After exploration, AI reviews all recorded steps:
- Removes unnecessary steps (redundant clicks, accidental navigations)
- Assigns risk levels (
low,medium,high) to each step - Flags high-risk steps for approval (
requiresConfirmation: true)
Tips for better results
- Be specific in your goal — “Log in with email and password, then export the user list as CSV” is better than “Do some stuff on the admin page”
- Provide rich context — The more information in
context.md, the fewer wrong turns AI takes. Include login credentials, page structure notes, and expected behavior. - Use
--headless false— Watching the exploration helps you catch issues early and provide guidance when needed. - Start with simple goals — Break complex workflows into smaller goals, generate separate runbooks, then chain them.
Troubleshooting
AI gets stuck or goes in circles
AI gets stuck or goes in circles
Press Enter to pause and provide guidance like “Click the Settings menu first” or “The button is at the bottom of the page”. You can also increase
--max-iterations if the goal requires many steps.AI doesn't achieve the goal
AI doesn't achieve the goal
Check that your
context.md has enough detail about the target app. Try making the goal more specific. If the app uses bot detection, try --stealth mode.AI takes too many steps
AI takes too many steps
The review phase removes unnecessary steps. If the result still has too many, try a more focused goal or add guidance in
context.md about the optimal path.