Skip to main content

Observation

Commands for understanding what is on the page before interacting.

observe

AI-optimized page observation. Returns interactive elements with stable refs that you can pass to action commands.
bap observe

Flags

--full
flag
Return the full accessibility tree instead of just interactive elements.
--forms
flag
Return only form-related elements (textboxes, selects, checkboxes, etc.).
--navigation
flag
Return only navigation elements (links, nav items).
--max
number
default:"50"
Maximum number of elements to return.
--diff
flag
Incremental observation. Returns only changes since the last observation: elements added, updated, or removed.
--tier
string
default:"full"
Response tier controlling how much data is returned.

Response Tiers

TierWhat is includedWhen to use
fullAll fields, metadata, screenshotsFirst page load, debugging
interactiveInteractive elements, refs, rolesMost interactions
minimalRefs and names onlyRapid polling, confirmation checks
bap observe --tier=interactive --max=20

Incremental Observation

After performing an action, use --diff to see only what changed instead of re-scanning the entire page:
bap act click:role:button:"Load More"
bap observe --diff
The response includes changes: { added, updated, removed } — much smaller than a full observation.
Use --diff after small DOM changes (button clicks, form submissions). Use a full observe after navigation to a new page.

snapshot

Full YAML accessibility snapshot, compatible with playwright-cli.
bap snapshot
The snapshot includes the full accessibility tree in YAML format. Useful for debugging and for playwright-cli compatibility.
bap observe is preferred over bap snapshot for AI agents. It returns structured data with stable refs instead of raw YAML.