mirror of
https://github.com/browser-use/browser-use.git
synced 2026-10-02 04:04:36 +08:00
feat: add first-party OpenClaw skill support (#5476)
Add OpenClaw as a Browser Use skill-install target and expose a validated uv installer for the Browser Use CLI.
This commit is contained in:
@@ -1,6 +1,24 @@
|
||||
---
|
||||
name: browser-use
|
||||
description: "Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work."
|
||||
homepage: https://browser-use.com
|
||||
metadata:
|
||||
{
|
||||
"openclaw":
|
||||
{
|
||||
"requires": { "bins": ["browser-use"] },
|
||||
"install":
|
||||
[
|
||||
{
|
||||
"id": "uv",
|
||||
"kind": "uv",
|
||||
"package": "browser-use",
|
||||
"bins": ["browser-use"],
|
||||
"label": "Install Browser Use CLI (uv)",
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
---
|
||||
|
||||
# Browser Use
|
||||
|
||||
@@ -6,6 +6,28 @@ import re
|
||||
from importlib import resources
|
||||
from pathlib import Path
|
||||
|
||||
# Browser Use-only frontmatter added while generating both checked-in SKILL.md copies.
|
||||
# Keep this as the source of truth; scripts/sync_browser_harness_skill.py verifies the outputs.
|
||||
OPENCLAW_METADATA_LINES = (
|
||||
'metadata:',
|
||||
' {',
|
||||
' "openclaw":',
|
||||
' {',
|
||||
' "requires": { "bins": ["browser-use"] },',
|
||||
' "install":',
|
||||
' [',
|
||||
' {',
|
||||
' "id": "uv",',
|
||||
' "kind": "uv",',
|
||||
' "package": "browser-use",',
|
||||
' "bins": ["browser-use"],',
|
||||
' "label": "Install Browser Use CLI (uv)",',
|
||||
' },',
|
||||
' ],',
|
||||
' },',
|
||||
' }',
|
||||
)
|
||||
|
||||
|
||||
def as_browser_use_skill(text: str) -> str:
|
||||
"""Expose the Browser Harness skill under the Browser Use skill identity."""
|
||||
@@ -39,6 +61,10 @@ def as_browser_use_skill(text: str) -> str:
|
||||
1,
|
||||
'description: "Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work."',
|
||||
)
|
||||
if not any(line.startswith('homepage:') for line in lines):
|
||||
lines.append('homepage: https://browser-use.com')
|
||||
if not any(line.startswith('metadata:') for line in lines):
|
||||
lines.extend(OPENCLAW_METADATA_LINES)
|
||||
|
||||
body = body.replace('# browser-harness', '# Browser Use', 1).replace('# Browser Harness', '# Browser Use', 1)
|
||||
# Rebrand every mention except repo URLs (github.com/browser-use/browser-harness/...)
|
||||
|
||||
@@ -29,6 +29,7 @@ TARGET_DIR_BUILDERS = {
|
||||
'copilot': lambda: _home_skill_dir('copilot'),
|
||||
'cursor': lambda: _home_skill_dir('cursor'),
|
||||
'gemini': lambda: _home_skill_dir('gemini'),
|
||||
'openclaw': lambda: _home_skill_dir('openclaw'),
|
||||
'opencode': lambda: _xdg_config_home() / 'opencode' / 'skills' / SKILL_NAME,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,24 @@
|
||||
---
|
||||
name: browser-use
|
||||
description: "Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work."
|
||||
homepage: https://browser-use.com
|
||||
metadata:
|
||||
{
|
||||
"openclaw":
|
||||
{
|
||||
"requires": { "bins": ["browser-use"] },
|
||||
"install":
|
||||
[
|
||||
{
|
||||
"id": "uv",
|
||||
"kind": "uv",
|
||||
"package": "browser-use",
|
||||
"bins": ["browser-use"],
|
||||
"label": "Install Browser Use CLI (uv)",
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
---
|
||||
|
||||
# Browser Use
|
||||
|
||||
@@ -12,6 +12,7 @@ EXPECTED_SKILL_INSTALL_PATHS = (
|
||||
Path('.copilot') / 'skills' / 'browser-use' / 'SKILL.md',
|
||||
Path('.cursor') / 'skills' / 'browser-use' / 'SKILL.md',
|
||||
Path('.gemini') / 'skills' / 'browser-use' / 'SKILL.md',
|
||||
Path('.openclaw') / 'skills' / 'browser-use' / 'SKILL.md',
|
||||
Path('.config') / 'opencode' / 'skills' / 'browser-use' / 'SKILL.md',
|
||||
)
|
||||
|
||||
@@ -86,6 +87,24 @@ def test_browser_use_cli_installs_browser_harness_package_skill(tmp_path):
|
||||
'---\n'
|
||||
'name: browser-use\n'
|
||||
'description: "Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work."\n'
|
||||
'homepage: https://browser-use.com\n'
|
||||
'metadata:\n'
|
||||
' {\n'
|
||||
' "openclaw":\n'
|
||||
' {\n'
|
||||
' "requires": { "bins": ["browser-use"] },\n'
|
||||
' "install":\n'
|
||||
' [\n'
|
||||
' {\n'
|
||||
' "id": "uv",\n'
|
||||
' "kind": "uv",\n'
|
||||
' "package": "browser-use",\n'
|
||||
' "bins": ["browser-use"],\n'
|
||||
' "label": "Install Browser Use CLI (uv)",\n'
|
||||
' },\n'
|
||||
' ],\n'
|
||||
' },\n'
|
||||
' }\n'
|
||||
'---\n\n'
|
||||
'# Browser Use\n'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user