Skip to content

[Feature Request]: Sync a local/server folder of Markdown files with AFFiNE (bidirectional) #14118

@miztizm

Description

@miztizm

Description

Summary

I want AFFiNE to support syncing a folder of .md files (local or on a server path) into an AFFiNE workspace, so the folder becomes a “source of truth” that stays synchronized with AFFiNE documents.

What I’m requesting

A feature that lets users select a folder (local or server-mounted) and enable continuous sync between:

  • filesystem Markdown files (.md)

  • AFFiNE pages/docs

Core requirements

  1. Folder → AFFiNE sync

    • Detect create/update/delete/rename of .md files

    • Mirror folder structure as a tree in AFFiNE (folders → collections/spaces/trees)

  2. AFFiNE → Folder sync

    • Saving a page updates the corresponding .md file

    • Renaming a page renames the file

    • Moving a page updates the folder path

  3. Stable mapping

    • Keep a stable relationship between file and doc (even if renamed/moved)

    • Suggested: store an internal ID in frontmatter (affine_id) or sidecar file

  4. Conflict handling

    • If both changed, show diff + choose resolution (or keep both)
  5. Frontmatter support

    • Preserve YAML frontmatter (tags, title, created/updated, custom metadata)
  6. Selective sync rules

    • Include/exclude patterns (**/tmp/**, .git, *.bak, etc.)

    • Option to sync only a subfolder

Nice-to-haves

  • Git-friendly output (stable formatting, no random reorder)

  • Support multiple folders (multiple “mounts” into workspace)

  • Option to export AFFiNE-only block features into Markdown in a predictable way

  • CLI mode for servers (headless sync daemon)

Why this matters

This would let AFFiNE fit into real-world workflows where the filesystem + git is the canonical storage, while AFFiNE becomes the best UI layer on top of it.

Questions

  • Is there an existing roadmap item for “folder sync” or “filesystem workspace”?

  • Would you prefer implementing it as a plugin, or core feature?

  • If plugins are possible: what hooks/APIs exist for file watchers + doc CRUD?

Use case

I keep my knowledge base as Markdown files in a filesystem folder (git-backed). I want:

  • To keep editing in my editor (VS Code, Neovim, etc.)

  • While also using AFFiNE for visual organization, blocks, linking, and collaborative workflows

  • Without manual import/export or losing folder structure

Today, most tools either:

  • import once (no ongoing sync), or

  • export in a way that breaks stable file paths, IDs, or structure.

Anything else?

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Metadata

Metadata

Assignees

Labels

storyFeatures perceivable by end-users

Type

No type

Projects

Status

🆕 *Untriaged

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions