/ docs / guide / getting-started.md
getting-started.md
 1  # Getting Started
 2  
 3  > **Make any website or Electron App your CLI.**
 4  > Zero risk · Reuse Chrome login · AI-powered discovery · Browser + Desktop automation
 5  
 6  [![npm](https://img.shields.io/npm/v/@jackwener/opencli?style=flat-square)](https://www.npmjs.com/package/@jackwener/opencli)
 7  [![Node.js Version](https://img.shields.io/node/v/@jackwener/opencli?style=flat-square)](https://nodejs.org)
 8  [![License](https://img.shields.io/npm/l/@jackwener/opencli?style=flat-square)](https://github.com/jackwener/opencli/blob/main/LICENSE)
 9  
10  OpenCLI turns **any website** or **Electron app** into a command-line interface — Bilibili, Zhihu, 小红书, Twitter/X, Reddit, YouTube, Antigravity, and [many more](/adapters/) — powered by browser session reuse and AI-native discovery.
11  
12  ## Highlights
13  
14  - **Desktop App Control** — Drive Electron apps (Cursor, Codex, ChatGPT, Notion, etc.) directly from the terminal via CDP.
15  - **Browser Automation** — `browser` gives AI agents direct browser control: click, type, extract, screenshot — fully scriptable.
16  - **Website → CLI** — Turn any website into a deterministic CLI: 87+ pre-built adapters, or author your own with the `opencli-adapter-author` skill.
17  - **Account-safe** — Reuses Chrome's logged-in state; your credentials never leave the browser.
18  - **AI Agent ready** — `opencli browser *` primitives (`open` / `network` / `state` / `eval` / `init` / `verify`) drive the adapter-authoring loop.
19  - **Zero LLM cost** — No tokens consumed at runtime. Run 10,000 times and pay nothing.
20  - **Deterministic** — Same command, same output schema, every time. Pipeable, scriptable, CI-friendly.
21  
22  ## Quick Start
23  
24  ### Install via npm
25  
26  ```bash
27  npm install -g @jackwener/opencli
28  ```
29  
30  ### Basic Usage
31  
32  ```bash
33  opencli list                              # See all commands
34  opencli hackernews top --limit 5          # Public API, no browser
35  opencli bilibili hot --limit 5            # Browser command
36  opencli zhihu hot -f json                 # JSON output
37  ```
38  
39  ### Output Formats
40  
41  All built-in commands support `--format` / `-f`:
42  
43  ```bash
44  opencli bilibili hot -f table   # Default: rich terminal table
45  opencli bilibili hot -f json    # JSON (pipe to jq or LLMs)
46  opencli bilibili hot -f yaml    # YAML (human-readable)
47  opencli bilibili hot -f md      # Markdown
48  opencli bilibili hot -f csv     # CSV
49  opencli bilibili hot -v         # Verbose: show pipeline debug
50  ```
51  
52  ### Tab Completion
53  
54  OpenCLI supports intelligent tab completion to speed up command input:
55  
56  ```bash
57  # Add shell completion to your startup config
58  echo 'eval "$(opencli completion zsh)"' >> ~/.zshrc              # Zsh
59  echo 'eval "$(opencli completion bash)"' >> ~/.bashrc            # Bash
60  echo 'opencli completion fish | source' >> ~/.config/fish/config.fish  # Fish
61  
62  # Restart your shell, then press Tab to complete:
63  opencli [Tab]          # Complete site names (bilibili, zhihu, twitter...)
64  opencli bilibili [Tab] # Complete commands (hot, search, me, download...)
65  ```
66  
67  The completion includes:
68  - All available sites and adapters
69  - Built-in commands (list, validate, verify, browser, doctor, plugin...)
70  - Command aliases
71  - Real-time updates as you add new adapters
72  
73  ## Next Steps
74  
75  - [Installation details](/guide/installation)
76  - [Browser Bridge setup](/guide/browser-bridge)
77  - [Plugins — extend with community adapters](/guide/plugins)
78  - [All available adapters](/adapters/)
79  - [For developers / AI agents](/developer/contributing)
80  - [Add a new Electron app CLI](/guide/electron-app-cli)