feat(persist): add --list-backups and --restore options for backup management

Add backup management functionality to the persist command:
- List available backups with timestamps and dates
- Restore from most recent or specific backup
- Improved error handling for corrupted settings.json
- Updated CLAUDE.md to document the persist command and the exception to the non-invasive constraint
This commit is contained in:
Leynier Gutiérrez González authored and kaitranntt committed 2026-01-14 09:27:48 -05:00
1 parent 3b4c29ddcb
commit ef7e595b6f
5 files changed
+1006 -1

No files matched your search

+7
View File
@@ -437,6 +437,13 @@ async function main(): Promise<void> {
process.exit(exitCode);
}
// Special case: persist command (write profile env to ~/.claude/settings.json)
if (firstArg === 'persist') {
const { handlePersistCommand } = await import('./commands/persist-command');
await handlePersistCommand(args.slice(1));
return;
}
// Special case: setup command (first-time wizard)
if (firstArg === 'setup' || firstArg === '--setup') {
const { handleSetupCommand } = await import('./commands/setup-command');