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.3.tar.gz (16.0 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.3-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ossnap-0.1.3.tar.gz
  • Upload date:
  • Size: 16.0 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.3.tar.gz
Algorithm Hash digest
SHA256 621cc8467fe67502ce67a77cb3b2959dfa16fc5b227a438694222bff7fa583cc
MD5 119d4d014e5b8f4486c8d0dd749a371f
BLAKE2b-256 ad3e73cc2e27aeb23c6cd30999977ec4b6263f339f402f297d7fcb1e0a1a8382

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ossnap-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 17.7 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 66aafe5d77a803d7f0dfe3438e19837a83c9873e58e8c0faa47a3ed1dc1c19bf
MD5 959e41b713cc590e54951f9d338ddf38
BLAKE2b-256 c43afa255dce62cbabcb0141b014210362c3fc02550ffe0541875e0ea41487c7

See more details on using hashes here.

Provenance

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