OpenCLI: a practical guide to browser, adapter, and local-tool workflows

OpenCLI is an open-source command-line project for turning supported websites, logged-in browser sessions, desktop apps, and registered local tools into interfaces that people and AI agents can use. For an OpenClaw operator, it is useful when a task needs a known command or structured browser access instead of a fresh, screenshot-driven automation loop.

The name is ambiguous in search results. This guide covers jackwener/OpenCLI, the browser-and-agent project. It does not cover the OpenCLI specification at opencli.org or the unrelated open-cli npm package. That distinction matters before you install anything or hand a tool to an agent.

Contents

What OpenCLI gives an agent

OpenCLI has more than one operating mode. That is its practical advantage and the source of most confusion.

Its upstream README describes four useful surfaces: built-in adapters for supported sites, browser primitives for live Chrome interaction, plugins for reusable extensions, and a registry for local command-line tools. The right choice depends on whether the job is already modeled as a command, needs a real page, or belongs to a local program that already has a CLI.

InterfaceUse it whenWhat the agent receivesMain constraint
Built-in adapterThe target site and action are already supportedA named command and structured outputIt cannot cover an arbitrary custom page flow
opencli browserThe agent must inspect or operate a live pageBrowser commands such as open, state, click, fill, and extractIt acts through a real logged-in browser context
Plugin or adapterA repeatable site workflow is missingA reusable command surfaceIt needs implementation and verification work
External tool registrationA local binary already does the jobA common discovery path for that binaryThe binary still owns its own credentials and side effects

The earlier OpenCLI skill workflow guide focuses on a narrower decision: when an agent should reuse an existing Chrome login rather than rebuild browser automation. This article is the broader map. Start with the interface that exposes the smallest safe surface for the task.

For example, a supported Hacker News query can use opencli hackernews top --limit 5. A custom form or a page that needs visual confirmation belongs in a browser session. If the same custom workflow will be used repeatedly, a plugin or adapter can turn it into a defined command instead of asking an agent to rediscover the page each time.

Choose the right OpenCLI interface

A good OpenCLI workflow begins with a boundary, not a command.

Prefer an adapter for known site actions

OpenCLI ships adapters for many services, including Reddit, Hacker News, X, Bilibili, LinkedIn, NotebookLM, and others. These are the best starting point when the site and action already exist because the output can be structured instead of extracted from a changing page.

Use opencli list to inspect the registered commands before asking an agent to browse manually. For data that will be passed into another tool or model, request a machine-readable format such as JSON. The upstream project documents table, json, yaml, md, and csv output formats.

Use browser commands for a real page, not as a default

opencli browser is the right interface when the task needs a site that has no adapter, a custom flow, or a visual state that structured output cannot show. The project documents page actions such as opening a URL, reading state, clicking, typing, filling forms, selecting options, waiting, extracting, and inspecting tabs.

Browser control still needs a scope. OpenCLI requires an explicit browser session name, and browser commands can be routed to a chosen tab. Give a task a bounded session and keep it close to the page it needs. Do not let a research task inherit an unrelated work profile merely because that profile is available.

The same rule applies to site permissions. A browser session may be logged in, but a logged-in session is not an instruction to publish, follow, delete, or change settings. For a broader model of limiting browser access, see AI browser agent privacy and per-tab access.

Build an adapter only after the workflow repeats

OpenCLI’s adapter-author guidance starts with reconnaissance, selecting an access pattern, deciding how authentication should work, decoding response fields, and verifying the resulting command. That sequence is useful because it separates a vague request, such as “get the daily trend,” from a testable interface with known fields and failure behavior.

If the result will be reused by multiple agents, keep the adapter source in version control and treat its permissions as part of the interface. A command that can write to an account deserves a different review path from a command that only reads public data.

Set up OpenCLI without guessing

The upstream project recommends its desktop app for macOS and Windows; a global npm install is the CLI path for servers and CI, with Node.js 20 or newer.

node --version
npm install -g @jackwener/opencli
opencli doctor

Browser-backed work also needs the OpenCLI Browser Bridge extension. Run opencli doctor before putting it into an agent workflow.

OpenClaw users should use the canonical OpenCLI skill page for the installed skill and its supported workflow guidance. The skill should describe when the agent may call OpenCLI; it should not become a blanket permission to access every account available in Chrome. How OpenClaw works explains the related distinction between a tool being connected and a tool action being authorized.

Use profiles, sessions, and output deliberately

Chrome profiles are operational boundaries. OpenCLI can list connected profiles, assign local aliases, and select the profile to use. When several profiles are connected and no default exists, it asks for a choice rather than guessing. Preserve that rule in the agent task: name the account context and use the matching profile.

For a browser task, make the plan explicit:

  1. Choose the intended profile before opening the site.
  2. Create a short-lived session name for the task.
  3. Inspect the page state before clicking or filling anything.
  4. Request JSON or CSV when downstream analysis needs structured data.
  5. Close the session or let its idle cleanup release the tab lease after the task finishes.

The project documents exit code 66 for an empty result, 69 for a Browser Bridge problem, 75 for a timeout, 77 for required authentication, and 78 for configuration errors. An agent should surface the class of failure rather than retrying every one as a network issue.

Keep account actions under review

For posting, replying, following, deleting, or changing settings, keep a human checkpoint before the final command. Show the target account, action, and content or record that will change. A login proves identity, not intent.

The principle carries beyond OpenCLI. AI agent skills and tools have different jobs: a skill can describe an operating procedure, while a tool call performs the action. Keeping those layers visible makes automation easier to audit and easier to stop.

Troubleshoot the actual failed layer

Start with the failed layer instead of reinstalling everything.

SymptomLikely layerFirst check
Extension not connectedBrowser BridgeConfirm the extension is installed and enabled, then run opencli doctor
Empty data or unauthorized resultSite loginOpen the target site in the selected Chrome profile and confirm the session is still valid
Old-Node startup errorRuntimeCheck that the npm installation uses Node.js 20 or newer
TimeoutBrowser connection or page operationCheck the selected profile, target tab, and the command’s timeout before rerunning
Unexpected account contextProfile selectionList connected profiles and select the intended alias explicitly

The OpenCLI v1.8.6 release also includes browser command deadlines, safe transport retries, and fixes for stale default profiles. Those are useful reliability improvements, but they do not eliminate the need to identify the affected profile and page before retrying an action.

FAQ

What is OpenCLI?

OpenCLI is the browser-and-agent project maintained at jackwener/OpenCLI. It exposes supported websites, logged-in browser sessions, desktop apps, and registered local tools through command-line interfaces that humans and AI agents can use.

When should an AI agent use OpenCLI instead of a browser automation framework?

Use a built-in OpenCLI adapter when the site and action are already supported and you want defined commands or structured output. Use opencli browser when the task needs a custom live-page interaction. Use a full browser framework when the workflow is outside OpenCLI’s coverage or needs its own implementation and testing model.

Does OpenCLI let an agent use every Chrome account automatically?

No. OpenCLI can work with connected browser profiles, but the operator should select the intended profile and constrain the session to the task. A logged-in profile does not grant blanket authority to publish, change settings, or act across accounts.

Sources: