feat(ObsidianBridge): v1.2.0 CLI路径配置化#314
Merged
lioensky merged 1 commit intoMay 8, 2026
Merged
Conversation
新增 config.env.example 配置模板,用户可自定义 Obsidian CLI 路径 新增 loadCliPath() 函数,从 config.env 读取 OBSIDIAN_CLI_PATH 未配置时自动 fallback 到系统 PATH 中的 obsidian 命令 更新 README:安装/配置/特性/文件结构/已知限制/版本历史 零新依赖,仅使用 Node.js 内置 path 和 fs Co-authored-by: mizunosayo <mizunosayo@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动内容
ObsidianBridge 插件的 Obsidian CLI 路径此前硬编码在 obsidian_bridge.js 中,
不同用户的安装路径不同,每次都需要手动改源码。
本 PR 将 CLI 路径改为通过 config.env 配置文件加载:
新增文件
config.env.example — 配置模板
obsidian_bridge.js
新增 loadCliPath() 函数,解析同目录下 config.env 中的 OBSIDIAN_CLI_PATH
未配置或为空时自动 fallback 到系统 PATH 中的 obsidian 命令
零新依赖(仅使用 Node.js 内置 path 和 fs)
版本号 1.1.2 → 1.2.0
安装步骤更新(不再要求修改源码)
新增配置章节说明
特性列表、文件结构、已知限制、版本历史同步更新
测试:
OBSIDIAN_CLI_PATH 填写绝对路径 → 调用成功 ✅
OBSIDIAN_CLI_PATH 为空 → fallback 到 PATH 中的 obsidian → 调用成功 ✅
贡献者
本插件原始架构由 @nova 和 @mizunosayo 设计实现(v1.0.0),
本 PR 由 @infinite-vector 在其基础上扩展两次。