This repository has been archived on 2026年02月25日 . You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
- Rust 98.7%
- Nix 1.3%
| darn_cli | Split out file scan step from ingestion | |
| darn_core | Split out file scan step from ingestion | |
| design | Improve concurrency | |
| .gitignore | Initial darn implementation | |
| Cargo.toml | Split out file scan step from ingestion | |
| flake.lock | Improve concurrency | |
| flake.nix | Initial darn implementation | |
| HACKING.md | Initial darn implementation | |
| README.md | Split out file scan step from ingestion | |
darn 🪡🧦
Directory-based Automerge Replication Node
A CLI for managing CRDT-backed files with automatic conflict resolution and peer-to-peer synchronization.
Overview
darn brings collaborative editing to your filesystem. Files are stored as Automerge documents and synchronized peer-to-peer using Subduction. Think of it as "Dropbox meets git" - but without merge conflicts or the vendor lock-in.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Your Machine │ │ Peer's Machine │ │ Another Peer │
│ │ sync │ │ sync │ │
│ .darn/ │─────▶│ .darn/ │─────▶│ .darn/ │
│ └── storage/ │◀─────│ └── storage/ │◀─────│ └── storage/ │
│ ... │ │ ... │ │ ... │
└─────────────────┘ └─────────────────┘ └─────────────────┘
Features
- Local-first: Works offline, syncs when connected
- Conflict-free: CRDTs automatically merge concurrent edits
- P2P sync: No central server required (though you can run one)
- Text collaboration: Character-level merging for text files
Quick Start
# Initialize a workspace
darn init
# Track some files
darn track README.md src/*.rs
# Check status
darn tree
# Sync with peers
darn sync
See darn_cli/README.md for full CLI documentation.
Installation
# From source
cargo install --path darn_cli
# With Nix
nix develop
cargo build --release
Crates
| Crate | Description |
|---|---|
darn_core |
Core library - workspace, documents, manifest |
darn_cli |
CLI binary - user-facing commands |
How It Works
File Storage
Files are converted to Automerge documents following the Patchwork schema:
| File Type | Storage Format | Merge Semantics |
|---|---|---|
| Text | Text object |
Character-level CRDT |
| Binary | Bytes scalar |
Whole-file last-writer-wins |
Sync Protocol
darn uses Subduction for peer-to-peer synchronization:
- Sedimentree partitions documents into content-addressed fragments
- Strata (hash-based depth levels) enable efficient set reconciliation
- WebSocket transport with Ed25519 authentication
Development
cargo build # Build
cargo test # Test
cargo clippy # Lint
See HACKING.md for development details.
License
Apache-2.0 OR MIT