Backing Up Your Data

Your command library is valuable -- back it up, sync it across Macs, and never lose your setup again.

Data Storage

Command Book stores all your data in a SQLite database. This includes:

  • Saved commands and their configurations (including env variables)
  • Ad-hoc command history
  • Sidebar organization and separators
  • Window state and preferences

Exporting Data

Create a backup of your Command Book data:

  1. Open Settings (⌘,)
  2. Go to the Storage tab
  3. Click Export Database
  4. Choose a save location
  5. The file is saved with a timestamp (e.g., commandbook-export-2026-02-03.sqlite)

What's Included

The export contains:

  • All saved commands
  • Environment variable configurations
  • Auto-restart settings
  • Sidebar order and separators
  • Ad-hoc command history

Caution: If you enter sensitive data for commands (e.g. db://admin:super-secret@server) or in environment variables (e.g. DB_PASSWORD=super-secret), these will be contained in this database file. It is not plain text, but it is also not encrypted.

Importing Data

Restore from a previous backup:

  1. Open Settings (⌘,)
  2. Go to the Storage tab
  3. Click Import Database
  4. Select your backup file
  5. Confirm the import

Commands are merged with your existing commands. Database migrations run automatically if importing from an older version of Command Book.

Tip: Export your current data first as an additional backup before importing.

Storage Location

By default, Command Book stores data in:

~/Library/Application Support/CommandBook/commandbook.sqlite

You can view the exact path in Settings → Storage.

Syncing Across Macs

Export and import your database for reliable backup and transfer between Macs. You can also place your database in a cloud-synced folder (iCloud Drive, Dropbox) for automatic sync.

Storage Statistics

The Storage tab shows:

  • Number of saved commands
  • Number of ad-hoc commands in history
  • Database file location

This file is quite small and size should not be a concern. It does not contain command output history or other unbounded data such as this. It's just the data needed remember the commands, folders, etc. For 30 commands, the file size is 65 KB.

Best Practices

  1. Regular backups: Export before major changes
  2. Version your backups: Keep multiple timestamped exports
  3. Test restores: Occasionally verify your backups work
  4. Sync carefully: If using cloud sync, ensure no conflicts