Architecture

One small daemon. Many right defaults.

gity is a Rust workspace with eight focused crates, an async-nng IPC layer, a sled-backed cache, and a scheduler that respects your CPU and battery. Here's the shape of the system.

System diagram

Git CLI core.fsmonitor = gity IDE / Editor subscribes via pub/sub gity CLI register / health / events gity daemon async-nng IPC ~120μs round-trip fsmonitor v2 helper binary protocol, ~85μs scheduler CPU + battery aware watcher (notify) FSEvents / inotify / RDC sled cache snapshots + metrics Working tree + .git/ on disk

Eight focused crates

The workspace is split into gity, gity-cli, gity-daemon, gity-watch, gity-git, gity-ipc, gity-storage, and optional gity-tray. Each crate has a single responsibility; inter-crate boundaries are typed.

Async-nng IPC

Lightweight binary messaging over Unix domain sockets (Linux/macOS) and named pipes (Windows). Round-trip latency ~120μs for the CLI channel; ~85μs for the fsmonitor v2 helper, which speaks Git's binary wire protocol directly.

Sled storage

Embedded, pure-Rust transactional key-value store. Holds registration state, fsmonitor cache snapshots, and rolling metrics. Multi-worktree shared caches use rykv for hot-key replication.

OS-native watchers

The notify crate wraps FSEvents (macOS), inotify (Linux), and ReadDirectoryChangesW (Windows). Backpressure, queue-overflow handling, and snapshot management live in gity-watch.

CPU- and battery-aware scheduler

Background prefetch and maintenance pause when system load exceeds a threshold or when on battery. Tasks back off exponentially on failure. Coordinated across all registered repos to avoid thundering herds.

Pub/sub subscribe API

IDEs can subscribe to a stream of structured events (file-changed, prefetch-complete) instead of polling. One nng channel for any number of subscribers; binary serialization, no JSON overhead.

Want the internals?

Read the source.

The codebase is intentionally small (~18,000 LOC) and approachable. Good-first-issue tasks are tagged.