CLI tool for browser automation and debugging, designed for AI agents.
webctl captures DevTools data (console logs, network requests, JS errors) that standard web fetching tools cannot access. CDP events are ephemeral - you must be listening when they occur. webctl solves this with a persistent daemon that buffers events for later query.
brew tap p3bot/tap
brew trust p3bot/tap
brew install p3bot/tap/webctlgo build -o webctl ./cmd/webctlDaemon + stateless command model:
webctl start # Launch browser, buffer CDP events
webctl console # Query buffered console logs
webctl click ".selector" # Send commands
webctl reload # Refresh current page
webctl stop # Clean shutdownUnder active development.
- Daemon with CDP event buffering (console, network)
- IPC via Unix socket
- CLI framework (Cobra) with abbreviation expansion and JSON output
- Lifecycle:
start,stop(with--forcereaper),status,clear - Navigation:
navigate,reload,back,forward - Tabs:
tab(list, switch, new, close) - Observation:
html,markdown,css,console,network,cookies,screenshot,eval - Interaction:
click,type,select,scroll,focus,key - Synchronisation:
ready(page load, selector, network idle, JS condition) - Local server:
serve(static files or reverse proxy with hot reload)
webctl start --attach: connect to an existing CDP endpoint instead of launching a new browser
| Category | Commands |
|---|---|
| Lifecycle | start, stop, status, clear |
| Navigation | navigate, reload, back, forward |
| Tabs | tab |
| Observation | html, markdown, css, console, network, cookies, screenshot, eval |
| Interaction | click, type, select, scroll, focus, key |
| Synchronisation | ready |
| Local server | serve |
webctl start --headless &
webctl navigate https://localhost:3000
webctl console # Check for JS errors
# ... agent fixes code ...
webctl reload
webctl console # Verify fix
webctl stopThe following software packages and systems work well when used side by side with webctl:
- Snag: Snag web pages via Chromium/Chrome to markdown
- Kagi: CLI access to the Kagi FastGPT internet search
- agentation: Point at problems, not code
MPL-2.0