darn_cli 0.2.0

CLI for darn - CRDT-backed filesystem management
darn_cli-0.2.0 is not a library.

darn

Directory-based Automerge Replication Node

CLI for darn - sync directories over CRDTs.

Installation

cargo install --path .

Or from the workspace root:

cargo install --path darn_cli

Commands

Initialize a Workspace

darn init

Creates a .darn/ directory in the current folder. On first run, also sets up your global signer key at ~/.config/darn/signer/.

Track Files

darn track myfile.txt
darn track src/*.rs

Converts files to Automerge documents and stores them in .darn/storage/.

View Tracked Files

darn tree

Shows all tracked files with state indicators:

Workspace: /home/user/project

    src/main.rs
  M src/lib.rs
  ! deleted_file.txt

3 tracked: 1 clean, 1 modified, 1 missing
Indicator Meaning
(space) Clean - file matches stored version
M Modified - file changed on disk
! Missing - file deleted from disk

Stop Tracking

darn untrack myfile.txt

Removes from manifest but keeps the local file.

Sync with Peers

# Sync with all peers
darn sync

# Sync with specific peer
darn sync --peer ws://192.168.1.50:8080

Automatically commits any local changes before syncing.

Manage Peers

darn peer add ws://192.168.1.50:8080
darn peer list
darn peer remove ws://192.168.1.50:8080

Watch for Changes

darn watch

(Not yet implemented) Auto-sync when files change.

Ignore Patterns

Create a .darnignore file (gitignore syntax):

.git/

# Build artifacts
target/
*.o

# Editor files
*.swp
*~

# Secrets
.env
*.key

The .darn/ directory is always ignored.

Environment Variables

Variable Purpose
RUST_LOG Logging level (e.g., RUST_LOG=debug)

Storage Layout

.darn/
├── manifest.cbor       # Tracked file mappings
├── storage/
│   ├── blobs/          # Content-addressed blobs
│   └── trees/{id}/     # Per-document sedimentree
└── peers/              # Peer information (future)

~/.config/darn/
└── signer/
    └── private.key     # Ed25519 signing key

License

Apache-2.0 OR MIT