Skip to main content

bap plan

Observe the current page and get AI-suggested actions for achieving a goal. Useful for autonomous agents that need to decide what to do next.

Usage

bap plan "login to the site"
goal
string
required
A natural language description of what you want to accomplish.
--max
number
default:"10"
Maximum number of suggestions to return.

Output

Plan for: "login to the site"
Page: https://app.example.com/login
Elements: 8 interactive

Suggested actions:
  1. Fill the email field with your username (85% match)
  2. Fill the password field with your password (85% match)
  3. Click the "Sign in" button to submit (90% match)
  4. Click "Forgot password?" if needed (20% match)

Use bap act to execute actions, or bap observe for full element list
Each suggestion includes:
  • Description — What the action does
  • Method — The BAP protocol method to call
  • Relevance — How relevant the action is to the stated goal (0-100%)
bap plan analyzes the current page state and matches interactive elements against your goal. It does not execute any actions — it only suggests them.

JSON Output

With --format=json, the output includes full structured data:
{
  "url": "https://app.example.com/login",
  "title": "Login",
  "elements": [...],
  "suggestions": [
    {
      "description": "Fill the email field",
      "method": "action/fill",
      "relevance": 0.85
    }
  ],
  "totalElements": 8
}
Use bap plan as a decision-making step in autonomous agent loops. It observes the page and ranks possible actions by relevance to your goal, so the agent can pick the best next step.