npx skills add https://github.com/bitbonsai/mcpvault --skill obsidian根据用户意图选择最合适的后端:
MCP(默认用于知识库数据操作)
Obsidian CLI/应用上下文(仅在需要应用上下文时使用)
CLI git(同步/备份工作流)
当请求不明确时,优先选择 MCP,除非用户明确要求同步/备份/git/应用行为。
patch_note 默认拒绝多重匹配。 当 replaceAll: false 时,如果 oldString 出现多次,调用会失败并返回 matchCount。仅在确实需要时才设置 ,或者添加上下文使匹配唯一。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
replaceAll: truepatch_note 会在 frontmatter 内部匹配。 替换操作针对整个文件(包括 YAML 块)进行。像 title: 这样的通用字符串会匹配 frontmatter 字段。请包含足够的上下文以定位正确的出现位置。
patch_note 禁止空字符串。 oldString 和 newString 都必须是非空且非纯空格的字符串。要删除文本,请使用单个空格作为 newString,或者使用 write_note 重构笔记。
search_notes 返回精简的 JSON。 字段被缩写:p(路径)、t(标题)、ex(摘要)、mc(匹配计数)、ln(行号)、uri(obsidianUri)。无论 limit 如何设置,结果数硬性上限为 20 条。
search_notes 多词查询会分别对每个词以及整个短语进行评分。 每个词都是 OR 匹配,因此匹配任何词的文档都会出现在结果中。整个短语会获得额外的评分提升。
write_note 自动创建目录。 父文件夹会被递归创建。在 append/prepend 模式下,如果笔记不存在,则会被创建。Frontmatter 在追加/前置模式下会合并(新键覆盖旧键);在覆盖模式下会被完全替换。
delete_note 需要精确的路径确认。 confirmPath 必须与 path 字符完全一致。没有规范化,不接受尾随斜杠。不匹配会静默失败并返回 success: false。
move_file 需要双重确认。 confirmOldPath 和 confirmNewPath 都必须与对应的路径完全匹配。对于 Markdown 重命名,请使用 move_note(基于文本,无需确认);仅对二进制文件或需要二进制安全移动时,才使用 move_file。
manage_tags 从两个来源读取但只写入一个。 list 会合并 frontmatter 标签和内联 #hashtags。add/remove 只修改 frontmatter 的 tags 数组。内联标签永远不会被触及。
read_multiple_notes 从不拒绝。 内部使用 allSettled。失败的文件出现在 err 数组中;成功的文件出现在 ok 数组中。请务必检查两者。每次调用硬性限制为 10 条路径。
| 错误 | 后续步骤 |
|---|---|
| patch_note "Found N occurrences" | 在 oldString 中添加周围行使其唯一,或者设置 replaceAll: true |
| delete_note / move_file 确认不匹配 | 使用 read_note 或 list_directory 重新读取笔记路径,然后使用完全相同的字符串重试 |
| search_notes 返回 0 个结果 | 尝试使用单个关键词而非短语,切换 searchFrontmatter,或使用部分词进行更广泛的搜索 |
read_multiple_notes 部分 err | 使用 list_directory 验证失败的路径,修正拼写错误或缺失的扩展名,仅重试失败的部分 |
当用户要求“同步”、“备份”或“用 git 存储我的知识库”时,使用 CLI git 并遵循以下行为:
在进行任何更改之前运行预检:
git 可用git config user.name 和 git config user.email 已设置如果预检未完成,请仅提出一个有针对性的问题,并附带推荐的默认选项。
git pull --rebase?(推荐:是)"安全同步序列(默认绝不强制推送):
git add -Agit commit -m "vault sync: YYYY-MM-DD HH:mm"(如果没有更改,则跳过提交)git pull --rebasegit pushgh 是可选的:
gh 进行远程仓库引导(创建仓库/设置 origin)。gh。在冲突时停止并报告清晰的后续步骤。
仅在需要时加载这些内容,而非每次调用都加载。
周安装量
31
仓库
GitHub 星标数
684
首次出现
1 天前
安全审计
安装于
github-copilot31
codex31
opencode30
gemini-cli30
amp30
cline30
Use the backend that best matches user intent:
MCP (default for vault data operations)
Obsidian CLI/App context (only when app context is needed)
CLI git (sync/backup workflows)
When a request is ambiguous, pick MCP first unless the user explicitly asks for sync/backup/git/app behavior.
patch_note rejects multi-match by default. With replaceAll: false, if oldString appears more than once the call fails and returns matchCount. Set replaceAll: true only when you mean it, or add surrounding context to make the match unique.
patch_note matches inside frontmatter. The replacement runs against the full file including the YAML block. A generic string like title: will match frontmatter fields. Include enough context to target the right occurrence.
patch_note forbids empty strings. Both oldString and newString must be non-empty and non-whitespace. To delete text, use newString with a single space or restructure the note with write_note.
search_notes returns minified JSON. Fields are abbreviated: p (path), t (title), ex (excerpt), mc (matchCount), ln (lineNumber), uri (obsidianUri). Hard cap of 20 results regardless of limit.
search_notes multi-word queries score terms individually AND as a phrase. Each term is OR-matched, so a document matching any term appears in results. The full phrase gets an additional scoring boost.
write_note auto-creates directories. Parent folders are created recursively. In append/prepend mode, if the note doesn't exist it's created. Frontmatter is merged (new keys override) in append/prepend; replaced entirely in overwrite.
delete_note requires exact path confirmation. confirmPath must be character-identical to path. No normalization, no trailing-slash tolerance. Mismatch silently fails with success: false.
move_file needs double confirmation. Both confirmOldPath and confirmNewPath must exactly match their counterparts. Use move_note for markdown renames (text-aware, no confirmation needed); use move_file only for binary files or when you need binary-safe moves.
manage_tags reads from two sources but writes to one. list merges frontmatter tags + inline #hashtags. add/remove only modify the frontmatter tags array. Inline tags are never touched.
read_multiple_notes never rejects. Uses allSettled internally. Failed files appear in the err array; successful ones in ok. Always check both. Hard limit of 10 paths per call.
| Error | Next step |
|---|---|
| patch_note "Found N occurrences" | Add surrounding lines to oldString to make it unique, or set replaceAll: true |
| delete_note / move_file confirmation mismatch | Re-read the note path with read_note or list_directory, then retry with the exact string |
| search_notes returns 0 results | Try single keywords instead of phrases, toggle searchFrontmatter, or broaden with partial terms |
read_multiple_notes partial err | Verify failed paths with list_directory, fix typos or missing extensions, retry only failed ones |
When the user asks to "sync", "backup", or "store my vault with git", use CLI git with this behavior:
Run a preflight before changing anything:
git availablegit config user.name and git config user.email are setIf preflight is incomplete, ask exactly one targeted question with a recommended default.
git pull --rebase now? (Recommended: Yes)"Safe sync sequence (never force push by default):
git add -ALoad these only when needed, not on every invocation.
Weekly Installs
31
Repository
GitHub Stars
684
First Seen
1 day ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
github-copilot31
codex31
opencode30
gemini-cli30
amp30
cline30
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
29,800 周安装
git commit -m "vault sync: YYYY-MM-DD HH:mm"git pull --rebasegit pushgh is optional:
gh only for remote bootstrapping (create repo / set origin) when requested.gh for normal sync once remote is configured.Stop on conflicts and report clear next steps.