Mac desk backup & restore

The product core: pack this Mac, recover on a new one, doctor green — developer ready.

Bar: great, not merely OK

One happy path. Clear progress. Dry-run before writes. Every red doctor line has a next command. Apple Silicon only for the local desk.

What is a desk pack?

An encrypted archive (.desk.enc) of developer service state that does not live in git:

  • Global Caddy config and LaunchAgent inventory
  • Homebrew PostgreSQL roles / dumps (policy: Postgres only, no Docker DB for apps)
  • iTerm profiles, arrangements, scripts
  • SSH keys (always encrypted in the pack)
  • Tooling inventory (brew list, versions)
  • Rebuild playbook + ~/dev repo origins
  • Docker soft notes (compose paths — not volumes/images)

Consumer Mac state (Photos, Mail, Desktop iCloud) stays with Apple iCloud / Migration Assistant. Optional full-file backup tools (e.g. Arq) remain for bytes; decli rebuilds the desk.

Backup (source Mac)

# Full wipe-style pack (all desk components)
decli desk pack --to icloud

# User-owned cloud (see Destinations)
decli desk pack --to aws
decli desk pack --to gcs
decli desk pack --to gdrive
decli desk pack --to s3:desk-offsite

# Passphrase: DECLI_DESK_PASSPHRASE or prompt — store in 1Password

Day-to-day Mac→Mac (same Apple ID or Tailscale): decli desk sync push --via icloud / --via tailscale. See Destinations.

Restore (new MacBook Pro)

  1. Apple Setup / iCloud for the rest of the machine
  2. 1Password sign-in; install Xcode + Homebrew when prompted by bootstrap
  3. Install decli: curl -fsSL https://decli.dev/install | sh (or local docs.decli.lvh.me install path)
  4. Pull the archive (iCloud Drive / destination pull / AirDrop)
  5. decli desk recover --from-archive PATH --dry-run
  6. decli desk recover --from-archive PATH --execute --restart-iterm
  7. decli desk doctor until green
  8. Workspace sign-in for AI keys: open https://decli.lvh.me or https://decli.dev

Recover phases

Bootstrap runs in order: system → xcode → homebrew → runtimes → locations → auth → desk restore → services → repos → deps → docker (soft) → ai → verify.

Commands cheat sheet

CommandPurpose
desk packBackup + encrypt + export
desk recoverBootstrap + restore one-shot
desk doctorHealth: Caddy, Postgres, tooling, iTerm, Docker soft
desk sync push/pullMac→Mac via iCloud or Tailscale
desk destinations …AWS / GCS / Drive / S3-compatible / local
desk list / verifyLocal snapshots

Menu bar

The native macOS app (Apple Silicon) can trigger desk backup and iCloud sync, and opens the web console. Bridge default: http://127.0.0.1:43105.

Natural language

decli "backup this mac"
decli "sync to my other mac"
decli "pull desk from icloud"
decli "desk doctor"