@txtatelier/cli
v0.0.0
Published
CLI for txtatelier local-first file sync
Maintainers
Readme
@txtatelier/cli
Local-first file synchronization CLI powered by Evolu.
Prerequisites
Bun runtime is required. Txtatelier uses Bun for file I/O and SQLite operations.
Install Bun:
curl -fsSL https://bun.sh/install | bashInstallation
Install globally via npm:
npm install -g @txtatelier/cliVerify installation:
txtatelier --helpUsage
Start File Sync
Start watching and syncing files:
txtatelierBy default, this syncs ~/Documents/Txtatelier.
Custom Watch Directory
Specify a different directory:
txtatelier --watch-dir /path/to/your/filesOwner Management
Show your mnemonic (12 words - save this securely!):
txtatelier owner --showRestore from mnemonic:
txtatelier owner --restore "word1 word2 word3 ... word12"Reset owner (destructive - creates new identity):
txtatelier owner --reset --yesShow configuration paths:
txtatelier owner --whereConfiguration
Configuration is loaded in this priority order:
- CLI flags (highest priority)
- Environment variables
- Defaults (lowest priority)
Environment Variables
All configuration can be set via environment variables:
TXTATELIER_WATCH_DIR- Directory to watch and sync- Default:
~/Documents/Txtatelier
- Default:
TXTATELIER_DB_PATH- SQLite database file path- Default:
~/.local/share/txtatelier/txtatelier.db
- Default:
TXTATELIER_RELAY_URL- Evolu relay WebSocket URL- Default:
wss://free.evoluhq.com
- Default:
TXTATELIER_LOGGING- Enable debug logging (0or1)- Default:
0
- Default:
TXTATELIER_MNEMONIC- Owner mnemonic for restoration (12 words)- Only use on first run to restore existing identity
Example
export TXTATELIER_WATCH_DIR="$HOME/Sync/Files"
export TXTATELIER_LOGGING=1
txtatelierRunning as a Systemd Service
For automatic startup and background operation, install as a systemd user service.
Installation
Run the included installation script:
# From the package directory
./scripts/install-service.shOr manually:
# Copy service file
cp systemd/txtatelier.service ~/.config/systemd/user/
# Copy example config
cp systemd/txtatelier.env.example ~/.config/txtatelier/txtatelier.env
# Reload systemd
systemctl --user daemon-reloadService Management
Enable service (start on login):
systemctl --user enable txtatelierStart service:
systemctl --user start txtatelierCheck status:
systemctl --user status txtatelierView logs:
journalctl --user -u txtatelier -fStop service:
systemctl --user stop txtatelierDisable service:
systemctl --user disable txtatelierConfiguration File
Edit ~/.config/txtatelier/txtatelier.env to configure the service:
nano ~/.config/txtatelier/txtatelier.envAfter changing config, restart the service:
systemctl --user restart txtatelierHow It Works
Txtatelier maintains bidirectional sync between your filesystem and Evolu's distributed database:
- Filesystem → Evolu: Watches for file changes and captures them into Evolu
- Evolu → Filesystem: Listens for remote changes and materializes them to disk
Conflict Handling
When conflicts occur (file changed on disk while remote version also changed), txtatelier creates conflict files:
original-file.txt
original-file.conflict-abc123-20260314.txtYou resolve conflicts manually by choosing which version to keep.
First Run
On first run, txtatelier generates a new owner identity and displays a 12-word mnemonic:
[file-sync] Your mnemonic (save this securely!):
[file-sync] word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12⚠️ SAVE THIS MNEMONIC! You need it to access your data on other devices.
Multi-Device Sync
To sync files across multiple devices:
- Install txtatelier on each device
- Use
txtatelier owner --restore "your mnemonic"on additional devices - All devices will automatically sync via the relay
Troubleshooting
"Another txtatelier instance is already running"
Only one instance of txtatelier can run at a time. Check for running instances:
# If running as a service
systemctl --user status txtatelier
# Check for process
ps aux | grep txtatelierStop the existing instance before starting a new one.
"bun is required but not installed"
Install Bun runtime:
curl -fsSL https://bun.sh/install | bashThen restart your shell or source your profile:
source ~/.bashrc # or ~/.zshrcService Won't Start
Check logs for errors:
journalctl --user -u txtatelier -n 50Common issues:
- Bun not installed or not in PATH
- Configuration file has invalid values
- Watch directory doesn't exist or isn't writable
Sync Not Working
- Check service is running:
systemctl --user status txtatelier - Enable debug logging: Set
TXTATELIER_LOGGING=1in config - View logs:
journalctl --user -u txtatelier -f - Check network connectivity to relay
License
MIT
