Git Backed Obsidian CLI Workflows
Use the official Obsidian CLI as the primary workflow surface. Treat Git sync as a write-only follow-up, not part of read/query operations.
Core rules
- - Assume the official Obsidian CLI is already installed and usable.
- Use CLI-native read/query commands first for search, read, links, outline, tags, tasks, and related vault inspection.
- Use CLI-native write commands first for
daily, daily:append, create, and similar lightweight note updates. - After successful write operations, run the vault backup/sync script.
- Do not run Git sync after read-only operations.
- If a write-oriented CLI path is unavailable or unsuitable, fall back to direct file writing only when the workflow explicitly supports it.
- If sync fails after a successful write, report that the note was written but not synced.
Environment model
This skill is not server-only. Use it anywhere the official Obsidian CLI is already available:
- - desktop Linux
- macOS
- Windows environments where the official CLI is working
- headless/server environments that have already been adapted
If the environment is a headless server and the official CLI is not yet usable, use obsidian-official-cli-headless first. That skill handles server adaptation and installation. This skill handles the day-to-day note workflows after the CLI works.
Fast path
- 1. Classify the request as either:
- read/query
- write/update
- 2. For read/query tasks, use the official CLI directly.
- For write/update tasks, use the official CLI first, then run backup/sync.
- Use fallback file writing only for supported write workflows when CLI writing is unavailable.
- Report the target note/path, whether CLI or fallback was used, and whether sync succeeded.
Common read/query commands
Prefer commands such as:
CODEBLOCK0
Use exact commands supported by the installed official CLI.
Common write/update commands
Prefer commands such as:
CODEBLOCK1
After a successful write, run the backup script.
Bundled scripts
Use scripts/notes_workflow.py when you need a deterministic wrapper for:
- - daily-note append with sync
- lightweight memo/inbox capture with fallback write
- simple note create/append workflows with post-write sync
Use scripts/backup.sh as the default post-write Git sync path for this skill.
References
- - Read
references/query-vs-write.md to choose whether a task should trigger sync. - Read
references/fallbacks.md for the fallback policy and reporting rules. - Read
references/workflow-surface.md to understand why the wrapper script supports a narrower write surface than the full official CLI. - Read
references/environment-note.md for the split between general CLI workflows and headless/server adaptation.
What not to do
- - Do not use this skill to install or configure the official CLI environment; use
obsidian-official-cli-headless for that. - Do not force-push from automation.
- Do not expand into full vault restructuring, plugin setup, or GUI management.
What to report
Keep the result minimal:
- - command or workflow used
- target note/path
- whether sync ran
- whether sync succeeded
Git 支持的 Obsidian CLI 工作流
将官方 Obsidian CLI 作为主要工作流界面。将 Git 同步视为仅写入的后续操作,而非读取/查询操作的一部分。
核心规则
- - 假设官方 Obsidian CLI 已安装且可用。
- 优先使用 CLI 原生读取/查询命令进行搜索、读取、链接、大纲、标签、任务及相关仓库检查。
- 优先使用 CLI 原生写入命令执行 daily、daily:append、create 及类似的轻量级笔记更新。
- 成功执行写入操作后,运行仓库备份/同步脚本。
- 仅执行读取操作后不运行 Git 同步。
- 如果面向写入的 CLI 路径不可用或不适用,仅在工作流明确支持的情况下回退到直接文件写入。
- 如果写入成功后同步失败,报告笔记已写入但未同步。
环境模型
此技能并非仅限服务器使用。可在任何已安装官方 Obsidian CLI 的环境中使用:
- - 桌面 Linux
- macOS
- 已运行官方 CLI 的 Windows 环境
- 已适配的无头/服务器环境
如果环境为无头服务器且官方 CLI 尚不可用,请先使用 obsidian-official-cli-headless。该技能处理服务器适配和安装。本技能在 CLI 可用后处理日常笔记工作流。
快速路径
- 1. 将请求分类为:
- 读取/查询
- 写入/更新
- 2. 对于读取/查询任务,直接使用官方 CLI。
- 对于写入/更新任务,先使用官方 CLI,然后运行备份/同步。
- 仅在 CLI 写入不可用时,对支持的写入工作流使用回退文件写入。
- 报告目标笔记/路径、是否使用了 CLI 或回退方式,以及同步是否成功。
常用读取/查询命令
优先使用如下命令:
bash
obs search query=...
obs read file=...
obs daily:read
obs links file=...
obs outline file=...
obs tags
obs tasks daily
obs vault
使用已安装官方 CLI 支持的确切命令。
常用写入/更新命令
优先使用如下命令:
bash
obs daily
obs daily:append content=...
obs create name=... content=...
成功写入后,运行备份脚本。
捆绑脚本
当需要确定性封装时,使用 scripts/notes_workflow.py 处理:
- - 带同步的日记笔记追加
- 带回退写入的轻量级备忘录/收件箱捕获
- 带写入后同步的简单笔记创建/追加工作流
使用 scripts/backup.sh 作为本技能的默认写入后 Git 同步路径。
参考资料
- - 阅读 references/query-vs-write.md 以确定任务是否应触发同步。
- 阅读 references/fallbacks.md 了解回退策略和报告规则。
- 阅读 references/workflow-surface.md 了解为何封装脚本支持的写入范围比完整官方 CLI 更窄。
- 阅读 references/environment-note.md 了解通用 CLI 工作流与无头/服务器适配之间的区分。
禁止事项
- - 请勿使用此技能安装或配置官方 CLI 环境;请使用 obsidian-official-cli-headless 处理。
- 请勿从自动化工具强制推送。
- 请勿扩展至完整的仓库重构、插件设置或 GUI 管理。
报告内容
保持结果简洁:
- - 使用的命令或工作流
- 目标笔记/路径
- 是否运行了同步
- 同步是否成功