Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@jackwener/opencli

Package Overview
Dependencies
Maintainers
1
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jackwener/opencli

Make any website your CLI. AI-powered.

Source
npmnpm
Version
0.3.0
Version published
Weekly downloads
12K
-1.6%
Maintainers
1
Weekly downloads
 
Created
Source

OpenCLI

Make any website your CLI.
Zero risk · Reuse Chrome login · AI-powered discovery

中文文档

npm

A CLI tool that turns any website into a command-line interface. 35+ commands across 17 sites — bilibili, zhihu, xiaohongshu, twitter, reddit, xueqiu, github, v2ex, hackernews, bbc, weibo, boss, yahoo-finance, reuters, smzdm, ctrip, youtube — powered by browser session reuse and AI-native discovery.

✨ Highlights

  • 🔐 Account-safe — Reuses Chrome's logged-in state; your credentials never leave the browser
  • 🤖 AI Agent readyexplore discovers APIs, synthesize generates adapters, cascade finds auth strategies
  • 🚀 Dynamic Loader — Simply drop .ts or .yaml adapters into the clis/ folder for auto-registration
  • 📝 Dual-Engine Architecture:
    • YAML Declarative Engine: Most adapters are minimal ~30 lines of YAML pipeline
    • Native Browser Injection Engine: Advanced TypeScript utilities (installInterceptor, autoScroll) for XHR hijacking, GraphQL unwrapping, and store mutation

🚀 Quick Start

npm install -g @jackwener/opencli

Then use directly:

opencli list                              # See all commands
opencli hackernews top --limit 5          # Public API, no browser
opencli bilibili hot --limit 5            # Browser command
opencli zhihu hot -f json                 # JSON output

Install from source

git clone git@github.com:jackwener/opencli.git
cd opencli && npm install
npx tsx src/main.ts list

Update

# npm global
npm update -g @jackwener/opencli

# Or reinstall to latest
npm install -g @jackwener/opencli@latest

📋 Prerequisites

Browser commands need:

  • Chrome running and logged into the target site (e.g. bilibili.com, zhihu.com, xiaohongshu.com)
  • Playwright MCP Bridge extension installed
  • Configure PLAYWRIGHT_MCP_EXTENSION_TOKEN (from the extension settings page) in your MCP config:
{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp@latest", "--extension"],
      "env": {
        "PLAYWRIGHT_MCP_EXTENSION_TOKEN": "<your-token>"
      }
    }
  }
}

Public API commands (hackernews, github search, v2ex) need no browser at all.

⚠️ Important: Browser commands reuse your Chrome login session. You must be logged into the target website in Chrome before running commands. If you get empty data or errors, check your login status first.

📦 Built-in Commands

SiteCommandsMode
bilibilihot search me favorite history feed user-videos🔐 Browser
zhihuhot search question🔐 Browser
xiaohongshusearch notifications feed🔐 Browser
xueqiufeed hot-stock hot search stock watchlist🔐 Browser
twittertrending bookmarks🔐 Browser
reddithot🔐 Browser
weibohot🔐 Browser
bosssearch🔐 Browser
youtubesearch🔐 Browser
yahoo-financequote🔐 Browser
reuterssearch🔐 Browser
smzdmsearch🔐 Browser
ctripsearch🔐 Browser
githubtrending search🔐 / 🌐
v2exhot latest topic🌐 Public
hackernewstop🌐 Public
bbcnews🌐 Public

🎨 Output Formats

opencli bilibili hot -f table   # Default: rich table
opencli bilibili hot -f json    # JSON (pipe to jq, feed to AI)
opencli bilibili hot -f md      # Markdown
opencli bilibili hot -f csv     # CSV
opencli bilibili hot -v         # Verbose: show pipeline steps

🧠 AI Agent Workflow

# 1. Deep Explore — discover APIs, infer capabilities, detect framework
opencli explore https://example.com --site mysite

# 2. Synthesize — generate YAML adapters from explore artifacts
opencli synthesize mysite

# 3. Generate — one-shot: explore → synthesize → register
opencli generate https://example.com --goal "hot"

# 4. Strategy Cascade — auto-probe: PUBLIC → COOKIE → HEADER
opencli cascade https://api.example.com/data

Explore outputs to .opencli/explore/<site>/:

  • manifest.json — site metadata, framework detection
  • endpoints.json — scored API endpoints with response schemas
  • capabilities.json — inferred capabilities with confidence scores
  • auth.json — authentication strategy recommendations

🔧 Create New Commands

See CLI-CREATOR.md for the full adapter guide (YAML pipeline + TypeScript).

Releasing New Versions

# Bump version
npm version patch   # 0.1.0 → 0.1.1
npm version minor   # 0.1.0 → 0.2.0
npm version major   # 0.1.0 → 1.0.0

# Push tag to trigger GitHub Actions auto-release
git push --follow-tags

The CI will automatically build, create a GitHub release, and publish to npm.

📄 License

MIT

Keywords

cli

FAQs

Package last updated on 15 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts