JakeTurner616/restitch

Linux file back-up and copy utility

โ˜… 0Forks 0RustGitHub โ†—Compare

README

๐Ÿงต RESTITCH

Reliable config backup, restore, and revert โ€” from the terminal, in Rust.


Overview

Restitch is a simple command-line utility for organizing configs and dotfiles โ€” backup, restore, and revert system configurations.

No more manually backing up and moving files between installs. Restitch helps you track, package, and restore your setup across machines.


Usage

restitch                   # Launch the TUI to select configs and create a backup
restitch --restore --dry-run   # Preview the restore without applying changes
restitch --restore         # Restore from the most recent archive + manifest
restitch --revert          # Revert to the last backup (interactive prompt)
restitch --help            # CLI reference

CLI Flags

Flag Description
--archive <path> Use a specific archive .tar.gz file
--manifest <path> Use a specific manifest .toml file
--config-path <path> Load custom config targets .toml file

Configuration Format

Create a config_targets.toml in the working directory (or specify one via --config-path):

[[config]]
name = "Zsh Config"
path = "~/.zshrc"

[[config]]
name = "Kitty Terminal"
path = "~/.config/kitty"

Tilde (~) is supported. Only existing files or directories will be included.


Dry Run Preview

restitch --restore --dry-run

Outputs a detailed restore plan without modifying your system:

๐Ÿงญ Restore Plan (dry-run):
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
๐Ÿ” REPLACE: Zsh Config โ†’ ~/.zshrc
๐Ÿ” REPLACE: Kitty Terminal โ†’ ~/.config/kitty

๐Ÿ”Ž Restore dry-run complete.
๐Ÿ‘‰ To apply these changes, run with `--restore`

๐Ÿ” Revert System Configs

To roll back to the most recent state before a restore:

restitch --revert

Prompts you before overwriting current files with a backup from ./backups/.


Output Structure

Path Description
outputs/restitch-archive.tar.gz Generated config archive
outputs/restitch-archive.manifest.toml Manifest listing included files
backups/YYYY-MM-DD_HH-MM-SS/ Auto-backups before restore

Install

Option 1: Use Prebuilt Linux Binaries

Visit the Releases Page and download the archive for your platform:

tar -xzf restitch-v0.1.2-x86_64-unknown-linux-gnu.tar.gz
sudo cp restitch-v0.1.2-x86_64-unknown-linux-gnu/restitch /usr/local/bin/

Also available for: aarch64-unknown-linux-gnu.

Option 2: Build from Source

git clone https://github.com/JakeTurner616/restitch.git
cd restitch
cargo build --release
sudo cp target/release/restitch /usr/local/bin/

Requires Rust to build from source.


License

MIT License โ€” free to use, modify, and distribute.

Built for terminal users who care about backing up their configs.

Contributors

JakeTurner616

Issues