diff --git a/README.md b/README.md index a2cdedf..b5a3850 100644 --- a/README.md +++ b/README.md @@ -18,23 +18,6 @@ Turn ANY Electron application into a CLI tool! Recombine, script, and extend app --- -## Table of Contents - -- [Highlights](#highlights) -- [Prerequisites](#prerequisites) -- [Quick Start](#quick-start) -- [Built-in Commands](#built-in-commands) - - [Desktop App Adapters](#desktop-app-adapters) -- [External CLI Hub](#external-cli-hub) -- [Download Support](#download-support) -- [Output Formats](#output-formats) -- [For AI Agents (Developer Guide)](#for-ai-agents-developer-guide) -- [Remote Chrome (Server/Headless)](#remote-chrome-serverheadless) -- [Testing](#testing) -- [Troubleshooting](#troubleshooting) -- [Releasing New Versions](#releasing-new-versions) -- [License](#license) - --- ## Highlights @@ -65,11 +48,7 @@ You can install the extension via either method: 2. Unzip the file and open `chrome://extensions`, enable **Developer mode** (top-right toggle). 3. Click **Load unpacked** and select the unzipped folder. -**Method 2: Load from npm Package** -1. After installing opencli via npm, open `chrome://extensions` and enable **Developer mode**. -2. Click **Load unpacked** and select `node_modules/@jackwener/opencli/extension` directory. - -**Method 3: Load Source (For Developers)** +**Method 2: Load Source (For Developers)** 1. Open `chrome://extensions` and enable **Developer mode**. 2. Click **Load unpacked** and select the `extension/` directory from this repository. @@ -167,7 +146,6 @@ Run `opencli list` for the live registry. | **weread** | `shelf` `search` `book` `highlights` `notes` `notebooks` `ranking` | Browser | | **douban** | `search` `top250` `subject` `marks` `reviews` | Browser | -> **Bloomberg note**: The RSS-backed Bloomberg listing commands (`main`, section feeds, `feeds`) work without a browser. `bloomberg news` is for standard Bloomberg story/article pages that your current Chrome session can already access. Audio and some other non-standard pages may fail, and OpenCLI does not bypass Bloomberg paywall or entitlement checks. ### External CLI Hub @@ -252,20 +230,7 @@ opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --output ./zhihu opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --download-images ``` -### Pipeline Step (for YAML adapters) - -The `download` step can be used in YAML pipelines: -```yaml -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 @@ -308,21 +273,7 @@ Explore outputs to `.opencli/explore//` (manifest.json, endpoints.json, ca ## Testing -See **[TESTING.md](./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`) - -```bash -# Quick start -npm run build -npx vitest run # All tests -npx vitest run src/ # Unit tests only -npx vitest run tests/e2e/ # E2E tests -``` +See **[TESTING.md](./TESTING.md)** for how to run and write tests. ## Troubleshooting @@ -338,15 +289,7 @@ npx vitest run tests/e2e/ # E2E tests - Check daemon status: `curl localhost:19825/status` - View extension logs: `curl localhost:19825/logs` -## Releasing New Versions - -```bash -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. ## Star History diff --git a/README.zh-CN.md b/README.zh-CN.md index 31c7cde..7b48bd6 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -20,22 +20,6 @@ CLI all electron!现在支持把所有 electron 应用 CLI 化,从而组合 --- -## 目录 - -- [亮点](#亮点) -- [前置要求](#前置要求) -- [快速开始](#快速开始) -- [内置命令](#内置命令) - - [桌面应用适配器](#桌面应用适配器) -- [外部 CLI 枢纽](#外部-cli-枢纽) -- [下载支持](#下载支持) -- [输出格式](#输出格式) -- [致 AI Agent(开发者指南)](#致-ai-agent开发者指南) -- [远程 Chrome(服务器/无头环境)](#远程-chrome服务器无头环境) -- [常见问题排查](#常见问题排查) -- [版本发布](#版本发布) -- [License](#license) - --- ## 亮点 @@ -66,11 +50,7 @@ OpenCLI 通过轻量化的 **Browser Bridge** Chrome 扩展 + 微型 daemon 与 2. 解压后打开 Chrome 的 `chrome://extensions`,启用右上角的 **开发者模式**。 3. 点击 **加载已解压的扩展程序**,选择解压后的文件夹。 -**方式二:从 npm 包加载** -1. 通过 npm 安装 opencli 后,打开 `chrome://extensions`,启用 **开发者模式**。 -2. 点击 **加载已解压的扩展程序**,选择 `node_modules/@jackwener/opencli/extension` 目录。 - -**方式三:加载源码(针对开发者)** +**方式二:加载源码(针对开发者)** 1. 同样在 `chrome://extensions` 开启 **开发者模式**。 2. 点击 **加载已解压的扩展程序**,选择本仓库代码树中的 `extension/` 文件夹。 @@ -168,7 +148,6 @@ npm install -g @jackwener/opencli@latest | **weread** | `shelf` `search` `book` `highlights` `notes` `notebooks` `ranking` | 浏览器 | | **douban** | `search` `top250` `subject` `marks` `reviews` | 浏览器 | -> **Bloomberg 说明**:Bloomberg 的 RSS 列表命令(`main`、各栏目 feed、`feeds`)无需浏览器即可使用。`bloomberg news` 适用于当前 Chrome 会话本身就能访问的标准 Bloomberg 文章页。音频页和部分非标准页面可能失败,OpenCLI 也不会绕过 Bloomberg 的付费墙、登录或权限校验。 ### 外部 CLI 枢纽 @@ -253,20 +232,7 @@ opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --output ./zhihu opencli zhihu download "https://zhuanlan.zhihu.com/p/xxx" --download-images ``` -### Pipeline Step(用于 YAML 适配器) -`download` step 可以在 YAML 管线中使用: - -```yaml -pipeline: - - fetch: https://api.example.com/media - - download: - url: ${{ item.imageUrl }} - dir: ./downloads - filename: ${{ item.title | sanitize }}.jpg - concurrency: 5 - skip_existing: true -``` ## 输出格式 @@ -321,15 +287,7 @@ opencli cascade https://api.example.com/data - 检查 daemon 状态:`curl localhost:19825/status` - 查看扩展日志:`curl localhost:19825/logs` -## 版本发布 -```bash -npm version patch # 0.1.0 → 0.1.1 -npm version minor # 0.1.0 → 0.2.0 - -# 推送 tag,GitHub Actions 将自动执行发版和 npm 发布 -git push --follow-tags -``` ## Star History