Use Obsidian Sync on Desktop without Installing Obsidian

neverland 2026-06-03 09:03:24 累计浏览 350 次

I know this might sound a bit odd. Let me explain: (1) Obsidian Sync is, for now, the most stable, lowest-latency cross-platform (including desktop and mobile) service I’ve found for syncing plain text notes, and it works better than various cloud storage options; but (2) I mainly use Obsidian on mobile, while on desktop I prefer VS Code (see my setup in “VS Code as A Scratchpad”). Previously, to keep things synced, I had to keep Obsidian running on my computer, which is a heavy Electron app, and if it accidentally closed, syncing would stop.

A while ago, I noticed Obsidian released a headless version of the Obsidian Sync terminal client. (I loathe the recent “claw hype” but concede that it contributed to a CLI renaissance, after all.) Once set up, ob --continuous starts monitoring and syncing the notes folder in real time, which is exactly what I need. The only downside is that it doesn’t run in the background or stay active persistently. But that’s fine — this is exactly what PID 1 excels at. For example, on macOS, you can achieve this with launchd. The steps are as follows.

  1. Install obsidian-headless

    npm install -g obsidian-headless
  2. Log in and connect your notes library

    cd /path/to/local/vault
    ob login
    ob sync-setup --vault "Your Remote Vault"
  3. Create a Launch Agent under ~/Library/LaunchAgents/ with the name, for example, md.obsidian.headless-sync.plist (GitHub):

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
    "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    
    <key>Label</key>
    <string>md.obsidian.headless-sync</string>
    
    <key>ProgramArguments</key>
    <array>
        <!-- Replace with your output of npm prefix -g -->
        <string>/opt/homebrew/bin/ob</string>
        <string>sync</string>
        <string>--path</string>
        <!-- Replace with your local vault path -->
        <string>/path/to/local/vault/</string>
        <string>--continuous</string>
    </array>
    
    <key>RunAtLoad</key>
    <true/>
    
    <key>KeepAlive</key>
    <dict>
        <key>SuccessfulExit</key>
        <false/>
    </dict>
    
    <key>StandardOutPath</key>
    <string>/tmp/obsidian-headless-sync.log</string>
    
    <key>StandardErrorPath</key>
    <string>/tmp/obsidian-headless-sync.err</string>
    
    <key>EnvironmentVariables</key>
    <dict>
        <key>PATH</key>
        <string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
    </dict>
    
    </dict>
    </plist>
  4. Load the Launch Agent and verify

    launchctl load ~/Library/LaunchAgents/md.obsidian.headless-sync.plist
    launchctl list | grep obsidian
    tail -f /tmp/obsidian-headless-sync.log

From now on, Obsidian Sync will automatically start syncing after login and restart if it exits unexpectedly. This headless version uses about 40 MB+ of memory, which, while still not a small footprint — Node being Node — is only a fraction of the GUI version.

(On Linux and Windows, you can use systemd and Task Scheduler, respectively, to similar effect.)

同分类推荐文章

  1. 从 JetBrains 的亏损聊起 (2026-11-13 19:40:02)
  2. OpenLogi 上手:高性能低占用的支持多终端的本地无账号罗技驱动 (2026-11-13 17:40:02)
  3. 拿着锤子找钉子,AI 时代的创新幻觉 (2026-11-13 15:10:02)

查看更多 开发者 文章 →

建议继续学习

  1. 给年轻程序员的几句话 (累计阅读 6,342)
  2. GitHub中的README.MD文件编写语法 (累计阅读 6,041)
  3. 关于恐惧的自白 (累计阅读 5,817)
  4. 为什么创业公司需要写博客? (累计阅读 4,208)
  5. 一些做产品的项目经验:立项、流程、文档 (累计阅读 4,038)
  6. 在公众号中优雅地呈现代码 (累计阅读 3,851)
  7. 给明年依然年轻的我们 (累计阅读 3,653)
  8. 程序员如何写出一份好的文档? (累计阅读 3,637)
  9. Omi应用md2site发布-markdown转网站利器 (累计阅读 3,402)
  10. 程序员为什么要学好英语 (累计阅读 3,095)