Skip to content

feat: add agent-browser support for headless browser automation CLI#59

Merged
marcusquinn merged 1 commit intomainfrom
feature/agent-browser-support
Jan 12, 2026
Merged

feat: add agent-browser support for headless browser automation CLI#59
marcusquinn merged 1 commit intomainfrom
feature/agent-browser-support

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Jan 12, 2026

Summary

  • Add comprehensive agent-browser subagent documentation with full CLI reference
  • Add agent-browser-helper.sh for setup and management
  • Update browser-automation.md tool selection guide to include agent-browser
  • Update AGENTS.md subagent folder references

What is agent-browser?

agent-browser is a Vercel Labs project providing headless browser automation CLI optimized for AI agents:

  • Fast Rust CLI with Node.js fallback and Playwright-based daemon
  • Snapshot + ref pattern - deterministic element targeting from accessibility tree snapshots
  • Multi-session isolation - run parallel browser instances with --session
  • AI-optimized - --json output for machine parsing
  • Cross-platform - native binaries for macOS, Linux; Node.js fallback for Windows

Key Features

# AI-optimized workflow
agent-browser open example.com
agent-browser snapshot                    # Get accessibility tree with refs
agent-browser click @e2                   # Click by ref from snapshot
agent-browser fill @e3 "test@example.com" # Fill by ref
agent-browser close

Files Changed

File Purpose
.agent/tools/browser/agent-browser.md Full documentation with CLI reference
.agent/scripts/agent-browser-helper.sh Setup and management helper script
.agent/tools/browser/browser-automation.md Updated tool selection guide
.agent/AGENTS.md Updated subagent folder references

Testing

  • ShellCheck passes on new helper script
  • Markdown lint passes on new documentation
  • Follows existing browser tool documentation patterns

Summary by CodeRabbit

  • New Features

    • Introduced Agent Browser CLI as a new headless browser automation tool with AI-friendly JSON output.
    • Added setup helper utility for streamlined installation and configuration of Agent Browser and Chromium.
  • Documentation

    • Added comprehensive guide covering installation, commands, usage patterns, and feature comparison.
    • Updated browser automation documentation to include Agent Browser as a supported option.

✏️ Tip: You can customize this high-level summary in your review settings.

- Add agent-browser.md subagent documentation with full CLI reference
- Add agent-browser-helper.sh for setup and management
- Update browser-automation.md tool selection guide
- Update AGENTS.md subagent folder references

agent-browser is a Vercel Labs project providing:
- Fast Rust CLI with Node.js fallback
- Snapshot + ref pattern optimized for AI agents
- Multi-session browser isolation
- Cross-platform support (macOS, Linux, Windows)
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 12, 2026

Walkthrough

This pull request introduces agent-browser tooling documentation and a Bash helper script. Changes include adding agent-browser to the browser tools roster in AGENTS.md, creating comprehensive CLI documentation for agent-browser in a new markdown file, updating the browser automation guide to reference agent-browser, and introducing a setup/management script with installation, verification, and operational utilities.

Changes

Cohort / File(s) Summary
Documentation & Registry
.agent/AGENTS.md, .agent/tools/browser/browser-automation.md
Added agent-browser to the browser tools subagent list and updated cross-references in automation decision tree; minor documentation integration
Agent Browser Documentation
.agent/tools/browser/agent-browser.md
New comprehensive guide covering installation, architecture (Rust CLI with Node.js Playwright daemon), commands, JSON output formats, headed/agent modes, platform support, and usage patterns
Helper Script
.agent/scripts/agent-browser-helper.sh
New Bash CLI utility providing setup, installation, environment checks, status reporting, session management, and demo capabilities for agent-browser and Chromium provisioning

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🤖 A browser awakes in the shell's gentle call,
Chromium spinning, automation over all,
Scripts that install, and demos that dance,
Agent-browser takes the lead—click, snap, enhance! 🎯

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add agent-browser support for headless browser automation CLI' directly and accurately summarizes the main change: introducing agent-browser as a new headless browser automation tool with full documentation, helper script, and integration into the agent tooling ecosystem.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the project's browser automation capabilities by integrating agent-browser, a powerful CLI tool designed for AI agents. The changes include adding detailed documentation that covers its AI-optimized workflow, core commands, and architecture, alongside a new helper script to simplify its deployment and usage. Furthermore, existing project guides are updated to reflect the availability and recommended use cases for this new tool, ensuring that users can easily discover and leverage agent-browser for their automation needs.

