diff --git a/README.md b/README.md index 4c59055..87ef164 100644 --- a/README.md +++ b/README.md @@ -27,35 +27,45 @@ Inspired by [this reading workflow demo](https://www.bilibili.com/video/BV1FxoGB ## Quick Start -### Install +### Step 1: Install the Plugin -**Manual** — Download `main.js`, `manifest.json`, and `styles.css` from the [latest release](https://github.com/fancive/obsidian-parallel-reader/releases), place them in `.obsidian/plugins/parallel-reader/`, and enable the plugin in Obsidian settings. +1. Go to the [Releases page](https://github.com/fancive/obsidian-parallel-reader/releases) and download three files from the latest release: **main.js**, **manifest.json**, **styles.css** +2. Open your vault folder, navigate to `.obsidian/plugins/` (create it if it doesn't exist), and create a new folder called `parallel-reader` +3. Put the three downloaded files into that folder +4. Open Obsidian → **Settings** → **Community plugins** → find **Parallel Reader** → toggle it **on** -### Configure a Provider +> **Tip**: Can't see the `.obsidian` folder? On macOS press `Cmd+Shift+.` in Finder; on Windows enable "Show hidden files" in File Explorer. -Open plugin settings, pick a provider preset, enter your API key and model ID. Done. +### Step 2: Set Up Your AI Provider -| Provider | Format | Notes | -|----------|--------|-------| -| Anthropic | `anthropic-messages` | Default, recommended | -| OpenAI | `openai-chat` | Chat Completions | -| Google Gemini | `google-generative-ai` | generateContent | -| OpenRouter / Groq / DeepSeek / Moonshot / ... | `openai-chat` | OpenAI-compatible | -| Ollama / LM Studio | `openai-chat` | Local, no API key needed | -| Custom endpoint | Any | Just fill in Base URL | +1. In Obsidian, go to **Settings** → **Parallel Reader** +2. Choose a **Provider preset** (e.g. Anthropic, OpenAI, DeepSeek, etc.) +3. Paste your **API Key** +4. (Optional) Change the **Model** if you prefer a different one +5. Click **Test** to verify the connection -Model IDs support `provider/model` notation (e.g. `anthropic/claude-sonnet-4-6`) — the matching prefix is stripped automatically. +That's it! Open any note and run the command **"Parallel Reader: Generate"** from the command palette (`Cmd/Ctrl+P`). -### CLI Backends (Optional) +
+Supported providers -Switch backend to **Claude Code CLI** or **Codex CLI** to use your local CLI installation. +| Provider | Notes | +|----------|-------| +| **Anthropic** | Default, recommended | +| **OpenAI** | GPT models | +| **Google Gemini** | Gemini models | +| **OpenRouter / Groq / DeepSeek / Moonshot / ...** | OpenAI-compatible | +| **Ollama / LM Studio** | Local models, no API key needed | +| **Custom endpoint** | Any OpenAI or Anthropic compatible API | -Since Obsidian's GUI doesn't inherit your shell `PATH`, enter the absolute CLI path in settings: +
-```bash -which claude # Claude Code -which codex # Codex -``` +
+CLI backends (advanced) + +If you have **Claude Code** or **Codex** installed locally, you can use them as backends instead of API keys. Switch the backend in settings and enter the CLI path. The plugin auto-detects common install locations, but Obsidian's GUI may not find it — in that case, paste the full path (run `which claude` or `which codex` in your terminal to find it). + +
## Usage diff --git a/README.zh-CN.md b/README.zh-CN.md index a61a1b2..465a28f 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -27,35 +27,45 @@ Obsidian 对照阅读插件 — 左边原文、右边 AI 摘要卡片,滚动 ## 快速开始 -### 安装 +### 第一步:安装插件 -**手动安装** — 从 [最新 Release](https://github.com/fancive/obsidian-parallel-reader/releases) 下载 `main.js`、`manifest.json`、`styles.css`,放入 `.obsidian/plugins/parallel-reader/`,然后在 Obsidian 设置中启用。 +1. 打开 [Release 页面](https://github.com/fancive/obsidian-parallel-reader/releases),下载最新版的三个文件:**main.js**、**manifest.json**、**styles.css** +2. 打开你的 Vault 文件夹,进入 `.obsidian/plugins/`(没有就新建),再创建一个叫 `parallel-reader` 的文件夹 +3. 把下载的三个文件放进去 +4. 打开 Obsidian → **设置** → **第三方插件** → 找到 **Parallel Reader** → 打开开关 -### 配置 Provider +> **找不到 `.obsidian` 文件夹?** macOS 在 Finder 里按 `Cmd+Shift+.` 显示隐藏文件;Windows 在文件资源管理器里勾选「显示隐藏的项目」。 -打开插件设置,选择 Provider preset,填入 API Key 和模型 ID 即可。 +### 第二步:配置 AI 服务 -| Provider | 格式 | 说明 | -|----------|------|------| -| Anthropic | `anthropic-messages` | 默认,推荐 | -| OpenAI | `openai-chat` | Chat Completions | -| Google Gemini | `google-generative-ai` | generateContent | -| OpenRouter / Groq / DeepSeek / Moonshot 等 | `openai-chat` | OpenAI 兼容格式 | -| Ollama / LM Studio | `openai-chat` | 本地模型,无需 API Key | -| 自定义端点 | 任意 | 填写 Base URL 即可 | +1. 在 Obsidian 中打开 **设置** → **Parallel Reader** +2. 选择一个 **Provider**(比如 Anthropic、OpenAI、DeepSeek 等) +3. 粘贴你的 **API Key** +4. (可选)修改 **模型** +5. 点击 **Test** 验证连接 -Model ID 支持 `provider/model` 写法(如 `anthropic/claude-sonnet-4-6`),匹配当前 preset 时自动剥离前缀。 +搞定!打开任意笔记,按 `Cmd/Ctrl+P` 调出命令面板,运行 **「Parallel Reader: 为当前笔记生成对照笔记」** 即可。 -### CLI 模式(可选) +
+支持的 Provider 一览 -切换后端为 **Claude Code CLI** 或 **Codex CLI**,通过本地 CLI 调用 LLM。 +| Provider | 说明 | +|----------|------| +| **Anthropic** | 默认推荐 | +| **OpenAI** | GPT 系列 | +| **Google Gemini** | Gemini 系列 | +| **OpenRouter / Groq / DeepSeek / Moonshot 等** | OpenAI 兼容格式 | +| **Ollama / LM Studio** | 本地模型,无需 API Key | +| **自定义端点** | 任何 OpenAI 或 Anthropic 兼容的 API | -Obsidian GUI 不继承 shell `PATH`,需要在设置中填写绝对路径: +
-```bash -which claude # Claude Code -which codex # Codex -``` +
+CLI 模式(进阶) + +如果你本地装了 **Claude Code** 或 **Codex**,可以在设置里切换后端直接使用。插件会自动探测常见安装位置,如果找不到,在终端运行 `which claude` 或 `which codex` 获取完整路径,粘贴到设置里即可。 + +
## 使用