Skip to content

adrianpk/snapfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snapfig

Tests codecov

Backup and restore your dotfiles straight from their original locations.

Snapfig TUI

What It Is

Snapfig copies your configuration files to a local vault (~/.snapfig/vault/) versioned with git. Unlike symlink-based tools, files stay in their original locations. Snapfig mirrors them on demand.

Why not symlinks? Real copies mean real redundancy. If originals break, you have actual backups.

Two Ways to Use It

Interactive (TUI)

snapfig

Navigate with arrows, Space to select, F7 to backup, F8 to sync.

Command Line

The TUI is optional. All operations work from the command line:

snapfig copy              # Copy to vault
snapfig push              # Push to remote
snapfig pull              # Pull from remote
snapfig restore           # Restore from vault

Or fire-and-forget setup for scripting:

snapfig setup \
  --paths=".config/nvim:g,.zshrc:x,.bashrc:x" \
  --remote="git@github.com:user/dotfiles.git"

Automation

Background Runner

snapfig daemon start

Configurable intervals for copy, push, pull. See daemon docs.

Or Just Cron

The daemon is optional. Prefer cron? Use it:

0 * * * * snapfig copy
0 3 * * * snapfig push

Git Handling

Config directories that are git repos (nvim, doom emacs, etc.):

  • [x] mode: Removes .git in vault (clean copy)
  • [g] mode: Renames .git to .git_disabled (preserves history)

Originals are never modified.

Install

go install github.com/adrianpk/snapfig@latest

Or build from source:

git clone https://github.com/adrianpk/snapfig
cd snapfig
go build -o snapfig .

Documentation

Planned Improvements

  • Smart copy
  • Selective restore
  • Background runner
  • Fire-and-forget setup command
  • Alternative vault location
  • Automated tests
  • Token-based authentication for git cloud services

License

MIT

About

System config versioner

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published