Highlights

  • New agent-browser Integration: Introduces agent-browser, a headless browser automation CLI optimized for AI agents, complete with comprehensive documentation and a dedicated helper script.
  • Enhanced Browser Automation Guide: Updates the browser-automation.md guide to include agent-browser as a recommended tool for CLI-first and multi-session automation workflows.
  • Subagent Reference Update: Modifies AGENTS.md to properly list agent-browser within the browser automation subagent category.
  • Helper Script for Management: Adds agent-browser-helper.sh to streamline the installation, setup, status checking, and session management of agent-browser.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@sonarqubecloud
Copy link

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 309 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Mon Jan 12 00:19:17 UTC 2026: Code review monitoring started
Mon Jan 12 00:19:18 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 309
Mon Jan 12 00:19:18 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Mon Jan 12 00:19:20 UTC 2026: Codacy analysis completed with auto-fixes
Mon Jan 12 00:19:21 UTC 2026: Applied 1 automatic fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 309
  • VULNERABILITIES: 0

Generated on: Mon Jan 12 00:19:58 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for agent-browser, a headless browser automation tool, by adding a new helper script, comprehensive documentation, and updating existing guides. The changes are well-structured and the documentation is clear. My review focuses on improving the new agent-browser-helper.sh script's robustness and maintainability by addressing potential issues flagged by ShellCheck, such as unquoted variables and unsafe loop constructs. I've also suggested a correction in the browser-automation.md file to ensure the setup instructions for agent-browser are complete and consistent with other tools.

@@ -0,0 +1,311 @@
#!/bin/bash
# shellcheck disable=SC2034,SC2155,SC2317,SC2329,SC2016,SC2181,SC1091,SC2154,SC2015,SC2086,SC2129,SC2030,SC2031,SC2119,SC2120,SC2001,SC2162,SC2088,SC2089,SC2090,SC2029,SC2006,SC2153

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Disabling a large number of ShellCheck warnings globally can hide real bugs and makes the script harder to maintain. This is especially concerning for warnings like SC2086 (unquoted variables) which point to potential robustness issues. It's better to disable specific warnings on a case-by-case basis with a comment explaining why, or preferably, to fix the underlying code to be compliant.

Comment on lines +99 to +105
local with_deps=""
if [[ "$(uname)" == "Linux" ]]; then
print_info "Linux detected - installing with system dependencies"
with_deps="--with-deps"
fi

if agent-browser install $with_deps; then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The $with_deps variable is unquoted, which can lead to unexpected behavior due to word splitting and globbing if the variable contained spaces. While it works in this specific case, it's not a robust practice. Using an array for optional arguments is a safer way to build commands.

Suggested change
local with_deps=""
if [[ "$(uname)" == "Linux" ]]; then
print_info "Linux detected - installing with system dependencies"
with_deps="--with-deps"
fi
if agent-browser install $with_deps; then
local install_args=()
if [[ "$(uname)" == "Linux" ]]; then
print_info "Linux detected - installing with system dependencies"
install_args+=("--with-deps")
fi
if agent-browser install "${install_args[@]}"; then

Comment on lines +171 to +182
local sessions
sessions=$(agent-browser session list 2>/dev/null | grep -E '^\s*\w+' | awk '{print $1}')

if [[ -z "$sessions" ]]; then
print_info "No active sessions to close"
return 0
fi

for session in $sessions; do
print_info "Closing session: $session"
AGENT_BROWSER_SESSION="$session" agent-browser close 2>/dev/null || true
done

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current method of parsing session names and iterating over them is not robust and will fail if session names contain spaces or other special characters. Using mapfile to read the session names into an array and then iterating over the array is a safer and more robust approach. This also allows for combining the grep and awk commands for better efficiency.

