How kyncl/knot works
Knot is a Rust CLI/TUI for synchronizing directory trees (“knots”) across local and SSH-connected locations. The documented main workflow is to initialize configuration and run sync; the runtime includes configuration, file discovery, synchronization, and local/remote adapters. The README also identifies daemon monitoring, archive management, configuration changes, and filesystem inspection. Some command dispatch and mode internals were not excerpted, so those connections are shown only as unverified where useful.
Main entry points: cli/mod.rs Commands · manager.rs Knot manager · sync.rs Sync mode · modification/mod.rs Config editing
Components 24
CLI and TUI
- Commands
src/cli/mod.rs - Initialize config
src/cli/subcommands/init.rs - Archive commands
src/cli/subcommands/archiving.rs - Filesystem inspect
src/cli/subcommands/file_system.rs - Config editing
src/cli/modification/mod.rs - Sync TUI
src/cli/visualization/dashboard/mod.rs
Configuration
- Config loader
src/configuration/loader/configuration.rs - Sync settings
src/configuration/mod.rs - Remote config
src/configuration/loader/remote.rs - Ignore rules
src/ignorer/mod.rs
Synchronization
- Sync mode
src/modes/sync.rs - Change monitoring
src/modes/main_sync.rs - Archive workflow
src/modes/archiving.rs - Knot setup
src/modes/setup.rs - Knot manager
src/knot/manager.rs - Local crawler
src/knot/adapters/local/file_crawler.rs - File records
src/knot/file.rs - File differences
src/knot/file_diffs.rs
Storage and transport
- Knot adapters
src/knot/adapters/mod.rs - Local storage
src/knot/adapters/local/mod.rs - SSH storage
src/knot/adapters/ssh/mod.rs - SSH connection pool
src/connection/ssh/pool.rs - SSH session
src/connection/ssh/mod.rs
Other components
- Operator
Connections 25
- Operator → Initialize config: initializes
- Operator → Commands: runs
- Commands → Sync mode: starts sync
- Commands → Change monitoring: starts monitor
- Commands → Archive workflow: manages archives
- Commands → Filesystem inspect: inspects files
src/cli/mod.rs - Commands → Config editing: edits settings
src/cli/mod.rs - Commands → Sync TUI: offers interface
- Initialize config → Config loader: creates config
- Config editing → Config loader: loads config
src/cli/modification/mod.rs - Config loader → Sync settings: loads settings
- Config editing → Remote config: loads remotes
src/cli/modification/mod.rs - Sync settings → Ignore rules: builds ignore rules
src/configuration/mod.rs - Sync mode → Knot manager: coordinates knots
- Knot manager → Local crawler: crawls source
src/knot/manager.rs - Knot manager → File records: returns records
src/knot/manager.rs - Knot manager → Knot adapters: uses knot
src/knot/manager.rs - Knot adapters → Local storage: dispatches local
src/knot/adapters/mod.rs - Knot adapters → SSH storage: dispatches SSH
src/knot/adapters/mod.rs - Local storage → Local crawler: uses crawler
src/knot/adapters/local/mod.rs - SSH storage → SSH connection pool: acquires sessions
src/knot/adapters/ssh/mod.rs - SSH connection pool → SSH session: creates sessions
src/connection/ssh/pool.rs - Sync mode → File differences: compares files
- Sync mode → Sync TUI: reports progress
- Archive workflow → Knot manager: uses knot data