Possibility for headless syncing with a CLI/daemon

it’s been 3 years, it’s about time we had this!

I am currently setting up a raspberry pi to automate some tasks on my vault like watching out for certain tags and sorting things/tracking tasks, but that is stuck at square one if sync can’t actually sync!

I am genuinely surprised that this isn’t already a thing. Until now I thought obsidian WAS syncing through some daemon, rather than just through the app itself.

+1 to this. I’d love to set up remote backups on a headless Linux server. I guess with syncthing I could achieve the same, but it would be great to be able to set up some CLI version of Obsidian itself.

This would be game changing. And unlikely to be complex!

This can also be just an API access, or a bit of documentation on how the current clients access the sync servers. I’m sure the community would develop the CLI tool in a heartbeat

I did it. Here’s how: Setting up a headless Obsidian instance for syncing - @rolle / Web designer, web developer

1 Like

It seems there are different needs for this. Some need (primarily) sync-down (for backups) some need sync-up (for those using a different editor).

For those needing sync-down with a desktop primary device as computer attached to network just save the vault on the network share that does your backups (Unraid w/ Crashplan and Duplicati in my case). If laptop, VPN may be a good option to write back to that same area even on the go, otherwise if you use a desktop with the above solution enough it will sync enough. Laptop in Windows also have a ‘sync to network’ feature. As long as that network feature is also in y our backup path it will be backed up.

For those needing sync-up (if using a different editor and Obsidian Sync service), my best solution is to make sure the obsidian client starts at startup (or on a periodic timer) to do the sync but use VSCode, neovim whatever as an editor, but I do use a desktop as my daily driver.

Another option for either direction that is lighter weight than a VM is to use it in a Docker container with an exposed browser interface if you have docker on some application server on your network (or locally maybe, but might as well use the GUI client in that case). Then you can get a continuously running obsidian for backups. Search ‘obsidian’ on dockerhub.

These are great thoughts - the challenge i think remains to keep this ‘headless’ (i.e. without having the desktop app open on an X instance). A CLI sync version would be super useful. Filen has launched that and it works very well - CLI – Filen – Next Generation End-To-End Encrypted Cloud Storage

1 Like

+1; this would be useful for me.

In my case, I use Obsidian as my main editor on mobile, but often use other editors for the files on desktop; having a headless Obsidian Sync running would make it substantially cheaper to ensure that my mobile edits are consistently pulled down to desktop before I view/edit there, and that my desktop edits are consistently pulled up to mobile before I view/edit there, compared with the current status quo where both of those happen only if I happen to have the vault I’ve edited open on desktop in the full resource-heavy Electron app.

(I use multiple vaults, and each one syncs only when opened, separate from the others; so the problem is somewhat exacerbated in my case compared with what I’d have to deal with in a one-vault setup. Not as trivially solvable via pure “launch desktop app on system startup”, because that only opens a single vault.)

1 Like

I want to be able to pull my data so I can create embeddings and store in my vector database! Since Obsidian Sync doesn’t offer this I’m going to have to roll my own sync so I can access the source of truth.

Hi, this docker image runs Obisidian in a VM (KasmVNC), which can be used as a workaround for a “headless” instance. I have mounted a directory on my server as a volume to the container, accessed the GUI via the browser / VM to connect the server instance to my Obsidian Syn vault and just leave it running.

I may be in a niche, but I think that such a feature would make sense. I had previously used Obsidian Sync, but have stopped because I couldn’t get my notes to sync to my old raspberrypi (which runs some scripts for me). Whereas, syncthing had no such issue.

There are downsides to syncthing (requires setup, mobile support has its ups and downs), and I would have gladly re-subscribed to Obsidian Sync - however, I would really like to be able to do that headless sync.

This would be very nice to be able to at least trigger a sync from the CLI, but installed as a service as well. Would reduce first launch sync times, and also it would help with situations where you want to backup or as others mentioned use local agents to modify/create files that should sync up for other devices to see in a headless nature.

+1 on this. I just set up a clawdbot in cloud and want it to have access to my obsidian synced notes

1 Like

Also came here via OpenClaw (formerly clawdbot.) Was using UpNote for a long time (and Evernote before that.) I literally just paid for Obsidian Sync because I assumed this feature would exist, so that I could get my notes syncing to my server and my AI agent can help organize them and refer to them. So this would be much appreciated.

Running the GUI in a VM is a bit annoying but might do that if it’s the only way

Love it. Having to run Obsidian behind Xvfb is ridiculous.

Please make a bidirectional `obsidian-sync` thing that we can run as a service :ok_hand:

Just wanted to say that I unsubscribed from sync and switched to syncthing for this reason. I would have happily continue paying for sync If a daemon was available.

The new obsidian CLI in catalyst is it just possible to put that on a cron job to sync?

The Obsidian CLI in catalyst is a command line interface for the main Obsidian app, which must be running for the Obsidian CLI to work.

On a different note, a separate obsidian sync client that runs in the terminal and is independent from the main app is currently in development (it’s on the roadmap).

Headless Sync is now available in open beta:

3 Likes

Excited to see the progress on headless and the CLI — these are great additions!

One thing I’m curious about: is there a plan to allow the CLI to talk to a headless instance instead of the Desktop App? Right now my understanding is that the CLI requires the Desktop App to be running, which makes sense — the app handles all the vault intelligence like indexing, tags, backlinks, and Bases.

But for server or automation use cases (especially with third-party sync like Syncthing), it would be really powerful if the headless mode could act as that same engine — so the CLI could do things like search, query tags, find related notes, and interact with Bases, all without a GUI.

Is that something on the roadmap, or is headless currently scoped only to sync?