feat: add local backup CLI#40163
Conversation
Greptile SummaryThis PR adds a first-class Key concern: The The self-inclusion guard, overwrite prevention, dry-run mode, and JSON output suppression in the banner are all implemented correctly. Confidence Score: 3/5
Last reviewed commit: 20c606d |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 92f02cb482
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@joshavant @gumadeiras this touches core CLI command wiring, local state/storage handling, and DX/docs around destructive flows. Could one of you take a review when you have a slot? What is in scope now:
What is intentionally out of scope:
Targeted coverage is in the PR body. If the shape looks right, this should be ready to merge after review. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e661396e9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0f32d5a73d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 71955ffe5b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
71955ff to
c301597
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a4be741e5f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
93ff652 to
ed46625
Compare
|
Merged via squash.
Thanks @shichangs! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed46625ae2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Merged via squash. Prepared head SHA: ed46625 Co-authored-by: shichangs <46870204+shichangs@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
Merged via squash. Prepared head SHA: ed46625 Co-authored-by: shichangs <46870204+shichangs@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
Summary
resetanduninstallcan remove local state, credentials, sessions, and workspaces, so recoverability depended on manual operator steps.openclaw backup create,openclaw backup verify, optionalopenclaw backup create --verify, docs, archive manifest validation, atomic archive writes, and backup guidance in destructive flows.backup restoreyet.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
openclaw backup createcommand to archive local state/config/credentials/workspace into a timestamped.tar.gz.openclaw backup verify <archive>command to validate backup structure and embeddedmanifest.json.openclaw backup create --verifyoption to self-check an archive immediately after writing it.resetanduninstallnow recommend runningopenclaw backup createbefore state-destructive flows.Security Impact (required)
Yes/No) YesYes/No) NoYes/No) NoYes/No) YesYes/No) YesYes, explain risk + mitigation:This adds a local CLI capability that reads user state/config/workspace paths and writes a backup tarball. Mitigations:
backup verifyvalidates manifest/payload consistencyRepro + Verification
Environment
Steps
openclaw backup create --output <dir>..tar.gzand embeddedmanifest.json.openclaw backup verify <archive>.openclaw reset --dry-runoropenclaw uninstall --dry-runand confirm backup guidance is shown for state-destructive scopes.Expected
Actual
Evidence
Human Verification (required)
What you personally verified (not just CI), and how:
resetanduninstallfor state-destructive flows--verifytsc, due to unrelated existing failures outside this PRReview Conversations
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoFailure Recovery (if this breaks)
backupcommandsRisks and Mitigations
Testing
pnpm exec vitest run src/commands/backup.atomic.test.ts src/commands/backup.test.ts src/commands/backup-verify.test.ts src/commands/reset.test.ts src/commands/uninstall.test.ts src/cli/program/register.backup.test.ts src/cli/program/command-registry.test.ts src/cli/program/preaction.test.ts src/cli/program/register.maintenance.test.tspnpm exec tsc -p tsconfig.json --noEmitwas attempted earlier, but the repo currently fails on unrelated pre-existing errors inextensions/tlonand existing agent/provider tests