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, including SSH host history, is encrypted 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)
    │   ├── known_hosts     (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: authenticated encryption via Fernet, with a key derived from your password using PBKDF2-HMAC-SHA256 (600,000 iterations). Each encrypted file has a random salt and a versioned format header, so future encryption upgrades can remain compatible with existing snapshots. Password stored in macOS Keychain.

Changing the encryption password is intentionally disabled until a full snapshot re-encryption workflow is available; changing it locally would make prior snapshots unreadable.


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.6.tar.gz (18.7 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.6-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ossnap-0.1.6.tar.gz
  • Upload date:
  • Size: 18.7 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.6.tar.gz
Algorithm Hash digest
SHA256 869389c94110b36e3d7cc8e47c0ad1c16edcc0010067685328032c74fd58d6ac
MD5 71bcaf85e62d852b9a28e270b6c00fd2
BLAKE2b-256 c3ca90d4565dd8d37a0c091ea9e0784bd2e77c383daba472285801485c90dcaa

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ossnap-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 19.4 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7090294a1dd239ce6b5bff1a61b601c35f763cd459ffb78bea3db141c6bd90dd
MD5 9fac1e1a32520024cf386e3bdabada8b
BLAKE2b-256 0a8f901d25bb94c97fd675eaa05118157e49434e247160e4580afa5cca848b7f

See more details on using hashes here.

Provenance

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