Open Source Project of the Day (Part 64): OpenCLI - Turn Any Website, Electron App, or Local Tool Into a Unified CLI

A deep dive into OpenCLI, a universal CLI hub and AI-native runtime that reuses Chrome/Chromium login sessions, ships 70+ website adapters, provides browser automation for AI agents (operate), passthrough and auto-install for external CLIs, and standardizes discovery for tools like Claude Code and Cursor

·6 min read·Developer Tools

Introduction

"Make any website, Electron App, or Local Tool your CLI."

This is Part 64 of the "Open Source Project of the Day" series. Today we explore OpenCLI (GitHub).

Developers often want a single terminal entry point: call gh and docker, fetch trending feeds, query community sites, and—critically—let AI agents discover and execute the same tool surface reliably. OpenCLI aims to standardize that: turn websites, Electron desktop apps, and local CLI tools into a consistent command-line interface. It connects to your browser via a Browser Bridge (Chrome/Chromium extension + local micro-daemon) to reuse logged-in sessions, ships 70+ built-in adapters, provides a CLI Hub for passthrough commands like opencli gh and opencli docker (with optional auto-install via your package manager), and includes Electron/desktop adapters (Cursor, Antigravity, ChatGPT desktop, and more—see docs). For AI workflows, it provides Skills such as opencli-operate for direct browser control (click, type, screenshot, extract, etc.).

What You'll Learn

  • How OpenCLI is layered: CLI process, Browser Bridge, adapters, and optional desktop integrations
  • Built-in capabilities: site adapters, CLI hub, Electron adapters, plugins
  • AI-oriented workflows: opencli-operate, plus explore / synthesize / cascade style flows described in the repo
  • Privacy and operational boundaries: session reuse via the browser; provider terms still apply to chat/API traffic
  • Local development and troubleshooting: opencli doctor, common exit codes, extension connectivity issues

Prerequisites

  • Node.js 20+ (or Bun 1.0+) and comfort with global npm installs
  • Basic Chrome/Chromium extension loading ("Load unpacked")
  • Shell piping (jq, scripts, CI) is helpful
  • Optional: TypeScript/YAML and browser automation concepts for adapter development

Project Background

Project Overview

OpenCLI is a Node.js CLI runtime that bridges three worlds:

  1. Websites — deterministic subcommands for many platforms (see the adapter index in docs).
  2. Local CLIs — unified discovery and passthrough via CLI Hub, plus opencli register for custom tools.
  3. Desktop apps (often Electron) — optional adapters documented under docs/adapters/desktop/.

The project emphasizes deterministic outputs, scriptability, and AI-agent ergonomics (Skills, discoverable command lists, structured output formats).

Maintainer & Distribution

  • Repository: jackwener/opencli
  • npm package: @jackwener/opencli
  • License: Apache-2.0

Project Stats

  • GitHub Stars: ~12,570 (changes over time; check the repo page)
  • 📦 Versioning: See npm and GitHub Releases
  • 📄 License: Apache-2.0

Main Features

Core Capabilities

  1. Website → CLI: Many platforms exposed as subcommands; 70+ adapters referenced in the README.
  2. Browser automation for agents: operate + the opencli-operate Skill for scripted interactions.
  3. CLI Hub: Passthrough to tools like gh, docker, lark-cli, vercel, etc., with discovery via opencli list.
  4. Electron/desktop: Terminal control flows for selected desktop apps (details per adapter doc).
  5. Plugins: Install community adapters via opencli plugin install.
  6. Output + exit codes: --format supports table, json, yaml, md, csv; exit codes follow common Unix conventions (including 69 for unavailable bridge, 77 for auth issues—see README tables).

Use Cases

  1. Terminal-first data pulls — trending/search feeds as JSON for scripts or LLM pipelines.
  2. Unified agent tooling — point agents at opencli list to reduce tool-discovery friction.
  3. Crystallize repetitive web flows — exploration/synthesis workflows to turn interactions into reusable commands.
  4. Orchestrate desktop AI apps — where supported, drive desktop clients from the terminal (read the specific adapter docs carefully).
  5. Coexist with existing CLIs — OpenCLI as a hub, not necessarily a replacement.

Quick Start

1) Install the Browser Bridge extension

Download opencli-extension.zip from GitHub Releases, then load unpacked in chrome://extensions.

2) Install the CLI

npm install -g @jackwener/opencli

3) Verify

opencli doctor
opencli daemon status
opencli list
opencli hackernews top --limit 5
opencli bilibili hot --limit 5

Note: site commands that rely on logged-in sessions require you to be logged in inside Chrome/Chromium first (per README).

4) Optional: install Skills for AI agents

npx skills add jackwener/opencli

Highlights (from the upstream README)

  • Account-friendly session reuse via real browser login state (credentials stay in the browser context as described upstream).
  • Anti-automation hardening claims (webdriver flags, chrome stubs, plugin lists, stack cleanup)—effectiveness varies by site policies.
  • Self-healing: opencli doctor to diagnose extension/daemon connectivity.
  • Dynamic adapter loading: drop .ts or .yaml adapters into the documented clis/ workflow (see upstream docs).
  • Zero LLM cost at runtime for normal command execution (distinct from adapter generation flows that may involve LLM usage—read skills/docs).

Advantages

DimensionOpenCLIOne-off scrapersRaw Playwright DIY
Unified discoveryopencli list + hub❌ fragmented⚠️ build your own
Login handling✅ reuse browser session⚠️ cookie hacks⚠️ manual
Agent integration✅ Skills + operate❌ rare⚠️ DIY
Output contracts✅ formats + exit codes⚠️ varies⚠️ varies
Setup overhead⚠️ extension + daemon✅ sometimes simpler❌ high engineering cost

Detailed Project Analysis

Conceptual Architecture

  1. opencli CLI parses commands and routes to adapters, plugins, or external CLI passthrough.
  2. Browser Bridge coordinates with Chrome/Chromium through an extension and local daemon connectivity.
  3. Adapters encode site capabilities as structured commands with stable schemas.
  4. Desktop adapters document how to control selected Electron apps (capabilities differ per app and version).

AI Workflows (as advertised upstream)

  • explore: discover APIs and capabilities for a site
  • synthesize: generate adapters
  • generate: one-shot explore → synthesize → register
  • cascade: probe auth strategies for APIs

Start from skills/opencli-explorer for deep workflows, or skills/opencli-oneshot for quick URL-to-command generation.

Operational Notes

  • Expect browser extension troubleshooting to be part of day-to-day usage.
  • Site changes can break adapters; watch releases and issues.
  • Compliance: users must respect each platform's Terms of Service and automation policies.

Official

  • Chinese README: README.zh-CN.md in the repository
  • Adapter index: docs/adapters/index.md
  • Testing guide: TESTING.md

Who It's For

  • Developers who want one terminal surface across web, desktop apps, and existing CLIs
  • Teams building AI agent workflows that need discoverable, structured tools
  • Advanced users comfortable with browser extensions + a local daemon as prerequisites

Visit my personal homepage to find more useful knowledge and interesting products