Encrypted backup for macOS dotfiles, secrets, and configs.
Need BOTH to restore:
- 🔑
~/.stash.key→ Password manager - 📦
.tar.gz.age→ Cloud/external drive
Store separately. Lose either = lose everything.
Homebrew:
brew install harshpatel5940/tap/stashGo:
go install github.com/harshpatel5940/stash@latest# Setup
stash init
# Backup
stash backup
# List backups
stash list
# Show metadata + note
stash info 1
# Restore by ID or name (copy .stash.key first!)
stash restore 1- Dotfiles: Shell configs (
.zshrc), git configs, etc. - Secrets: SSH keys, GPG keys, AWS credentials.
- Dev Secrets:
.envand.pemfiles from your projects. - Configs:
~/.config(with smart exclusions likenode_modules). - Packages: Homebrew, npm, VS Code extensions, Mac App Store apps.
- Browser Data: Optional bookmarks/extensions/settings backup (disabled by default).
- Git Repos: Tracks all your git repositories for easy re-cloning.
- System: macOS defaults/preferences, custom fonts, shell history.
Backup:
--skip-browsers- Force-skip browser data for this run--keep <n>- Keep only last N backups (default: 5)-m, --message- Add note/message to backup--dry-run- Preview what will be backed up--verbose- Detailed output--no-encrypt- Skip encryption (not recommended)
Restore:
--dry-run- Preview--editor- Pick/drop files and packages in editor (git-rebase style)--no-tui- Use Y/n prompts instead of interactive TUI--no-decrypt- Unencrypted backup
Info:
stash info <id|name>- Show backup metadata and notestash info <id|name> -m "..."- Update note for a backup
Config:
stash config edit- Interactive TUI editor for common settingsstash config edit --raw- Open raw YAML in VISUAL/EDITOR/vim
By default, restore opens an interactive TUI to select what to restore:
- Choose categories: multi-select across dotfiles, Homebrew, VS Code, macOS defaults, etc.
- Pick files: if dotfiles selected, choose individual files to restore
- Pick packages: if Homebrew selected, choose to install all or pick individual packages
Use --editor for a git-rebase style text editor instead:
pick [BREW] Install Homebrew packages
drop [MAS ] Install Mac App Store apps
pick [CODE] Install VS Code extensions
pick [FILE] ~/.bashrc (2.3 KB)
drop [FILE] ~/.ssh/id_rsa (skip this)
pick [DIR ] ~/.config
Change pick → drop to skip. Save & close.
Edit ~/.stash.yaml:
search_paths:
- ~/projects
- ~/work
exclude:
- "*/node_modules/*"
- "*/vendor/*"
- "*/.git/*"
additional_dotfiles:
- .custom_aliases
backup_dir: ~/stash-backups
encryption_key: ~/.stash.key
browsers:
enabled: true# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Restore packages
brew bundle --file=packages/Brewfile
cat packages/vscode-extensions.txt | xargs -L 1 code --install-extension
# Restart terminal
# Test SSH, AWS, etc.See CONTRIBUTING.md
make build
make testMIT - see LICENSE