Data Backup
Overview
Section titled “Overview”Your content files (src/content/**/*.md) and buddy.config.ts are gitignored to keep personal data out of the public repo. Built-in backup scripts sync content to a separate private data repo.
-
Create a private repo on GitHub
Create a new private repository (e.g.,
my-buddy-data). -
Initialize the data repo locally
Terminal window git init ../my-buddy-datacd ../my-buddy-datagit remote add origin git@github.com:YOUR_USERNAME/my-buddy-data.git -
Back up your content
Terminal window bun data:backup -
Push to your private repo
Terminal window cd ../my-buddy-data && git add -A && git commit -m "backup" && git push
Auto-Backup
Section titled “Auto-Backup”When backup.onEnd is true in buddy.config.ts (the default), ending a session with /mybuddy.end automatically runs a backup.
backup: { onEnd: true, // Auto-backup on /mybuddy.end},Manual Backup
Section titled “Manual Backup”Use the Claude Code command or the shell script:
# Via Claude Code/mybuddy.backup
# Via shellbun data:backupRestore
Section titled “Restore”To restore content on a new machine after cloning both repos:
bun data:restoreCustom Path
Section titled “Custom Path”The scripts look for ../my-buddy-data by default. Override with a custom path:
bun data:backup /path/to/your/data-repobun data:restore /path/to/your/data-repoOr set the environment variable:
export BUDDY_DATA_REPO=/path/to/repo