Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Overwrite browser-use skill installs

Laith Weinbergerc8e386959d33
diff --git a/browser_use/skill_cli/commands/skill.py b/browser_use/skill_cli/commands/skill.py
index 292240e0a..f7faabccf 100644
--- a/browser_use/skill_cli/commands/skill.py
+++ b/browser_use/skill_cli/commands/skill.py
@@ -82,7 +82,11 @@ def _build_parser() -> argparse.ArgumentParser:
type=Path,
help='Custom output directory or SKILL.md path',
)
- install.add_argument('--force', action='store_true', help='Overwrite an existing SKILL.md')
+ install.add_argument(
+ '--force',
+ action='store_true',
+ help='Accepted for compatibility; install overwrites existing SKILL.md files by default',
+ )
install.add_argument(
'--no-install',
action='store_true',
@@ -128,14 +132,7 @@ def handle(argv: list[str]) -> int:
print(f'Error: {exc}', file=sys.stderr)
return 1
- output_paths = _resolve_output_paths(args.target, args.path)
- existing = [path for path in output_paths if path.exists()]
- if existing and not args.force:
- paths = ', '.join(str(path) for path in existing)
- print(f'Error: {paths} already exists. Use --force to overwrite.', file=sys.stderr)
- return 1
-
- for output_path in output_paths:
+ for output_path in _resolve_output_paths(args.target, args.path):
output_path.parent.mkdir(parents=True, exist_ok=True)
output_path.write_text(text, encoding='utf-8')
print(f'Installed Browser Use skill to {output_path}')
diff --git a/tests/ci/test_browser_use_skill_install_docs.py b/tests/ci/test_browser_use_skill_install_docs.py
index 4e501f81f..6364e1714 100644
--- a/tests/ci/test_browser_use_skill_install_docs.py
+++ b/tests/ci/test_browser_use_skill_install_docs.py
@@ -79,6 +79,14 @@ def test_browser_use_skill_cli_installs_browser_harness_package_skill(tmp_path):
bin_dir = _fake_browser_harness_tools(tmp_path, '---\nname: browser-harness\n---\n\n# Browser Harness\n')
home = tmp_path / 'home'
+ for stale in (
+ home / '.claude' / 'skills' / 'browser-use' / 'SKILL.md',
+ home / '.codex' / 'skills' / 'browser-use' / 'SKILL.md',
+ home / '.agents' / 'skills' / 'browser-use' / 'SKILL.md',
+ ):
+ stale.parent.mkdir(parents=True)
+ stale.write_text('stale browser-use skill', encoding='utf-8')
+
uv_args = tmp_path / 'uv-args.txt'
env = os.environ.copy()
env['HOME'] = str(home)