obsidian-headless
Obsidian Headless
Use Obsidian Headless (ob) to run Obsidian Sync and Obsidian Publish from the command line. It doesn't need the desktop app, so it works on servers, in CI, and in sandboxes. It's in open beta. Docs: https://help.obsidian.md/headless
ob only syncs and publishes files. To read or change notes without the app, edit the files directly and follow the obsidian-markdown skill. To control a running desktop app, use the obsidian-cli skill.
Before using ob
Check availability with ob --help. If it is missing, explain that Obsidian Headless requires Node.js 22 or later and offer installation with npm install -g obsidian-headless. Run ob <command> --help for a command's options.
Sync and Publish each need an active subscription on the user's account.
Most commands accept --json for machine-readable output.
Log in
ob login prints the account when already logged in. Otherwise it prompts for email, password, and a 2FA code, so ask the user to run it in their own terminal. Don't ask for their password or pass it with --password. ob logout clears the stored credentials.