obsidian-cli
它能做什么
它教你的智能体通过命令行界面处理 Obsidian 中的笔记。适合把笔记保存在 Obsidian 库中、并希望由 AI 帮忙管理的人。
适用场景
- ✓当你希望 AI 搜索或读取你 Obsidian 库中的笔记的时候。
- ✓当你希望在 Obsidian 中创建新笔记或更新现有笔记的时候。
- ✓当你希望在 Obsidian 中添加或检查每日笔记或任务的时候。
技能链接
https://github.com/kepano/obsidian-skills/blob/main/skills/obsidian-cli/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“你能搜索我的 Obsidian 库中关于我项目的笔记,并在今天的每日笔记中添加一份摘要吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体向正在运行的 Obsidian 应用发送命令,由它读取、写入或搜索你的笔记。要使其工作,Obsidian 必须处于打开状态。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Obsidian CLI
Use the obsidian CLI to interact with a running Obsidian instance. Requires Obsidian to be open.
Command reference
Run obsidian help to see all available commands. This is always up to date. Full docs: https://help.obsidian.md/cli
Syntax
Parameters take a value with =. Quote values with spaces:
obsidian create name="My Note" content="Hello world"
Flags are boolean switches with no value:
obsidian create name="My Note" silent overwrite
For multiline content use \n for newline and \t for tab.
File targeting
Many commands accept file or path to target a file. Without either, the active file is used.
file=<name>— resolves like a wikilink (name only, no path or extension needed)path=<path>— exact path from vault root, e.g.folder/note.md
Vault targeting
Commands target the most recently focused vault by default. Use vault=<name> as the first parameter to target a specific vault:
obsidian vault="My Vault" search query="test"
Common patterns
obsidian read file="My Note"
obsidian create name="New Note" content="# Hello" template="Template" silent
obsidian append file="My Note" content="New line"
obsidian search query="search term" limit=10
obsidian daily:read
obsidian daily:append content="- [ ] New task"
obsidian property:set name="status" value="done" file="My Note"
obsidian tasks daily todo
obsidian tags sort=count counts
obsidian backlinks file="My Note"
Use --copy on any command to copy output to clipboard. Use silent to prevent files from opening. Use total on list commands to get a count.
Plugin development
Develop/test cycle
After making code changes to a plugin or theme, follow this workflow:
- Reload the plugin to pick up changes:
obsidian plugin:reload id=my-plugin - Check for errors — if errors appear, fix and repeat from step 1:
obsidian dev:errors - Verify visually with a screenshot or DOM inspection:
obsidian dev:screenshot path=screenshot.png obsidian dev:dom selector=".workspace-leaf" text - Check console output for warnings or unexpected logs:
obsidian dev:console level=error
Additional developer commands
Run JavaScript in the app context:
obsidian eval code="app.vault.getFiles().length"
Inspect CSS values:
obsidian dev:css selector=".workspace-leaf" prop=background-color
Toggle mobile emulation:
obsidian dev:mobile on
Run obsidian help to see additional developer commands including CDP and debugger controls.
常见问题
Obsidian 需要处于打开状态吗?
需要。该技能说明,命令行工具只能与正在运行的 Obsidian 实例配合使用。
它使用哪个库?
默认使用最近获得焦点的库,但你也可以指定某个特定的库。
它可以管理任务和属性吗?
可以。该技能涵盖任务、属性等。
详情
作者的原始描述
Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more. Also supports plugin and theme development with commands to reload plugins, run JavaScript, capture errors, take screenshots, and inspect the DOM. Use when the user asks to interact with their Obsidian vault, manage notes, search vault content, perform vault operations from the command line, or develop and debug Obsidian plugins and themes.
repo: kepano/obsidian-skills
热度
- GitHub 星标
- 51k
- 排名
- #3418
- 许可证
- MIT
- 更新时间
- 2026/9/15
评论
- …