Skip to content

feat: add @browseragentprotocol/cli package#4

Merged
pyyush merged 6 commits intomainfrom
feat/cli
Feb 18, 2026
Merged

feat: add @browseragentprotocol/cli package#4
pyyush merged 6 commits intomainfrom
feat/cli

Conversation

@pyyush
Copy link
Contributor

@pyyush pyyush commented Feb 17, 2026

Summary

  • Adds the @browseragentprotocol/cli package — AI-native browser automation from the command line
  • Like playwright-cli but with composite actions (bap act), semantic selectors, and structured extraction
  • 26 commands, 10 selector types, 58 unit tests, SKILL.md for AI agent integration
  • Background daemon server architecture — persists across CLI invocations
  • Skill installer supports 13 AI coding agent platforms (Claude Code, Cursor, Copilot, etc.)

What's included

Core infrastructure:

  • src/cli.ts — main entry, argv parsing, server lifecycle
  • src/server/manager.ts — detached daemon with PID file at ~/.bap/server.pid
  • src/selectors/parser.ts — 10 selector types including e<N> playwright-cli compat
  • src/selectors/composite-parser.tsbap act step syntax parser
  • src/output/.bap/ directory management, concise AI-friendly output formatting
  • src/config/state.ts — global flags + ~/.bap/config.json persistence

Commands (26):
Navigation: open, goto, back, forward, reload
Interaction: click, fill, type, press, select, check, uncheck, hover
Observation: observe, snapshot, screenshot
Killer features: act (composite), extract (structured), config, recipe
Sessions: sessions, tabs, tab-new, tab-select, frames, frame-switch
Utility: eval, close, close-all, install-skill

Skill files:

  • skills/bap-browser/SKILL.md — teaches AI agents how to use the CLI
  • skills/bap-browser/agents/openai.yaml — OpenAI Codex agent config
  • skills/bap-browser/references/SELECTORS.md, MIGRATION.md

Tests: 58 unit tests (selector parsing + composite step parsing)

Test plan

  • pnpm build — all 7 packages build successfully
  • pnpm typecheck — 10/10 packages pass
  • pnpm test — 8/8 packages pass (CLI: 58/58 tests)
  • pnpm lint — 0 errors/warnings
  • Local E2E: bap open https://example.com --headlessbap configbap install-skill --dry-runbap close-all
  • npm pack --dry-run — 15.1 KB, 8 files

AI-native browser automation from the command line. Like playwright-cli
but with composite actions (bap act), semantic selectors, and structured
extraction.

Key features:
- Composite actions: execute multi-step flows in one command (40x token reduction)
- Semantic selectors: role:, text:, label:, placeholder:, testid:, css:, xpath:, coords:
- Structured extraction: --fields, --schema, --list modes
- Smart observation: --full, --forms, --navigation, --max filters
- Background daemon server: persists across CLI invocations
- Skill installer: supports 13 AI coding agent platforms
- Full playwright-cli compatibility (e<N> refs, all basic commands)

Commands: open, goto, click, fill, type, press, select, check, uncheck,
hover, screenshot, snapshot, observe, act, extract, config, recipe,
sessions, tabs, tab-new, tab-select, frames, frame-switch, eval, close,
close-all, install-skill

Includes 58 unit tests (selector parsing + composite step parsing),
SKILL.md for AI agent integration, and migration guide from playwright-cli.
…ations

- Lead with CLI as primary interface for AI agents, MCP as secondary
- Add integration instructions for Claude Code, Claude Desktop, Codex CLI,
  Codex Desktop, Gemini CLI, and Manus
- Add CLI SKILL.md at repo root for discoverability
- Add architecture diagram showing CLI and MCP paths side-by-side
- Reorder packages table to put CLI and MCP first
- Add selector reference table
- Add bap install-skill section for 13+ agent platforms
- Trim description to ~300 chars for optimal metadata tier cost
- Add Error Handling section with 8 common failure/fix patterns
- Fix heading hierarchy (H3 after H1 → consistent H2 usage)
- Improve progressive disclosure (reference SELECTORS.md for details)
- Remove markdown file link that triggered false validation failure
- All 20 validation checks pass, all 9 lint rules pass
Add 6 fused operations (observe-act-observe, navigate-observe,
incremental observe, selector caching, response tiers, speculative
prefetch) across protocol, server, client, MCP, and CLI packages.

Harden for production: fix speculative prefetch race condition with
5-guard rewrite, add element registry max size cap (LRU eviction),
comprehensive client cleanup on disconnect, structured request logging
with client/request IDs and timing, multi-node CI matrix with coverage
reporting, and community docs (CONTRIBUTING.md, SECURITY.md).

Add fusion schema validation tests and element registry eviction tests.
Add fused navigate+observe, act+post-observe, response tiers, and
--observe/--tier flags to all three SKILL.md files (root, CLI package,
MCP skills directory). Update recipes and efficiency rules.
@pyyush pyyush merged commit a6bfa2d into main Feb 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant