🚀. Socket Launch Week Day 2:Introducing Manifest Alerts.Learn more
Sign In

@jackwener/opencli

Package Overview
Dependencies
Maintainers
1
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Potential malware was recently detected in this package.

Affected versions:

1.0.01.0.11.0.41.0.51.0.6
+10 more

@jackwener/opencli

Make any website your CLI. AI-powered.

Source
npmnpm
Version
1.0.5
Version published
Weekly downloads
15K
23.66%
Maintainers
1
Weekly downloads
 
Created
Source

OpenCLI

Make any website or Electron App your CLI.
Zero risk · Reuse Chrome login · AI-powered discovery · Browser + Desktop automation

中文文档

npm Node.js Version License

A CLI tool that turns any website or Electron app into a command-line interface — Bilibili, Zhihu, 小红书, Twitter/X, Reddit, YouTube, Antigravity, and many more — powered by browser session reuse and AI-native discovery.

🔥 CLI All Electron Apps! The Most Powerful Update Has Arrived! 🔥 Turn ANY Electron application into a CLI tool! Recombine, script, and extend applications like Antigravity Ultra seamlessly. Now AI can control itself natively. Unlimited possibilities await!

Table of Contents

Highlights

  • CLI All Electron — CLI-ify apps like Antigravity Ultra! Now AI can control itself natively using cc/openclaw!
  • 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.
  • Self-healing setupopencli setup verifies Browser Bridge connectivity; opencli doctor diagnoses daemon, extension, and live browser connectivity.
  • Dynamic Loader — Simply drop .ts or .yaml adapters into the clis/ folder for auto-registration.
  • Dual-Engine Architecture — Supports both YAML declarative data pipelines and robust browser runtime TypeScript injections.

Prerequisites

  • Node.js: >= 20.0.0
  • Chrome running and logged into the target site (e.g. bilibili.com, zhihu.com, xiaohongshu.com).

⚠️ 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.

OpenCLI connects to your browser through a lightweight Browser Bridge Chrome Extension + micro-daemon (zero config, auto-start).

Browser Bridge Extension Setup

You can install the extension via either method:

Method 1: Download Pre-built Release (Recommended)

  • Go to the GitHub Releases page and download the latest opencli-extension.zip or opencli-extension.crx.
  • Open chrome://extensions and enable Developer mode (top-right toggle).
  • Drag and drop the .crx file or the unzipped folder into the extensions page.

Method 2: Load Unpacked Source (For Developers)

  • Open chrome://extensions and enable Developer mode.
  • Click Load unpacked and select the extension/ directory from this repository.

That's it! The daemon auto-starts when you run any browser command. No tokens, no manual configuration.

Tip: Use opencli doctor for ongoing diagnosis:

opencli doctor            # Check extension + daemon connectivity
opencli doctor --live     # Also test live browser commands

Quick Start

npm install -g @jackwener/opencli

Then use directly:

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

Install from source (for developers)

git clone git@github.com:jackwener/opencli.git
cd opencli 
npm install
npm run build
npm link      # Link binary globally
opencli list  # Now you can use it anywhere!

Update

npm install -g @jackwener/opencli@latest

Built-in Commands

Run opencli list for the live registry.

SiteCommandsMode
twittertrending bookmarks profile search timeline thread following followers notifications post reply delete like article follow unfollow bookmark unbookmark download accept reply-dmBrowser
reddithot frontpage popular search subreddit read user user-posts user-comments upvote save comment subscribe saved upvotedBrowser
cursorstatus send read new dump composer model extract-code ask screenshot history exportDesktop
bilibilihot search me favorite history feed subtitle dynamic ranking following user-videos downloadBrowser
codexstatus send read new extract-diff model ask screenshot history exportDesktop
chatwisestatus new send read ask model history export screenshotDesktop
notionstatus search read new write sidebar favorites exportDesktop
discord-appstatus send read channels servers search membersDesktop
v2exhot latest topic daily me notificationsPublic / Browser
xueqiufeed hot-stock hot search stock watchlistBrowser
antigravitystatus send read new dump extract-code model watchDesktop
chatgptstatus new send read askDesktop
xiaohongshusearch notifications feed me user downloadBrowser
apple-podcastssearch episodes topPublic
xiaoyuzhoupodcast podcast-episodes episodePublic
zhihuhot search question downloadBrowser
youtubesearch video transcriptBrowser
bosssearch detailBrowser
coupangsearch add-to-cartBrowser
bbcnewsPublic
ctripsearchBrowser
githubsearchPublic
hackernewstopPublic
linkedinsearchBrowser
reuterssearchBrowser
smzdmsearchBrowser
weibohotBrowser
yahoo-financequoteBrowser

Desktop App Adapters

Each desktop adapter has its own detailed documentation with commands reference, setup guide, and examples:

AppDescriptionDoc
CursorControl Cursor IDE — Composer, chat, code extractionREADME
CodexDrive OpenAI Codex CLI agent headlesslyREADME
AntigravityControl Antigravity Ultra from terminalREADME
ChatGPTAutomate ChatGPT macOS desktop appREADME
ChatWiseMulti-LLM client (GPT-4, Claude, Gemini)README
NotionSearch, read, write Notion pagesREADME
DiscordDiscord Desktop — messages, channels, serversREADME
Feishu飞书/Lark Desktop via AppleScriptREADME
WeChat微信 Desktop via AppleScript + AccessibilityREADME
NeteaseMusic网易云音乐 Desktop via CEF/CDPREADME

Download Support

OpenCLI supports downloading images, videos, and articles from supported platforms.

Supported Platforms

PlatformContent TypesNotes
xiaohongshuImages, VideosDownloads all media from a note
bilibiliVideosRequires yt-dlp installed
twitterImages, VideosDownloads from user media tab or single tweet
zhihuArticles (Markdown)Exports articles with optional image download

Prerequisites

For video downloads from streaming platforms, you need to install yt-dlp:

# Install yt-dlp
pip install yt-dlp
# or
brew install yt-dlp

Usage Examples

# Download images/videos from Xiaohongshu note
opencli xiaohongshu download --note_id abc123 --output ./xhs

# Download Bilibili video (requires yt-dlp)
opencli bilibili download --bvid BV1xxx --output ./bilibili
opencli bilibili download --bvid BV1xxx --quality 1080p  # Specify quality

# Download Twitter media from user
opencli twitter download --username elonmusk --limit 20 --output ./twitter

# Download single tweet media
opencli twitter download --tweet-url "https://x.com/user/status/123" --output ./twitter

# Export Zhihu article to Markdown
opencli zhihu download --url "https://zhuanlan.zhihu.com/p/xxx" --output ./zhihu

# Export with local images
opencli zhihu download --url "https://zhuanlan.zhihu.com/p/xxx" --download-images

Pipeline Step (for YAML adapters)

The download step can be used in YAML pipelines:

pipeline:
  - fetch: https://api.example.com/media
  - download:
      url: ${{ item.imageUrl }}
      dir: ./downloads
      filename: ${{ item.title | sanitize }}.jpg
      concurrency: 5
      skip_existing: true

Output Formats

All built-in commands support --format / -f with table, json, yaml, md, and csv. The list command supports the same format options, and keeps --json for backward compatibility.

opencli list -f yaml            # Command registry as YAML
opencli bilibili hot -f table   # Default: rich terminal table
opencli bilibili hot -f json    # JSON (pipe to jq or LLMs)
opencli bilibili hot -f yaml    # YAML (human-readable structured output)
opencli bilibili hot -f md      # Markdown
opencli bilibili hot -f csv     # CSV
opencli bilibili hot -v         # Verbose: show pipeline debug steps

For AI Agents (Developer Guide)

If you are an AI assistant tasked with creating a new command adapter for opencli, please follow the AI Agent workflow below:

Quick mode: To generate a single command for a specific page URL, see CLI-ONESHOT.md — just a URL + one-line goal, 4 steps done.

Full mode: Before writing any adapter code, read CLI-EXPLORER.md. It contains the complete browser exploration workflow, the 5-tier authentication strategy decision tree, and debugging guide.

# 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, endpoints.json, capabilities.json, auth.json).

Testing

See TESTING.md for the full testing guide, including:

  • Current test coverage (unit + E2E tests across browser and desktop adapters)
  • How to run tests locally
  • How to add tests when creating new adapters
  • CI/CD pipeline with sharding
  • Headless browser mode (OPENCLI_HEADLESS=1)
# Quick start
npm run build
npx vitest run                              # All tests
npx vitest run src/                          # Unit tests only
npx vitest run tests/e2e/                    # E2E tests

Troubleshooting

  • "Extension not connected"
    • Ensure the opencli Browser Bridge extension is installed and enabled in chrome://extensions.
  • Empty data returns or 'Unauthorized' error
    • Your login session in Chrome might have expired. Open a normal Chrome tab, navigate to the target site, and log in or refresh the page.
  • Node API errors
    • Make sure you are using Node.js >= 20. Some dependencies require modern Node APIs.
  • Daemon issues
    • Check daemon status: curl localhost:19825/status
    • View extension logs: curl localhost:19825/logs

Releasing New Versions

npm version patch   # 0.1.0 → 0.1.1
npm version minor   # 0.1.0 → 0.2.0
git push --follow-tags

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

License

Apache-2.0

Keywords

cli

FAQs

Package last updated on 20 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