A macOS LaunchAgent plist that runs Obsidian Headless Sync continuously in the background, starting automatically at login.
Do not run both the Obsidian desktop app’s built-in Sync and Headless Sync on the same machine. This can cause data conflicts.
-
Install the headless client:
npm install -g obsidian-headless
-
Log in and link your local vault to a remote vault (one-time):
ob login cd /path/to/local/vault ob sync-setup --vault "Your Remote Vault"
-
Edit
md.obsidian.headless-sync.plist:- Set the path to
ob(runnpm prefix -gto find it). - Set the path to your local vault directory.
- Set the path to
-
Copy the plist and load the agent:
cp md.obsidian.headless-sync.plist ~/Library/LaunchAgents/ launchctl load ~/Library/LaunchAgents/md.obsidian.headless-sync.plist
Verify the agent is running:
launchctl list | grep obsidianTail the logs:
tail -f /tmp/obsidian-headless-sync.log
tail -f /tmp/obsidian-headless-sync.errStop the agent:
launchctl unload ~/Library/LaunchAgents/md.obsidian.headless-sync.plist- The agent starts at login and auto-restarts on crash.
- Logs are written to
/tmp/obsidian-headless-sync.log(stdout) and/tmp/obsidian-headless-sync.err(stderr).