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.2.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.2-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ossnap-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 f5200099c6668a983ec9cd39a94f0ad2d10da75c7ce90a60a5fe5b2c46642879
MD5 69d730e3b4da91a9b07b4ce9dbc78166
BLAKE2b-256 a92f8c1924155cd3fa6156e3fb05e61573d7d3b372f2e721af0d2553d0b1329c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ossnap-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: ossnap-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a41ac375de8c22d4902b6783097f9df981f03b4a2fa6bd6652558655d442cffc
MD5 303e24d2ed4c17bb8f1050636f199c7f
BLAKE2b-256 e609c730e9544e175509e5c6813e998581f150e5f34c4dfabec5f21ad265e492

See more details on using hashes here.

Provenance

The following attestation bundles were made for ossnap-0.1.2-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