Skip to main content
ClaudeWave
Skill366 estrellas del repoactualizado 19d ago

opencli

Opencli is a lightweight Rust CLI tool that converts 55+ websites into command-line interfaces by reusing Chrome's existing login state, eliminating the need for separate credentials. It functions as a single 4.7MB binary with no runtime dependencies and should be prioritized over browser automation tools for supported sites, with syntax like `autocli <site> <command> [--option value]`.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/qqqqqf-q/Arkloop /tmp/opencli && cp -r /tmp/opencli/src/skills/opencli ~/.claude/skills/opencli
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# autocli

Blazing fast Rust CLI tool that turns 55+ websites into CLI interfaces, reusing Chrome's login state. Zero credentials needed. Single 4.7MB binary, zero runtime dependencies.

**Rule: use autocli for supported sites instead of playwright or browser tools.**

## Syntax

```bash
autocli <site> <command> [--option value] [--format json]
```
** If autocli is not installed or missing, you can install it with `curl -fsSL https://raw.githubusercontent.com/nashsu/AutoCLI/main/scripts/install.sh | sh`, if is in windows, ask user to install from https://github.com/nashsu/AutoCLI**


**Common flags (all commands):**
- `--format json` — machine-readable output (preferred for parsing)
- `--limit N` — number of results (default varies, usually 20)
- `--format table|json|yaml|md|csv`

## Quick Examples

```bash
# 读取/浏览
autocli bilibili hot --limit 10 --format json
autocli zhihu hot --format json
autocli weibo hot --format json
autocli twitter timeline --format json
autocli hackernews top --limit 20 --format json
autocli v2ex hot --format json
autocli reddit hot --format json
autocli xiaohongshu feed --format json
autocli douban top250 --format json
autocli weread shelf --format json
autocli medium feed --format json

# 搜索
autocli bilibili search --keyword "AI" --format json
autocli zhihu search --keyword "大模型" --format json
autocli twitter search "rust lang" --limit 10
autocli youtube search --query "LLM tutorial" --format json
autocli boss search --query "AI工程师" --city "上海" --format json
autocli google search "autocli" --format json
autocli stackoverflow search "rust async" --format json

# 互动(写操作)
autocli twitter post --text "Hello from CLI!"
autocli twitter reply --url "https://x.com/.../status/123" --text "Great post!"
autocli twitter like --url "https://x.com/.../status/123"
autocli jike create --text "Hello Jike!"
autocli xiaohongshu publish --title "标题" --content "内容"

# 个人数据
autocli bilibili history --format json
autocli twitter bookmarks --format json
autocli xueqiu watchlist --format json
autocli weread highlights --format json
autocli reddit saved --format json


# 诊断
autocli doctor
```



### ⚠️ 写操作风险提示(发帖/回复/点赞前必须告知)

1. **账号安全**:自动化行为可能触发平台风控
2. **不可撤回**:发布后立即公开
3. **最佳实践**:执行前向用户展示将发布的内容,等待确认

 
## Requirements

- Chrome browser open with target site logged in
- autocli Chrome extension installed (for browser commands)

**核心原则:永远不说"不支持",先尝试 autocli,失败或无命令时选择自己创建**

## 自迭代能力:为新网站创建 CLI

**当 autocli 不支持某个网站时,不要放弃——自己创建!**

### 流程

```
1. autocli <site> --help  →  报错?说明不支持
2. autocli generate <url>  →  尝试自动生成(成功则结束)
3. 自动生成失败 → 手动创建 YAML:
   a. 打开目标页面
   b. browser_evaluate 探索 DOM 结构(找 data-test 属性、class 规律)
   c. 确认选择器后写入 ~/.autocli/adapters/<site>/top.yaml
   d. autocli <site> top --format json  →  验证输出
```

### YAML 格式(DOM 抓取模板)

```yaml
site: <sitename>
name: <command>
description: <描述>
domain: <domain>
strategy: public
browser: true

args:
  limit:
    type: int
    default: 10

pipeline:
  - navigate: https://<url>
  - evaluate: |
      (async () => {
        const limit = ${{ args.limit }};
        // DOM 抓取逻辑
        return results;
      })()

columns: [rank, name, ...]
```

### 调试技巧

- `browser_evaluate` 先探结构:`document.querySelector('...').innerHTML`
- 找 `data-test` 属性最稳定,其次 class 中的语义词
- tagline 通常是 name 的兄弟元素(`nameEl.parentElement.querySelector('span...')`)
- 去重用 `seen = new Set()`,防止重复产品

## Full Command Reference

# autocli Command Reference

All commands support: `--format table|json|yaml|md|csv`  

Run `autocli --help` for the full list of all 333 commands across 55+ sites.

---

## Public Mode (No Browser Needed)

### HackerNews

| Command | Args | Description |
|---------|------|-------------|
| `hackernews top` | `--limit N` (default 20) | Top stories |
| `hackernews new` | `--limit N` | Newest stories |
| `hackernews best` | `--limit N` | Best stories |
| `hackernews ask` | `--limit N` | Ask HN |
| `hackernews show` | `--limit N` | Show HN |
| `hackernews jobs` | `--limit N` | Job listings |
| `hackernews search` | `--query <str>`, `--limit N` | Search stories |
| `hackernews user` | `--id <username>` | User profile |

### Dev.to

| Command | Args | Description |
|---------|------|-------------|
| `devto top` | `--limit N` | Top articles |
| `devto tag` | `--tag <str>`, `--limit N` | Articles by tag |
| `devto user` | `--username <str>` | User's articles |

### Lobsters

| Command | Args | Description |
|---------|------|-------------|
| `lobsters hot` | `--limit N` | Hottest stories |
| `lobsters newest` | `--limit N` | Newest stories |
| `lobsters active` | `--limit N` | Most active |
| `lobsters tag` | `--tag <str>`, `--limit N` | Stories by tag |

### StackOverflow

| Command | Args | Description |
|---------|------|-------------|
| `stackoverflow hot` | `--limit N` | Hot questions |
| `stackoverflow search` | `--query <str>`, `--limit N` | Search questions |
| `stackoverflow bounties` | `--limit N` | Featured bounties |
| `stackoverflow unanswered` | `--limit N` | Unanswered questions |

### Wikipedia

| Command | Args | Description |
|---------|------|-------------|
| `wikipedia search` | `--query <str>`, `--limit N` | Search articles |
| `wikipedia summary` | `--title <str>` | Article summary |
| `wikipedia random` | `--limit N` | Random articles |
| `wikipedia trending` | `--limit N` | Trending articles |

### Arxiv

| Command | Args | Description |
|---------|------|-------------|
| `arxiv search` | `--query <str>`, `--limit N` | Search papers |
| `arxiv paper` | `--id <arxiv_id>` | Paper details |

### BBC

| Command | Args | Description |
|---------|------|-------------|
| `bbc news` | `--limit N` (default 20, max 50) | BBC news headlines (RSS) |

### Steam

| Command | Args | Description |
|---------|------|-------------|
| `steam top-sellers` | `--limit N` | Top selling games |

### Hugging Face

| Command | Args | Description |
|---------|------|-------------|
| `hf top` | `--limit N` | Top models/spaces |

### Apple Podcasts

| Command | Args |