Skip to main content

Snapshot and restore your macOS dev environment

Project description

ossnap

Snapshot and restore your macOS dev environment in minutes.

ossnap backs up your SSH keys, .env files, and git repo list to a private GitHub repository — encrypted — and restores everything on a new machine with a single command.


What it does

  • SSH keys — encrypted and stored securely
  • .env files — discovered recursively across all your repos (including monorepos)
  • Repo list — re-clones all your git repos on restore
  • Versioned snapshots — full history, restore any point in time

Everything sensitive is encrypted with AES before leaving your machine. The password lives in your macOS Keychain.


Requirements

  • macOS
  • Python 3.11+
  • GitHub CLI (gh) — installed automatically if missing

Install

curl -fsSL https://raw.githubusercontent.com/nvt1904/ossnap/main/install.sh | bash

Or manually with pipx:

pipx install ossnap

Quick start

ossnap init        # one-time setup wizard
ossnap snapshot    # save current state
ossnap list        # view snapshot history
ossnap pull        # restore to this or a new machine

Aliases: i, s, l, p

ossnap s -n "before reinstall"   # named snapshot
ossnap p --repos-dir ~/code      # restore repos to custom dir

Commands

Command Alias Description
init i Interactive setup wizard
snapshot s Save a snapshot to GitHub
list l List all snapshots
pull p Restore from a snapshot

ossnap snapshot

-n, --name TEXT    Custom snapshot name (default: timestamp)
-h, --help

ossnap pull

--ssh-dir DIR      Restore SSH keys to a custom directory
--repos-dir DIR    Clone repos into a custom base directory
-h, --help

How it works

ossnap snapshot
└── Clones your private GitHub repo
    ├── ssh/
    │   ├── config          (encrypted)
    │   ├── authorized_keys (encrypted)
    │   └── keys/
    │       └── id_ed25519  (encrypted)
    └── repos/
        ├── repos.json      (list of all your git repos)
        └── envs/
            └── Documents/my-project/
                └── .env    (encrypted)

Each snapshot is a git commit. History is preserved — roll back to any point.

Encryption: AES-256 via Fernet, key derived from your password using PBKDF2-HMAC-SHA256 (600,000 iterations). Password stored in macOS Keychain.


Configuration

Config file: ~/.ossnap/config.json

{
  "github_repo_url": "https://github.com/you/your-private-repo",
  "ssh_dir": "~/.ssh",
  "scan_dirs": ["~/Documents", "~/Projects"],
  "env_patterns": [".env", ".env.local", ".env.development", ".env.production"],
  "exclude_dirs": ["node_modules", ".git", "venv", "__pycache__", ".venv"]
}

Edit directly or re-run ossnap init to reconfigure (existing values are pre-filled).


Uninstall

pipx uninstall ossnap
rm -rf ~/.ossnap

Your snapshot repo on GitHub is unaffected — delete it manually if you want.


License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ossnap-0.1.1.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ossnap-0.1.1-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file ossnap-0.1.1.tar.gz.

File metadata

  • Download URL: ossnap-0.1.1.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ossnap-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4acb5938f65096cb28fc48fe851409151143cbdfeffdd7f60e9576b12b6fd543
MD5 e7abe5fe99db44e6b54417cdee6acb25
BLAKE2b-256 656da8e20299c85bacb1907435b5a5518b3f011052411493c11af04ea543a688

See more details on using hashes here.

Provenance

The following attestation bundles were made for ossnap-0.1.1.tar.gz:

Publisher: publish.yml on nvt1904/ossnap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ossnap-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ossnap-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ossnap-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d9063d888aeb4aff23c83a39ad915ede5401afc142ac22426c50b3ce59314069
MD5 3a1326766dbfa9b4760615b0145b13d7
BLAKE2b-256 2b6d30bd0ede137d1b0677c6e9ac708da14d567e93aa9bdda7b2cdadb2cf1d6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ossnap-0.1.1-py3-none-any.whl:

Publisher: publish.yml on nvt1904/ossnap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page