Work with Obsidian vaults using the official obsidian CLI: read/search/create/edit notes, tasks, links, properties, plugins.
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-obsidian-67e080ee4e9a ,按照其中的说明把「obsidian」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Use the official obsidian CLI for Obsidian vault work. Vault files are plain Markdown, so direct file edits are still fine when safer/faster.
obsidian registered on PATH.Check:
obsidian version
obsidian help
macOS registration creates /usr/local/bin/obsidian pointing at the app-bundled CLI. Linux registration copies the binary to ~/.local/bin/obsidian.
*.md..obsidian/; avoid editing unless asked.*.canvas JSON.vault="<name>" when ambiguous.Obsidian desktop tracks vaults here:
~/Library/Application Support/obsidian/obsidian.jsonobsidian <command> [name=value] [flag]
obsidian vault="Notes" search query="meeting notes" format=json
Parameter values with spaces need quotes. Add --copy to copy output where useful.
Open/read:
obsidian open file=Recipe
obsidian open path="Inbox/Idea.md" newtab
obsidian read
obsidian read file=Recipe
Search:
obsidian search query="TODO" matches
obsidian search query="status::active" format=json
obsidian search:open query="project notes"
Create/modify:
obsidian create name="New Note"
obsidian create path="Inbox/Idea.md" content="# Idea"
obsidian append file=Note content="New line"
obsidian prepend file=Note content="After frontmatter"
Move/delete:
obsidian move file=Note to=Archive/
obsidian move path="Inbox/Old.md" to="Projects/New.md"
obsidian delete file=Note
Daily/tasks:
obsidian daily
obsidian daily:read
obsidian daily:append content="- [ ] Review inbox"
obsidian tasks all todo
obsidian task file=Note line=8 done
Properties/links:
obsidian tags all counts
obsidian property:read file=Note name=status
obsidian property:set file=Note name=status value=done
obsidian backlinks file=Note
obsidian unresolved verbose counts
Developer/debug:
obsidian plugin:reload my-plugin
obsidian dev:errors
obsidian dev:screenshot file=shot.png
obsidian eval "app.vault.getFiles().length"
file=<name> uses Obsidian-style file resolution; path=<vault-relative.md> is exact.obsidian-cli unless user explicitly asks for it.