Skip to content

Headless CLI client for YAOS #11

@enieuwy

Description

@enieuwy

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:

  • A Node.js CLI that connects to an existing YAOS room (not a self-hosted server replacement)
  • Uses the same VaultSync + diskMirror logic, but with Node fs instead of Obsidian's Vault API
  • Shares the CRDT schema, migration logic, and auth flow with the plugin
  • Published as @yaos/cli or similar from the same repo

Technical feasibility (from my analysis)

The Obsidian coupling in diskMirror.ts appears mechanical, not architectural:

  • File operations: vault.read()fs.readFile(), vault.modify()fs.writeFile(), etc.
  • Path normalization: normalizePath()path.normalize() or path.posix.normalize()
  • Event watching: vault.on('modify')chokidar or fs.watch
  • ~31 Obsidian API refs, concentrated in ~6 operations

vaultSync.ts is already mostly runtime-agnostic (only normalizePath from 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

  1. Is headless client support in scope for YAOS, or is the project intentionally Obsidian-only?
  2. Would you prefer this in the main repo (as a packages/cli workspace) or as a separate repo under the YAOS org?
  3. Should this wait for Issue Add a self-hosted Docker runtime #2 to land (runtime-agnostic core extraction), or could it proceed in parallel?
  4. Are there architectural invariants I'm missing that would make this harder than "replace VFS calls with fs calls"?

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:

  • Searched existing issues for "headless", "cli", "terminal", "standalone", "server" — no matches
  • Read the self-host RFC (Add a self-hosted Docker runtime #2)
  • Reviewed diskMirror.ts and vaultSync.ts coupling

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions