opencli

Drives the user's logged-in Chrome browser via OpenCLI adapters and session commands.

197|85|Updated Jul 5, 2026
One-click install
npx skills add https://github.com/yan-labs/yan-skills --skill opencli-yan-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: opencli
Source: https://github.com/yan-labs/yan-skills/tree/main/opencli
Command: npx skills add https://github.com/yan-labs/yan-skills --skill opencli-yan-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Automating sites that require a logged-in session is fragile: sandbox browsers get anonymous results, parallel agents steal each other's tabs, and quota-limited sites like Semrush silently degrade. This Skill turns the user's real, logged-in Chrome into a scriptable resource with strict session, quota, and troubleshooting discipline. ## Core Features & Use Cases - Logged-in browser automation: Drive the user's actual Chrome (extension + local daemon) to read dashboards, fill forms, and extract tables from sites without APIs, using opencli browser <session> commands or 160+ site adapters. - Session and quota discipline: Enforces unique descriptive session names, fixed session names for quota-limited sites (Semrush, Similarweb), machine-level tool locks, and differential session cleanup so parallel agents never steal tabs. - Adapter authoring and self-repair: Write new opencli <site> <command> adapters with a strategy-selection framework, and diagnose broken adapters via trace artifacts with a 3-round repair budget. - Use Case: An agent needs keyword data from Semrush, which has no adapter. It runs pressure.mjs to check quota, opens a fixed semrush-nav session in background mode, extracts the report as one atomic batch, logs the access to site-access.jsonl, and closes the session—without ever stealing the user's focus. ## Quick Start Use the opencli skill to open my logged-in Chrome, check the GSC dashboard for my site, and extract the performance table into a JSON file.

Frequently Asked Questions about opencli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate a website that requires login with Chrome?

Use OpenCLI, which drives the user's real logged-in Chrome via a browser extension and local daemon. Run `opencli doctor` first, then use `opencli browser <session> open <url>` followed by `state`, `click`, and `eval` commands to interact with the authenticated page.

How to scrape data from a site with no API using browser automation?

First check `opencli list` for an existing site adapter, since adapters encapsulate known pitfalls. If none exists, drive the browser live: prefer the `network` command to capture JSON responses, then `extract` for long text, and `eval` only as a last resort.

Why do my browser automation tabs get stolen by other agents?

Tab theft happens when multiple tasks share the same session name, since identical names share one tab. Give each agent a unique descriptive session name, open all sessions before starting work, and never use `$$` in Bash tool calls because each invocation gets a new PID.

Does OpenCLI work with quota-limited sites like Semrush?

Yes, but quota sites need a fixed shared session name so the daemon serializes navigation, plus a machine-level tool lock held for the whole crawl. Run `pressure.mjs --tool semrush` before starting to check tab counts and lock ownership.

Why does opencli doctor report errors after a daemon restart?

The Chrome extension is an MV3 service worker that Chrome kills when idle, and a daemon restart does not wake it. Wake it by opening any page in Chrome with `open -g -a "Google Chrome" <url>`, or use the `daemon-restart-safe.mjs` script which handles this automatically.

When should I not use browser automation for data collection?

Skip the browser when a ready-made script, public API, or existing adapter can get the same data, and when the page is public content readable via curl. Browser automation is only justified when login state changes what the site returns.