feat: phase 2 — sauvegarde git (am sync) + transfert machine (am migrate) (closes #66 #68)

This commit is contained in:
2026-08-18 12:09:43 -04:00
parent 1b3fe09074
commit e82979e6a3
18 changed files with 966 additions and 10 deletions
+37
View File
@@ -216,6 +216,43 @@ pub static HELP_SPECS: &[HelpSpec] = &[
HelpExample { desc: "Resume a finished session.", code: "sessions --resume 20260815_143926_a1b2c3" },
],
},
HelpSpec {
name: "sync",
category: "Commands",
usage: "sync {flags}",
about: "Push the state (state.json, journal, history) into the configured git repository (issue #66).",
search_terms: &["git", "backup", "push", "sync_repo", "sauvegarde"],
flags: &[
HelpFlag { short: "", long: "--message", value: "MESSAGE", desc: "Commit message (default: 'am sync — state update')" },
],
subcommands: &[],
parameters: &[],
io: None,
examples: &[
HelpExample { desc: "Commit and push the state.", code: "sync" },
HelpExample { desc: "Custom commit message.", code: "sync --message \"daily backup\"" },
],
},
HelpSpec {
name: "migrate",
category: "Commands",
usage: "migrate {flags} [bundle]",
about: "Transfer the installation and state to another machine: export a .amx bundle, import it and verify with doctor (issue #68).",
search_terms: &["transfer", "machine", "bundle", "export", "import", "migration"],
flags: &[
HelpFlag { short: "", long: "--export", value: "", desc: "Export the bundle (default when no bundle path is given)" },
HelpFlag { short: "", long: "--output", value: "FILE", desc: "Bundle path for export (default agent-manager-migrate.amx)" },
],
subcommands: &[],
parameters: &[
HelpParam { name: "bundle", typ: "path", desc: "Bundle to import (with confirmation + doctor post-import)" },
],
io: None,
examples: &[
HelpExample { desc: "Export the bundle.", code: "migrate --export --output backup.amx" },
HelpExample { desc: "Import on machine B.", code: "migrate backup.amx" },
],
},
HelpSpec {
name: "stats",
category: "Commands",