Backups
Manage local backups of your .aligntrue/ directory. For pushing rules to git remotes, use the remotes commands.
Usage
aligntrue backup <subcommand> [options]Local backup subcommands
create
Create a manual local backup.
aligntrue backup create [--notes <text>]Options:
--notes <text>- Add notes to the backup
Example:
aligntrue backup create --notes "Before major refactor"list
List all available local backups.
aligntrue backup listShows timestamp, creation source, file count, and notes for each backup.
restore
Restore from a local backup.
aligntrue backup restore [--timestamp <id>]Options:
--timestamp <id>- Restore a specific backup (default: most recent)
Examples:
# Restore most recent backup
aligntrue backup restore
# Restore specific backup
aligntrue backup restore --timestamp 2025-10-29T12-34-56-789aligntrue revert
Restore specific files from backup with preview before applying.
Usage:
aligntrue revert [options]Options:
| Flag | Alias | Description | Default |
|---|---|---|---|
--timestamp | Restore from specific backup (default: most recent) | Most recent | |
--file | Restore specific file (shows preview first) | All files | |
--force | Skip confirmation prompt | false | |
--config | -c | Custom config file path | .aligntrue/config.yaml |
What it does:
- Shows preview of files that will be restored
- Optionally filters to specific file
- Prompts for confirmation (unless
--force) - Restores selected files from backup
- Updates working directory
Examples:
# Preview and restore from most recent backup
aligntrue revert
# Preview before restoring specific file
aligntrue revert --file .cursor/rules/typescript.md
# Restore from specific backup with preview
aligntrue revert --timestamp 2025-10-29T12-34-56-789
# Restore without confirmation (use carefully)
aligntrue revert --forceExit codes:
0- Success1- No backup found, file not in backup2- System error (permissions, restore failed)
cleanup
Remove old local backups based on retention policy.
aligntrue backup cleanupUses settings from config:
backup.retention_days- Remove backups older than N days (default: 30)backup.minimum_keep- Always keep at least N backups (default: 3)
Global options
--config <path>- Path to config file--help- Show help message
Configuration
Local backup config
backup:
retention_days: 30 # 0 = disable auto-cleanup
minimum_keep: 3 # Safety floorExit codes
0- Success1- Error (backup not found, push failed, etc.)
See also
Last updated on