obsidian-cli by kepano/obsidian-skills
npx skills add https://github.com/kepano/obsidian-skills --skill obsidian-cli使用 obsidian CLI 与正在运行的 Obsidian 实例进行交互。需要 Obsidian 处于打开状态。
运行 obsidian help 查看所有可用命令。此列表始终保持最新。完整文档:https://help.obsidian.md/cli
参数 使用 = 来指定值。如果值包含空格,请用引号括起来:
obsidian create name="My Note" content="Hello world"
标志 是没有值的布尔开关:
obsidian create name="My Note" silent overwrite
对于多行内容,使用 \n 表示换行,\t 表示制表符。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
许多命令接受 file 或 path 来定位一个文件。如果两者都未指定,则使用当前活动文件。
file=<名称> — 像维基链接一样解析(仅需名称,无需路径或扩展名)path=<路径> — 从库根目录开始的精确路径,例如 folder/note.md默认情况下,命令以最近获得焦点的库为目标。使用 vault=<名称> 作为第一个参数来指定特定库:
obsidian vault="My Vault" search query="test"
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"
在任何命令上使用 --copy 可将输出复制到剪贴板。使用 silent 可防止文件被打开。在列表命令上使用 total 可获取计数。
对插件或主题进行代码更改后,请遵循以下工作流程:
重新加载 插件以获取更改:
obsidian plugin:reload id=my-plugin
检查错误 — 如果出现错误,请修复并从第 1 步重复:
obsidian dev:errors
视觉验证,使用截图或 DOM 检查:
obsidian dev:screenshot path=screenshot.png
obsidian dev:dom selector=".workspace-leaf" text
检查控制台输出,查看警告或意外日志:
obsidian dev:console level=error
在应用上下文中运行 JavaScript:
obsidian eval code="app.vault.getFiles().length"
检查 CSS 值:
obsidian dev:css selector=".workspace-leaf" prop=background-color
切换移动设备模拟:
obsidian dev:mobile on
运行 obsidian help 以查看其他开发者命令,包括 CDP 和调试器控制。
每周安装量
7.8K
仓库
GitHub 星标数
16.9K
首次出现
2026年2月11日
安全审计
安装于
codex7.5K
opencode7.4K
gemini-cli7.4K
github-copilot7.3K
amp7.3K
kimi-cli7.3K
Use the obsidian CLI to interact with a running Obsidian instance. Requires Obsidian to be open.
Run obsidian help to see all available commands. This is always up to date. Full docs: https://help.obsidian.md/cli
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.
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.mdCommands 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"
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.
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
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.
Weekly Installs
7.8K
Repository
GitHub Stars
16.9K
First Seen
Feb 11, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykPass
Installed on
codex7.5K
opencode7.4K
gemini-cli7.4K
github-copilot7.3K
amp7.3K
kimi-cli7.3K
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装