Replies: 4 comments 1 reply
-
|
Hi, thank you for the writeup and the draft PR! The timing on this is great, with Obsidian CLI recently validating the usecase. I had considered building a headless client before, but I had rejected it because: (1) listening to filesystem events in a cross-platform binary is hard. we're probably underestimating obsidian's abstractions on the file API. But adding a headless client is a big add-on for power users, and we can feasibly build this if we constraint to Linux users only. I'm fully onboard with this. We can proceed with the monorepo workspace (@yaos/cli). I have some hard boundaries to ensure this goes smoothly:
To be clear, your PR is great as an alpha. My response should clear out the direction I want to take, and I'll mention any bugs in the PR itself. In short, |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the clear direction — I agree on all four points. I'll start on atomic writes (write-to-temp → fsync → rename) and the state-file bailout mechanism on the existing PR so that feedback is addressed. The PR stays in alpha shape until the VaultFS extraction lands. Regarding #2 — I'd be happy to take a first pass at the client-side VaultFS interface in a week or so if that's helpful. I have a concrete picture of what the Node adapter needs from having built the CLI. Let me know if you'd prefer to drive it yourself or if you'd want me to propose something. |
Beta Was this translation helpful? Give feedback.
-
That would be really helpful, feel free to take a pass at it! Just heads-up: because of the massive influx of users, my first priority is stabilizing the core engine and patching high-priority edge cases on main. I want to make sure the core is rock-solid before we execute a massive interface refactor. Go ahead and draft that the extraction whenever you're ready. Once I'm done, I'll jump in too. Now, about "Are there architectural invariants I'm missing that would make this harder than "replace VFS calls with fs calls"?" I want to share a few edge cases I reasoned through that are not a concern, but you should know:
The invariants -
Again, I appreciate the help! |
Beta Was this translation helpful? Give feedback.
-
|
Not really relevant, but just want to say really glad this is happening, I am the maintainer of https://github.com/obsidian-nvim/obsidian.nvim which recently added support for syncing with the new obsidian-headless client, and currently working on splitting the sync "backend" and "frontend" and adding a git backend today just as a fun side exploration and to see if my frontend (what triggers sync and etc) is generalized enough, I came to this repo which I saw the post on reddit the other day, and found a wealth of interesting design notes and this issue. It would be incredible once yaos-cli is a thing, then I can support it as a sync backend for obsidian.nvim, and one can use obsidian.nvim on computer and yaos plugin on obsidian mobile app, a real clean and powerful setup. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Use case
I run a headless Linux server (no GUI, no Obsidian desktop) that holds my vault files. I want this server to participate in YAOS sync with Obsidian on macOS/iOS. The server would read/write the local filesystem and sync with the YAOS CRDT like any other peer.
This is distinct from the existing "external edit" feature (which watches a filesystem where Obsidian is running). This is YAOS sync to a bare filesystem on a machine without Obsidian installed.
Relation to Issue #2 (Self-hosted runtime)
I see #2 is extracting a runtime-agnostic core layer for server self-hosting. A headless client would be a natural symmetric counterpart: a client peer that participates in the YAOS sync without the Obsidian UI, reading/writing a local filesystem directory.
Where #2 is about "run the YAOS server on my own machine," this is about "run a YAOS client on my server that syncs to a room hosted on Cloudflare (or elsewhere)."
What I'm asking
Would you accept a PR that adds a headless CLI client to YAOS?
The scope would be:
VaultSync+diskMirrorlogic, but with Nodefsinstead of Obsidian'sVaultAPI@yaos/clior similar from the same repoTechnical feasibility (from my analysis)
The Obsidian coupling in
diskMirror.tsappears mechanical, not architectural:vault.read()→fs.readFile(),vault.modify()→fs.writeFile(), etc.normalizePath()→path.normalize()orpath.posix.normalize()vault.on('modify')→chokidarorfs.watchvaultSync.tsis already mostly runtime-agnostic (onlynormalizePathfrom Obsidian).The risk I see: schema drift. YAOS is at schema v2 with active migration logic. A standalone implementation would need to track schema changes reactively. Maintaining this in-repo would leverage the existing test infrastructure and migration paths.
Questions for maintainers
packages/cliworkspace) or as a separate repo under the YAOS org?If the answer is "yes, but later" or "yes, with changes," I'm happy to wait or revise the approach. If the answer is "no, out of scope," I'll respect that and build standalone (with the understanding that I'll be tracking an undocumented evolving protocol).
Checklist:
diskMirror.tsandvaultSync.tscouplingBeta Was this translation helpful? Give feedback.
All reactions