Note
Endur is an actively maintained fork of Tim Kellogg's original dura project. Since the fork, this project is being developed and built with AI assistance (leveraging Antigravity, Google DeepMind's coding assistant). It contains significant modernizations, performance improvements, and feature additions.
Endur is a background process that watches your Git repositories and commits your uncommitted changes without impacting HEAD, the current branch, or the Git index (staged files). If you ever get into an "oh snap!" situation where you think you just lost days of work, use Endur's built-in restore commands to safely and selectively recover your work.
Without endur, you use Ctrl-Z in your editor to get back to a good state. That's so 2021. Computers crash and Ctrl-Z
only works on files independently. Endur snapshots changes across the entire repository as-you-go, so you can revert to
"4 hours ago" instead of "hit Ctrl-Z like 40 times or whatever". Finally, some sanity.
Compared to the upstream dura repository, Endur adds the following features and improvements:
- Strict Advisory File Locking: Replaced PID tracking files with OS-level advisory file locks (
fs2crate) for single-instance daemon enforcement. - Unix Domain Sockets (UDS) IPC: Replaced the native TCP loopback setup with a robust, asynchronous Unix Domain Socket communication layer.
- Event-Driven & Debounced File Watching: Replaced CPU-heavy active directory polling with native, event-driven file monitoring (
notifycrate) combined with a 500ms debounce cache. - Git-Aware Filtering: Automatically respects
.gitignorerules and ignores the.git/folder, reducing disk write and commit activity. - Discrete Path Restore: Allows you to restore only specific files or folders from a backup snapshot (e.g.
endur restore <hash> --files path/to/file) instead of checking out the entire repository tree. - Built-in CLI Recovery & Interactive TUIs:
endur list-snapshots: Lists snapshots since the last formal commit by default; pass--allto see the full history.endur prune: Delete historical backup snapshots based on a target commit, age duration, or retention count to reclaim disk space.endur restore -i: Visual Terminal User Interface (TUI) powered byratatui(running as a synonym forendur tui) to browse repositories, drill down into snapshots, preview modified files, and selectively restore files using interactive checkboxes (Spaceto toggle,Enterto restore).endur tui: A comprehensive Control Center TUI to monitor background daemon status, manage watched repositories, inspect live logs, and view performance metrics.
- System Startup Service Subcommands: Exposes
endur service installandendur service uninstallto register the daemon as a system service automatically (launchdon macOS,systemdon Linux). - Configurable Log Redirection: The
endur servedaemon runs completely silently, logging only to a configurable file path (defaults to~/.cache/endur/endur.log). - Metrics Scraping & Performance Analysis: Exposes an
endur metricssubcommand that parses log files to compute backup frequency, snapshot latency, and repository sizes. Supports both raw JSON output and a clean formatted table (-h/--human-readable), enriched with Unicode sparkline trend graphs plotting latency and activity history. Checksstdinto prevent interactive hangs, automatically falling back to cached log paths when run on a TTY. - SQLite Metadata Cache: Snapshot metadata is transparently cached in a SQLite database (
~/.cache/endur/snapshot_cache.db). This dramatically speeds uplist-snapshots, the TUI, and the GUI on large repositories. The cache is kept warm automatically on every backup and gracefully falls back to a raw Git history walk if the database file is missing or corrupt. - Native Desktop GUI Application (v1.1.0): Structured the project as a Cargo workspace to support a native cross-platform GUI client (
crates/endur-desktop) built on Tauri 2.0 and Svelte 5. It packages native desktop installers (macOS DMG, Windows MSI/EXE, Linux DEB/AppImage) and implements a hybrid daemon resolver to integrate seamlessly with the existing CLI/TUI core.
- User Guide: Comprehensive instructions on using and recovering with Endur.
- Developer Guide: Details on the internal architecture, event-driven loop, UDS socket IPC, and testing.
- GUI User Guide: Comprehensive guide to installing, configuring, and using the native Desktop GUI application.
- GUI Developer Guide: Technical details on the Svelte 5 + Tauri desktop client architecture and IPC commands.
Running the daemon manually in the background (endur serve &) is deprecated (and will be removed in a future release) in favor of running it as an OS-level background service.
To register and start the daemon as a startup service:
$ endur service installThis automatically registers the daemon to start on login (using launchd on macOS, systemd on Linux, or Windows Task Scheduler on Windows) and starts the background execution immediately. (If a version of the service is already installed, running this will cleanly stop and remove it first, then register and start the latest version.)
If you ever need to stop and remove the startup service:
$ endur service uninstall(Note: The raw endur serve and endur kill commands are deprecated, will be removed in a future release, and are intended only for ad-hoc debugging sessions.)
Let endur know which repositories to watch:
$ endur watch some/git/repoYou can pass a relative or absolute path to the directory you want to watch. If no path is specified, it defaults to the current working directory.
To watch all git repositories under a specific folder (e.g. your development directory), you can run:
$ find ~/Development -type d -name .git -prune | xargs -I{} sh -c "endur watch {}/.."Make some changes. No need to commit or even stage them. Use any Git tool to see the endur branches:
$ git log --allendur produces a branch for every real commit you make and makes commits to that branch without impacting your working
copy. You keep using Git exactly as you did before.
To stop a daemon running in direct/debugging mode, run:
$ endur kill(Note: If the daemon is running as a system service, it will be automatically restarted by the OS. Use endur service uninstall to permanently remove/stop the service.)
Endur now provides built-in recovery subcommands:
-
List snapshots since your last commit (default — most relevant):
$ endur list-snapshots
By default this shows only snapshots taken after your most recent formal Git commit (i.e. work-in-progress you haven't committed yet). To see the full historical archive:
$ endur list-snapshots --all
-
Restore files from a snapshot:
- To restore the entire repository state:
$ endur restore <commit-hash>
- To restore only specific files or directories (discrete restore):
$ endur restore <commit-hash> --files path/to/file1.txt path/to/dir/
- To use the visual interactive mode (supports full or selective checkbox-based restore):
$ endur restore -i
These options check out the snapshot files directly to your working directory and staging index, keeping you on your current branch.
- To restore the entire repository state:
-
Prune historical snapshot branches:
- To prune snapshots prior to a specific formal commit:
$ endur prune <commit-hash>
- To keep snapshots for only the last N formal commits:
$ endur prune --keep <N>
- To prune snapshots older than a duration (e.g., 30 days):
$ endur prune --before 30d
- To select the cutoff commit interactively:
$ endur prune -i
Note: You can pass
--gcto immediately run Git Garbage Collection (git gc --prune=now) to reclaim disk space, and--dry-runto preview the deletion. - To prune snapshots prior to a specific formal commit:
Tip
Why use endur restore instead of native Git commands?
While Endur snapshots are stored as standard Git commits on hidden branches (which you could technically access via git checkout), using Endur's built-in restore process is highly recommended because:
- Keeps your branch state clean: Native
git checkoutswitches your entire repository to a detached HEAD or another branch, which disrupts your workspace.endur restoreextracts snapshot files directly into your active working directory without changing your current branch or branch history. - Granular control: You can restore specific files or folders (via
--files) instead of the entire tree. - Interactive TUI: Using
endur restore -iallows you to visually inspect changes and selectively restore only the files you want using checkboxes.
For more details on commands and recovery, see the User Guide.
You can install endur directly via Cargo:
cargo install endur- Install Rust (e.g.,
brew install rustup && brew install rust) - Clone this repository:
git clone https://github.com/PJC-64/endur.git
- Navigate to repository base directory (
cd endur) - Run:
cargo install --path .
Endur can be configured as a background service that launches automatically at login (macOS) or boot (Linux) using the built-in subcommand:
$ endur service installTo stop and remove the service, run:
$ endur service uninstall- Download rustup-init
- Clone this repository:
git clone https://github.com/PJC-64/endur.git
- Navigate to repository base directory (
cd endur) - Run
cargo install --path .Note: If you receive a failure fetching the cargo dependencies try using the local git client for cargo fetches.CARGO_NET_GIT_FETCH_WITH_CLI=true cargo install --path .
$ paru -S endur-gitNix is a tool that takes a unique approach to package management and system configuration. NixOS is a Linux distribution built on top of the Nix package manager.
To run endur locally using pre-compiled binaries:
nix shell nixpkgs#endurIf you're willing to contribute and develop, endur also provides its
own ready-to-use Nix flake.
To build and run the latest development version of endur locally:
nix run github:PJC-64/endurTo run a development environment with the required tools to develop:
nix develop github:PJC-64/endurYes. Lots of people have been using the original dura since 2022 without issue, and this fork has changed no core elements of the backing logic. It uses libgit2 to make the commits, so it's fairly battle hardened.
Endur uses event-driven file monitoring (notify crate) to listen for filesystem events. It captures changes immediately after they occur, with a 500ms debounce delay to combine rapid consecutive writes into a single snapshot.
This fork brought to you by PJC-64, original 'dura' by Tim Kellogg.