Obsidian Official CLI Headless
Treat the official Obsidian CLI as a desktop-first app adaptation problem, not a normal CLI install.
Core rules
- - Use this skill only for the official Obsidian CLI.
- Assume headless Linux needs a dedicated non-root user,
Xvfb, and a wrapper command. - Prefer ACLs over ownership changes when the vault lives under
/root. - Prefer one target vault.
- Keep the user away from
su - obsidian and display details by exposing /usr/local/bin/obs.
Fast path
- 1. Confirm the vault path. Default to
/root/obsidian-vault only if the user does not specify another path. - Run
scripts/install_official_obsidian.sh as root. - Run
scripts/configure_official_cli.sh <vault_path> as root. - Run
scripts/verify_official_cli.sh [vault_path]. - Report the wrapper path, active vault, verified commands, and remaining caveats.
What this skill owns
- - Official Obsidian
.deb install - Headless runtime dependencies needed for field use
- Dedicated
obsidian user - Official CLI enablement via INLINECODE10
- Vault access via ACLs
- INLINECODE11 wrapper
- Verification of
help, vault, daily:path, daily:append, daily:read, and INLINECODE17
What not to do
- - Do not use this skill for
notesmd-cli or lightweight markdown-only workflows. - Do not expand into plugins, sync setup, theme tuning, or full desktop environment work unless the user explicitly asks.
- Do not broaden permissions more than needed.
Wrapper model
The wrapper should effectively run:
CODEBLOCK0
That is the stable operating model on a headless host.
Verification commands
Use at minimum:
CODEBLOCK1
References
- - Read
references/architecture.md when you need the rationale for non-root user, Xvfb, ACLs, or wrapper design. - Read
references/troubleshooting.md when the install works partially but CLI behavior still fails.
Report format
Keep the result short:
- - installed version
- wrapper path
- active vault path
- verified commands
- remaining limits
Obsidian 官方 CLI 无头模式
将官方 Obsidian CLI 视为一个桌面优先应用的适配问题,而非普通的 CLI 安装。
核心规则
- - 仅将此技能用于官方 Obsidian CLI。
- 假设无头 Linux 需要专用的非 root 用户、Xvfb 以及一个包装命令。
- 当仓库位于 /root 下时,优先使用 ACL 而非更改所有权。
- 优先使用单一目标仓库。
- 避免用户使用 su - obsidian,通过暴露 /usr/local/bin/obs 来显示详细信息。
快速路径
- 1. 确认仓库路径。仅当用户未指定其他路径时,默认使用 /root/obsidian-vault。
- 以 root 身份运行 scripts/installofficialobsidian.sh。
- 以 root 身份运行 scripts/configureofficialcli.sh path>。
- 运行 scripts/verifyofficialcli.sh [vaultpath]。
- 报告包装路径、活动仓库、已验证的命令以及剩余注意事项。
本技能负责的内容
- - 官方 Obsidian .deb 安装
- 现场使用所需的无头运行时依赖
- 专用的 obsidian 用户
- 通过 ~/.config/obsidian/obsidian.json 启用官方 CLI
- 通过 ACL 访问仓库
- /usr/local/bin/obs 包装命令
- 验证 help、vault、daily:path、daily:append、daily:read 和 search
禁止事项
- - 不要将此技能用于 notesmd-cli 或轻量级纯 Markdown 工作流。
- 除非用户明确要求,否则不要扩展到插件、同步设置、主题调整或完整的桌面环境工作。
- 不要扩大权限范围超出必要程度。
包装模型
包装命令应有效运行:
bash
su - obsidian -c cd && xvfb-run -a /usr/bin/obsidian --disable-gpu ...
这是在无头主机上的稳定运行模式。
验证命令
至少使用以下命令:
bash
obs help
obs vault
obs daily:path
obs daily:append content=skill verification
obs daily:read
obs search query=skill verification
参考资料
- - 当需要了解非 root 用户、Xvfb、ACL 或包装设计的设计原理时,请阅读 references/architecture.md。
- 当安装部分成功但 CLI 行为仍然失败时,请阅读 references/troubleshooting.md。
报告格式
保持结果简洁:
- - 已安装版本
- 包装路径
- 活动仓库路径
- 已验证的命令
- 剩余限制