Browse Source

add(plugin): stagehand — Browserbase browser automation

Adapted from PR #43 by @Kylejeong2 (Browserbase). PR's marketplace.json
had a syntax error (missing '},' before adjacent entry); entry
reconstructed from the diff.
Original: https://github.com/anthropics/claude-plugins-official/pull/43
Tobin South 6 months ago
parent
commit
328a0a7190

+ 24 - 0
.claude-plugin/marketplace.json

@@ -967,6 +967,30 @@
       "category": "security",
       "source": "./external_plugins/autofix-bot",
       "homepage": "https://github.com/anthropics/claude-plugins-public/tree/main/external_plugins/autofix-bot"
+    },
+    {
+      "name": "stagehand",
+      "description": "Browser automation skill for Claude Code using Stagehand. Automate web interactions, extract data, and navigate websites using natural language.",
+      "version": "0.1.0",
+      "author": {
+        "name": "Browserbase"
+      },
+      "source": {
+        "source": "github",
+        "repo": "browserbase/agent-browse"
+      },
+      "category": "automation",
+      "keywords": [
+        "browser",
+        "automation",
+        "stagehand",
+        "web-scraping"
+      ],
+      "homepage": "https://github.com/browserbase/agent-browse",
+      "strict": false,
+      "skills": [
+        "./.claude/skills/browser-automation"
+      ]
     }
   ]
 }

+ 13 - 0
external_plugins/stagehand/.claude-plugin/plugin.json

@@ -0,0 +1,13 @@
+{
+  "name": "stagehand",
+  "description": "Browser automation skill for Claude Code using Stagehand. Automate web interactions, extract data, and navigate websites using natural language.",
+  "version": "0.1.0",
+  "author": {
+    "name": "Browserbase"
+  },
+  "homepage": "https://github.com/browserbase/agent-browse",
+  "repository": "https://github.com/browserbase/agent-browse",
+  "keywords": ["browser", "automation", "stagehand", "web-scraping"],
+  "strict": false
+}
+  

+ 104 - 0
external_plugins/stagehand/README.md

@@ -0,0 +1,104 @@
+# Stagehand Browser Automation Plugin
+
+Browser automation skill for Claude Code using [Stagehand](https://github.com/browserbase/stagehand). This plugin enables Claude to automate web browser interactions, extract data, and navigate websites using natural language.
+
+## Installation
+
+Install the plugin from the Claude Code marketplace:
+
+```bash
+/plugin install stagehand@claude-plugin-directory
+```
+
+## Prerequisites
+
+This plugin requires the browser automation CLI tools to be installed separately. The CLI tools are available from the GitHub marketplace.
+
+### Step 1: Add the GitHub Marketplace
+
+```bash
+/plugin marketplace add browserbase/agent-browse
+```
+
+### Step 2: Install the Browser Automation CLI Plugin
+
+```bash
+/plugin install browser-automation@browser-tools
+```
+
+### Step 3: Set Up the CLI Tools
+
+After installing the browser-automation plugin, you need to set up the CLI tools:
+
+1. Navigate to the plugin directory (typically `~/.claude/plugins/browser-automation/`)
+2. Install dependencies and build:
+   ```bash
+   npm install
+   ```
+3. Link the browser command globally:
+   ```bash
+   npm link
+   ```
+4. Configure your Anthropic API key:
+   ```bash
+   export ANTHROPIC_API_KEY="your-api-key-here"
+   ```
+   Or use Claude Code's subscription token (recommended if you have Claude Pro/Max):
+   ```bash
+   claude setup-token
+   ```
+
+### Step 4: Verify Installation
+
+Test that the browser command is available:
+
+```bash
+browser navigate https://example.com
+```
+
+## Usage
+
+Once installed and configured, you can use natural language to automate browser tasks:
+
+- *"Go to Hacker News, get the top post comments, and summarize them"*
+- *"QA test http://localhost:3000 and fix any bugs you encounter"*
+- *"Extract product information from example.com/products"*
+
+Claude will automatically use the browser automation skill when you ask for web-related tasks.
+
+## Features
+
+- **Natural Language Control**: Describe browser actions in plain English
+- **Data Extraction**: Extract structured data from web pages
+- **Screenshot Capture**: Take screenshots for visual verification
+- **Persistent Sessions**: Browser state persists between commands
+- **Chrome Profile Integration**: Uses your Chrome profile for cookies and sessions
+
+## Troubleshooting
+
+### Chrome not found
+
+Install Chrome for your platform:
+- **macOS** or **Windows**: https://www.google.com/chrome/
+- **Linux**: `sudo apt install google-chrome-stable`
+
+### Browser command not found
+
+Make sure you've run `npm link` in the browser-automation plugin directory after installing it.
+
+### API Key Issues
+
+- If you have Claude Pro/Max, use `claude setup-token` (recommended)
+- Otherwise, export `ANTHROPIC_API_KEY` in your terminal
+- Or create a `.env` file in the plugin directory with your API key
+
+## Resources
+
+- [Stagehand Documentation](https://github.com/browserbase/stagehand)
+- [GitHub Marketplace](https://github.com/browserbase/agent-browse)
+- [Claude Code Skills Documentation](https://code.claude.com/docs/en/plugins)
+
+## Support
+
+For issues or questions, please visit the [GitHub repository](https://github.com/browserbase/agent-browse).
+