Skip to content

Commit bb137ce

Browse files
authored
feat: add opencli operate — browser control commands for Claude Code skill (#614)
Add `opencli operate` subcommand group with 15+ commands for step-by-step browser control, designed as a Claude Code skill. No LLM API key needed — Claude Code IS the LLM. Commands: Navigation: open, back, scroll Inspect: state, screenshot, get (title/url/text/value/html/attributes) Interact: click, type, select, keys Wait: wait selector/text/time Extract: eval (execute JS in page context) API Discovery: network (auto-captured since last open, --detail N) Sedimentation: init (generate adapter scaffold), verify (test adapter) Session: close Infrastructure: - CDP passthrough with 22-method allowlist - Two-layer retry for extension interference (aggressive for operate:*) - Network interceptor auto-injected on operate open - node_modules symlink for user TS adapter imports Skill: skills/opencli-operate/SKILL.md - Complete command reference - Sedimentation workflow guide (explore → network → init → verify) - Adapter strategy guide (PUBLIC/COOKIE/UI) - Dual quickstart (AI Agent 1 step / Human 3 steps)
1 parent 7d72038 commit bb137ce

24 files changed

Lines changed: 2325 additions & 948 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ docs/.vitepress/cache
2222

2323
# Database files
2424
*.db
25+
autoresearch/results/
26+
extension/dist/

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,24 @@ opencli hackernews top --limit 5 # Public API, no browser needed
8484
opencli bilibili hot --limit 5 # Browser command (requires Extension)
8585
```
8686

87+
### 4. Browser Automation — Make Websites Accessible for AI Agents
88+
89+
#### AI Agent Quickstart (1 step)
90+
91+
Point your AI agent (Claude Code, Cursor) to [`skills/opencli-operate/SKILL.md`](./skills/opencli-operate/SKILL.md). It has everything needed.
92+
93+
#### Human Quickstart (3 steps)
94+
95+
```bash
96+
opencli operate open https://news.ycombinator.com # 1. Open a page
97+
opencli operate state # 2. See interactive elements
98+
opencli operate eval "document.title" # 3. Extract data
99+
```
100+
101+
More commands: `click`, `type`, `select`, `keys`, `wait`, `get`, `screenshot`, `scroll`, `back`, `close`.
102+
103+
See [`skills/opencli-operate/SKILL.md`](./skills/opencli-operate/SKILL.md) for full documentation.
104+
87105
### Update
88106

89107
```bash

SKILL.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
name: opencli
3+
description: "OpenCLI — Make any website or Electron App your CLI. Zero risk, AI-powered, reuse Chrome login."
4+
version: 1.5.6
5+
author: jackwener
6+
tags: [cli, browser, web, chrome-extension, cdp, AI, agent, operate]
7+
---
8+
9+
# OpenCLI
10+
11+
> Make any website or Electron App your CLI. Reuse Chrome login, zero risk, AI-powered.
12+
13+
## Skills
14+
15+
OpenCLI has three specialized skills. Use the one that matches your task:
16+
17+
### 1. CLI Commands (`skills/cli/SKILL.md`)
18+
Use existing CLI commands to fetch data, interact with websites and desktop apps.
19+
```bash
20+
opencli twitter trending --limit 10
21+
opencli hackernews top --limit 5
22+
opencli bilibili hot
23+
```
24+
25+
### 2. Browser Automation (`skills/opencli-operate/SKILL.md`)
26+
Make websites accessible for AI agents. Navigate, click, type, extract, wait — with existing Chrome login sessions. No LLM API key needed.
27+
```bash
28+
opencli operate open https://example.com
29+
opencli operate state # See interactive elements with [N] indices
30+
opencli operate click 3 # Click element [3]
31+
opencli operate network # Discover APIs
32+
opencli operate init site/cmd # Generate adapter scaffold
33+
opencli operate verify site/cmd # Test the adapter
34+
```
35+
36+
### 3. Adapter Development (`skills/adapter-dev/SKILL.md`)
37+
Create new CLI commands from websites. Explore APIs, record traffic, write TypeScript adapters.
38+
```bash
39+
opencli explore https://example.com
40+
opencli record https://example.com
41+
opencli generate https://example.com --goal "hot"
42+
```
43+
44+
## Quick Setup
45+
46+
```bash
47+
npm install -g @jackwener/opencli
48+
opencli doctor # Verify Chrome extension + daemon
49+
```
50+
51+
## Configuration
52+
53+
```bash
54+
# For AI agent (opencli operate)
55+
export OPENCLI_PROVIDER=anthropic # or openai
56+
export OPENCLI_MODEL=sonnet # model alias
57+
export OPENCLI_API_KEY=sk-ant-... # API key
58+
export OPENCLI_BASE_URL=https://... # optional proxy
59+
```

autoresearch/baseline-browse.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
56/59

autoresearch/baseline-skill.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
31/31

0 commit comments

Comments
 (0)