Suggested change
local sessions
sessions=$(agent-browser session list 2>/dev/null | grep -E '^\s*\w+' | awk '{print $1}')
if [[ -z "$sessions" ]]; then
print_info "No active sessions to close"
return 0
fi
for session in $sessions; do
print_info "Closing session: $session"
AGENT_BROWSER_SESSION="$session" agent-browser close 2>/dev/null || true
done
local sessions_array=()
mapfile -t sessions_array < <(agent-browser session list 2>/dev/null | awk '/^\s*\w+/ {print $1}')
if [[ ${#sessions_array[@]} -eq 0 ]]; then
print_info "No active sessions to close"
return 0
fi
for session in "${sessions_array[@]}"; do
print_info "Closing session: $session"
AGENT_BROWSER_SESSION="$session" agent-browser close 2>/dev/null || true
done

| Tool | Best For | Setup |
|------|----------|-------|
| **dev-browser** (DEFAULT) | Dev testing, multi-step workflows | `dev-browser-helper.sh setup` |
| **agent-browser** | CLI-first, shell scripts, CI/CD, multi-session | `npm i -g agent-browser` |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The setup command for agent-browser is incomplete. It only installs the CLI via npm but misses the step to install the required Chromium browser. For consistency with other tools in this table (like dev-browser), it would be better to point to the new helper script's setup command, which performs a full installation.

Suggested change
| **agent-browser** | CLI-first, shell scripts, CI/CD, multi-session | `npm i -g agent-browser` |
| **agent-browser** | CLI-first, shell scripts, CI/CD, multi-session | `agent-browser-helper.sh setup` |

@marcusquinn marcusquinn merged commit 72e5054 into main Jan 12, 2026
14 of 17 checks passed
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @.agent/scripts/agent-browser-helper.sh:
- Around line 8-10: The script currently unconditionally sources
shared-constants.sh using SCRIPT_DIR and source, which will produce an unclear
error if the file is missing; update the block to verify the file exists (test
-f or [[ -f ]]) at "${SCRIPT_DIR}/shared-constants.sh" before calling source,
and if it does not exist emit a clear error via echo or logger and exit
non‑zero; keep references to SCRIPT_DIR and the filename so the check and error
message point to the exact missing file.
- Around line 57-66: The check_chromium function currently calls the
agent-browser CLI unconditionally; first verify the agent-browser command exists
(e.g., via command -v or type) and if missing call print_warning like
"agent-browser CLI not found" and return non-zero, otherwise proceed to run
agent-browser install --check as before and handle its exit status; update
check_chromium to perform this pre-check so missing CLI yields a clear warning
instead of a "command not found" error.
🧹 Nitpick comments (4)
.agent/scripts/agent-browser-helper.sh (4)

1-2: Blanket ShellCheck suppressions mask potential issues.

Disabling 18+ ShellCheck rules globally is excessive. Several of these rules catch real bugs (SC2086 for word splitting, SC2181 for exit code anti-patterns, SC1091 for missing source files). Consider using targeted inline directives only where genuinely needed, rather than a blanket suppression at the top.


98-105: Consider explicit handling for optional flag.

The unquoted $with_deps on line 105 relies on word-splitting to handle the empty case. While intentional, this pattern is clearer with explicit conditional invocation.

♻️ Optional improvement
-    # Detect platform for deps
-    local with_deps=""
-    if [[ "$(uname)" == "Linux" ]]; then
-        print_info "Linux detected - installing with system dependencies"
-        with_deps="--with-deps"
-    fi
-    
-    if agent-browser install $with_deps; then
+    # Detect platform for deps
+    local install_cmd=("agent-browser" "install")
+    if [[ "$(uname)" == "Linux" ]]; then
+        print_info "Linux detected - installing with system dependencies"
+        install_cmd+=("--with-deps")
+    fi
+    
+    if "${install_cmd[@]}"; then

166-186: Session parsing is fragile and failures are silently swallowed.

The grep/awk pipeline on line 172 depends on the exact output format of agent-browser session list. If this format changes, sessions won't be closed. Additionally, using || true on line 181 silently ignores close failures—consider at least logging when a close fails.

♻️ Suggested improvement
     for session in $sessions; do
         print_info "Closing session: $session"
-        AGENT_BROWSER_SESSION="$session" agent-browser close 2>/dev/null || true
+        if ! AGENT_BROWSER_SESSION="$session" agent-browser close 2>/dev/null; then
+            print_warning "Failed to close session: $session"
+        fi
     done

188-221: Demo lacks error handling for intermediate steps.

If agent-browser open (line 199) fails, subsequent commands will produce confusing errors. For a robust demo experience, check each step's exit status and bail early with clear feedback.

♻️ Suggested improvement
     print_info "1. Opening example.com..."
-    agent-browser open https://example.com
+    if ! agent-browser open https://example.com; then
+        print_error "Failed to open page - aborting demo"
+        return 1
+    fi
     
     echo ""
     print_info "2. Getting snapshot (accessibility tree)..."
-    agent-browser snapshot -i
+    if ! agent-browser snapshot -i; then
+        print_warning "Snapshot failed - continuing demo"
+    fi

Apply similar checks to subsequent steps as appropriate.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bfe57c1 and 2c9b6b3.

📒 Files selected for processing (4)
  • .agent/AGENTS.md
  • .agent/scripts/agent-browser-helper.sh
  • .agent/tools/browser/agent-browser.md
  • .agent/tools/browser/browser-automation.md
🧰 Additional context used
📓 Path-based instructions (1)
.agent/scripts/*.sh

⚙️ CodeRabbit configuration file

.agent/scripts/*.sh: Automation scripts - focus on:

  • Reliability and robustness
  • Clear logging and feedback
  • Proper exit codes
  • Error recovery mechanisms

Files:

  • .agent/scripts/agent-browser-helper.sh
🧠 Learnings (10)
📓 Common learnings
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T04:34:27.158Z
Learning: All instructions, documentation, and operational guidance should be maintained in AGENTS.md as the single source of truth
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-11-29T04:34:30.742Z
Learning: Maintain all instructions, documentation, and operational guidance in AGENTS.md as the single source of truth
📚 Learning: 2025-11-29T04:34:42.033Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENT.md:0-0
Timestamp: 2025-11-29T04:34:42.033Z
Learning: Reference AGENTS.md (authoritative) instead of AGENT.md for AI assistant guidance

Applied to files:

  • .agent/tools/browser/browser-automation.md
  • .agent/AGENTS.md
  • .agent/tools/browser/agent-browser.md
📚 Learning: 2025-11-29T04:34:30.742Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-11-29T04:34:30.742Z
Learning: Reference AGENTS.md for authoritative AI assistant guidance instead of GEMINI.md

Applied to files:

  • .agent/tools/browser/browser-automation.md
  • .agent/AGENTS.md
  • .agent/tools/browser/agent-browser.md
📚 Learning: 2026-01-06T15:57:56.008Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T15:57:56.008Z
Learning: Applies to **/AGENTS.md : Use progressive disclosure in AGENTS.md with pointers to subagents rather than inline content

Applied to files:

  • .agent/AGENTS.md
📚 Learning: 2025-11-29T04:34:27.158Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T04:34:27.158Z
Learning: All instructions, documentation, and operational guidance should be maintained in AGENTS.md as the single source of truth

Applied to files:

  • .agent/tools/browser/agent-browser.md
📚 Learning: 2025-11-29T04:34:30.742Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-11-29T04:34:30.742Z
Learning: Maintain all instructions, documentation, and operational guidance in AGENTS.md as the single source of truth

Applied to files:

  • .agent/tools/browser/agent-browser.md
📚 Learning: 2025-11-29T04:34:42.033Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENT.md:0-0
Timestamp: 2025-11-29T04:34:42.033Z
Learning: Maintain all AI assistant instructions, documentation, and operational guidance in AGENTS.md as the single source of truth

Applied to files:

  • .agent/tools/browser/agent-browser.md
📚 Learning: 2026-01-06T15:57:56.007Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T15:57:56.007Z
Learning: Applies to **/setup.sh : Deploy agents locally using ./setup.sh script

Applied to files:

  • .agent/scripts/agent-browser-helper.sh
📚 Learning: 2026-01-06T15:57:56.007Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T15:57:56.007Z
Learning: Applies to **/.agent/scripts/version-manager.sh : Use .agent/scripts/version-manager.sh release [major|minor|patch] for releases

Applied to files:

  • .agent/scripts/agent-browser-helper.sh
📚 Learning: 2026-01-06T15:57:56.007Z
Learnt from: CR
Repo: marcusquinn/aidevops PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-06T15:57:56.007Z
Learning: Applies to **/.agent/scripts/linters-local.sh : Run quality checks before committing using .agent/scripts/linters-local.sh

Applied to files:

  • .agent/scripts/agent-browser-helper.sh
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (19)
.agent/tools/browser/browser-automation.md (3)

46-47: LGTM - Clean integration into decision tree.

The CLI-first branch is appropriately positioned and aligns with agent-browser's primary use case. The placement between dev-browser and Playwriter follows a logical hierarchy (default → CLI → existing sessions).


60-60: LGTM - Quick reference entry is complete and accurate.

The table entry concisely captures agent-browser's key characteristics (CLI-first, shell scripts, CI/CD, multi-session) and provides the correct installation command.


66-66: LGTM - Documentation reference updated correctly.

The full docs line now includes agent-browser.md, maintaining consistency with the existing pattern and providing users a clear path to detailed documentation.

.agent/AGENTS.md (1)

383-383: LGTM - Subagent roster updated correctly.

agent-browser is now listed as a key subagent for browser automation. The placement at the beginning of the list aligns with the decision tree prioritization shown in browser-automation.md (dev-browser as default, agent-browser as CLI-first alternative).

.agent/tools/browser/agent-browser.md (11)

1-13: LGTM - Front matter configuration is correct.

The subagent metadata follows the established pattern with appropriate tool permissions for a documentation-focused subagent (read-only with bash for CLI execution).


46-70: LGTM - Installation instructions follow Playwright patterns.

The installation steps are well-structured with npm, Linux dependencies, and source build options. The npx playwright install-deps chromium command is valid Playwright syntax. Verification of the agent-browser install command is covered by the previous verification request.


72-118: LGTM - AI workflow pattern is well-documented.

The snapshot + ref pattern is a strong approach for LLM-driven automation, providing deterministic element targeting similar to dev-browser's ARIA snapshots. The progressive disclosure of snapshot options (-i, -c, -d, -s) with clear examples aids adoption.


120-342: LGTM - Comprehensive CLI reference with clear examples.

The command documentation is thorough and well-organized into logical categories. The syntax follows consistent patterns, and examples demonstrate practical usage. The commands align with Playwright's API surface, which is expected for a Playwright-based daemon.


344-362: LGTM - Agent and headed modes documented clearly.

The --json flag for machine-readable output and --headed for debugging are standard patterns in headless browser tools. The JSON structure example is helpful for integration.


364-372: Architecture description is clear and logical.

The client-daemon architecture with Rust CLI and Node.js daemon is well-explained. The persistent daemon design makes sense for fast subsequent operations. Verification of these architectural claims is covered by the earlier repository check.


374-382: LGTM - Platform support table is clear.

The platform support matrix explicitly documents native Rust binary availability and Node.js fallback strategy. Windows using Node.js-only is clearly indicated, setting appropriate expectations.


384-406: LGTM - Tool comparison provides clear differentiation.

The comparison table and "When to Use" guidance help users select the right tool for their use case. The characterizations align with the documentation for dev-browser, Playwriter, and Stagehand referenced elsewhere in the framework.


408-458: LGTM - Common patterns demonstrate practical workflows.

The four examples (login, form submission, data extraction, multi-session) cover typical automation scenarios. The consistent use of snapshot + ref pattern reinforces the recommended workflow throughout the documentation.


460-464: LGTM - Resource links and metadata provided.

The resources section provides the GitHub repository, license, and language composition. The language breakdown (74% TypeScript, 22% Rust) aligns with the documented architecture. Repository verification was requested earlier.


19-24: All documentation references are accurate and current. The GitHub repository (https://github.com/vercel-labs/agent-browser) exists and is active, the npm package (agent-browser v0.4.0) is available, and the installation instructions are correct. The architecture description ("Fast Rust CLI with Node.js fallback, Playwright-based daemon") is confirmed in the official README.

.agent/scripts/agent-browser-helper.sh (4)

19-42: LGTM!

Clean helper functions with consistent formatting. Good practice directing error output to stderr.


115-136: LGTM!

Solid setup flow with proper error propagation and helpful quick-start guidance. Clean implementation.


223-271: LGTM!

Comprehensive and well-structured help documentation with clear examples covering both helper commands and direct CLI usage.


273-311: LGTM!

Clean command dispatch pattern with sensible defaults and proper exit code on unknown commands.

Comment on lines +8 to +10
# Source shared constants and functions
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/shared-constants.sh"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Add existence check before sourcing external file.

If shared-constants.sh is missing, the script will fail with an unclear error. Add a guard for better error recovery and user feedback.

🛠️ Proposed fix
 # Source shared constants and functions
 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+if [[ ! -f "${SCRIPT_DIR}/shared-constants.sh" ]]; then
+    echo "[ERROR] Missing required file: ${SCRIPT_DIR}/shared-constants.sh" >&2
+    exit 1
+fi
 source "${SCRIPT_DIR}/shared-constants.sh"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Source shared constants and functions
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/shared-constants.sh"
# Source shared constants and functions
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [[ ! -f "${SCRIPT_DIR}/shared-constants.sh" ]]; then
echo "[ERROR] Missing required file: ${SCRIPT_DIR}/shared-constants.sh" >&2
exit 1
fi
source "${SCRIPT_DIR}/shared-constants.sh"
🤖 Prompt for AI Agents
In @.agent/scripts/agent-browser-helper.sh around lines 8 - 10, The script
currently unconditionally sources shared-constants.sh using SCRIPT_DIR and
source, which will produce an unclear error if the file is missing; update the
block to verify the file exists (test -f or [[ -f ]]) at
"${SCRIPT_DIR}/shared-constants.sh" before calling source, and if it does not
exist emit a clear error via echo or logger and exit non‑zero; keep references
to SCRIPT_DIR and the filename so the check and error message point to the exact
missing file.

Comment on lines +57 to +66
# Check if Chromium is installed
check_chromium() {
if agent-browser install --check 2>/dev/null; then
print_success "Chromium browser is installed"
return 0
else
print_warning "Chromium browser not found"
return 1
fi
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

check_chromium assumes agent-browser is installed.

This function calls agent-browser install --check without first verifying the CLI is present. If agent-browser isn't installed, the user gets a confusing "command not found" error rather than a helpful message.

🛠️ Proposed fix
 # Check if Chromium is installed
 check_chromium() {
+    if ! command -v agent-browser &> /dev/null; then
+        print_warning "Cannot check Chromium - agent-browser not installed"
+        return 1
+    fi
     if agent-browser install --check 2>/dev/null; then
         print_success "Chromium browser is installed"
         return 0
🤖 Prompt for AI Agents
In @.agent/scripts/agent-browser-helper.sh around lines 57 - 66, The
check_chromium function currently calls the agent-browser CLI unconditionally;
first verify the agent-browser command exists (e.g., via command -v or type) and
if missing call print_warning like "agent-browser CLI not found" and return
non-zero, otherwise proceed to run agent-browser install --check as before and
handle its exit status; update check_chromium to perform this pre-check so
missing CLI yields a clear warning instead of a "command not found" error.

@augmentcode
Copy link

augmentcode bot commented Jan 12, 2026

🤖 Augment PR Summary

Summary: Adds agent-browser as a supported browser automation option (CLI-first headless automation optimized for AI agents).

Changes:

  • Adds .agent/tools/browser/agent-browser.md with workflow guidance, full CLI reference, sessions, and JSON output notes.
  • Adds .agent/scripts/agent-browser-helper.sh to install the CLI, install Chromium, check status, manage sessions, and run a demo.
  • Updates .agent/tools/browser/browser-automation.md decision tree + quick reference to recommend agent-browser for shell/CI workflows.
  • Updates .agent/AGENTS.md browser tools index to include agent-browser.

Technical Notes: Highlights the snapshot + ref pattern for deterministic element targeting, multi-session isolation via --session, and machine-readable --json output for agent parsing.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.


# Check if Chromium is installed
check_chromium() {
if agent-browser install --check 2>/dev/null; then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The upstream docs show agent-browser install / agent-browser install --with-deps, but I don’t see an install --check flag; if unsupported, check_chromium() will always report missing Chromium even when installed.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

print_info "5. Closing browser..."
agent-browser close

print_success "Demo complete!"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

demo() always prints Demo complete! and returns success, even if one of the agent-browser ... steps fails (since there’s no strict-mode or per-step error handling). That can make troubleshooting harder when agent-browser isn’t fully set up.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

| Tool | Best For | Setup |
|------|----------|-------|
| **dev-browser** (DEFAULT) | Dev testing, multi-step workflows | `dev-browser-helper.sh setup` |
| **agent-browser** | CLI-first, shell scripts, CI/CD, multi-session | `npm i -g agent-browser` |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quick-reference setup for agent-browser is missing the agent-browser install step (Chromium download); following the table as-is may leave users with a non-working install until they discover the extra command.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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