← 返回 Skills 市场
OpenClaw Backup & Restore — Encrypted OpenClaw Snapshots
作者
KrishBhimani
· GitHub ↗
· v1.2.0
· MIT-0
205
总下载
1
收藏
0
当前安装
7
版本数
在 OpenClaw 中安装
/install snapshot
功能描述
Backup and restore the .openclaw agent folder — encrypted snapshots pushed to a private GitHub repo. Use this skill whenever the user mentions backup, restor...
安全使用建议
This skill appears to do exactly what it claims: create GPG-encrypted backups of ~/.openclaw and push them to a private GitHub repository. Before installing or running it, consider the following:
- Credentials: You must provide BACKUP_PASSWORD and a GITHUB_PAT. The PAT should be created with the minimum necessary scope (prefer a PAT limited to the specific repo if possible), stored securely, and rotated if compromised. The scripts use a temporary askpass helper to avoid exposing the PAT in process listings, but the PAT still grants repository access while used.
- Protect your passphrase: BACKUP_PASSWORD decrypts all backups. Keep it secret and backed up separately; if lost, backups are unrecoverable.
- Confirm what will be backed up: The code excludes .env files but will archive all other files under ~/.openclaw. Verify that no additional sensitive secrets or keys (beyond .env) live in that folder before backing up to GitHub, even in encrypted form.
- Repository ownership & privacy: Backups are pushed to a GitHub repo you control. Ensure the repo is private and the account/organization usage matches your security policy. If you prefer not to use a PAT, consider adjusting the workflow to use a deploy key or machine account (requires code changes).
- Binaries expectation: The metadata did not declare required binaries, but the scripts require git, gpg (and tar). Make sure those are available on target machines.
- Review & test: Inspect the included scripts and run setup in an attended session on a non-production workspace first to confirm behavior. After setup, verify that backups are present in the expected repo and that restore works before relying on the system.
If you want additional checks, provide the service/account you plan to use for the GitHub repo and I can suggest minimal PAT scopes or alternatives (deploy keys, GitHub Actions, etc.).
功能分析
Type: OpenClaw Skill
Name: snapshot
Version: 1.2.0
The 'snapshot' skill is a legitimate utility for backing up and restoring the OpenClaw agent folder to a private GitHub repository. It implements several security best practices, such as GPG encryption (AES256), excluding sensitive .env files from backups (backup.py), and using GIT_ASKPASS with temporary scripts to prevent leaking the GitHub Personal Access Token in process listings (config.py). The scripts perform actions strictly aligned with the stated purpose, and the instructions in SKILL.md do not contain malicious prompt injections.
能力评估
Purpose & Capability
Name/description (encrypted snapshots to a private GitHub repo) matches the code and runtime instructions. Declared environment variables (BACKUP_PASSWORD, GITHUB_PAT, GITHUB_USERNAME, REPO_NAME) are appropriate for this purpose. Minor inconsistency: registry metadata lists no required binaries, but scripts expect gpg, git, tar (and the SKILL.md instructs installing gpg); the skill should have declared these binaries.
Instruction Scope
SKILL.md and scripts limit actions to creating a tar of ~/.openclaw, GPG-encrypting it with the provided passphrase, chunking if needed, and pushing to a transport repo; restore reassembles, verifies, decrypts, and extracts. The instructions explicitly exclude .env files from backups and describe setup/use flows. No instructions read unrelated system paths or exfiltrate data to unexpected endpoints beyond the specified GitHub repo.
Install Mechanism
Instruction-only install (no external downloads). Code files are bundled with the skill and run locally via python3. No remote installers or opaque third-party downloads are used, which keeps installation risk low.
Credentials
Requested env vars are reasonable for the stated function. GITHUB_PAT with 'repo' scope is powerful (it can read/write the target repo and potentially more depending on token scopes) — this is necessary to push backups but should be scoped and protected. The skill uses a temporary GIT_ASKPASS script to avoid leaking the PAT in process lists; .env files are excluded from backups, which reduces risk of credential backup. Users should confirm no other sensitive secrets are stored inside ~/.openclaw (other than .env which is excluded).
Persistence & Privilege
always:false and the skill does not request system-wide configuration changes or modify other skills. It runs only when invoked and its setup is idempotent. Autonomous invocation (disable-model-invocation:false) is standard and not a sole concern here.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install snapshot - 安装完成后,直接呼叫该 Skill 的名称或使用
/snapshot触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.2.0
Version 1.2.0
Security hardening and runtime compatibility fixes.
- Exclude all .env files from backups (.env, .env.*, at any depth) — secrets never end up in archives
- Removed requires.bins (gpg, gpg-agent, git) from frontmatter — these are installed by setup.py at runtime, declaring them as required prevented the skill from loading on fresh workspaces where they aren't yet installed
- Flexible credential resolution: os.environ first, skill .env fallback
- Strip trailing commas from env values (OpenClaw injection edge case)
- openclaw.json only needs { "snapshot": { "enabled": true } }
v1.1.4
Exclude all .env files from backups — no secrets in archives.
- Added .env and .env.* to backup exclusion list, catching all env files at any depth
- Covers ~/.openclaw/.env, skill .env files, .env.local, .env.production, etc.
- Removed redundant skill-specific .env exclusion logic (now covered by blanket rule)
- Flexible credential resolution from v1.4.0: os.environ first, skill .env fallback
- Strip trailing commas from env values (OpenClaw injection edge case)
- openclaw.json only needs { "snapshot": { "enabled": true } }
v1.1.3
Flexible credential resolution and env parsing fix.
- Config now checks os.environ first (populated by OpenClaw from ~/.openclaw/.env), then falls back to the skill's local .env file
- Users can provide credentials via ~/.openclaw/.env (recommended), skill .env, or shell env
- Skill no longer crashes if the local .env file doesn't exist — works with OpenClaw's env injection alone
- openclaw.json only needs { "snapshot": { "enabled": true } } — no env block with secrets required
- Strip trailing commas from environment variable values (fixes OpenClaw env injection edge case)
- SKILL.md prerequisites updated to document all three credential methods
v1.1.2
Fixed metadata format for ClawHub security scanner compatibility.
- metadata.openclaw now uses correct `requires` block with `env` and `bins` fields
- Added `primaryEnv: BACKUP_PASSWORD` declaration
- Previous versions used wrong field names (binaries instead of bins) and missing requires wrapper, causing scanner to report undeclared env vars/binaries
- Clarified .env exclusion comment in backup.py explaining safety when skill is installed outside ~/.openclaw
v1.1.1
Metadata declarations for ClawHub security scanner.
- Added metadata.openclaw.env declaring BACKUP_PASSWORD, GITHUB_PAT, GITHUB_USERNAME, REPO_NAME
- Added metadata.openclaw.binaries declaring gpg, gpg-agent, git
- Scanner was flagging mismatch between undeclared env vars in frontmatter and actual script usage
- No code changes — this is a metadata-only update on top of v1.1.0 security fixes
v1.1.0
Security & reliability fixes based on community review.
Security:
- PAT no longer embedded in git remote URL or .git/config
- Auth now uses GIT_ASKPASS with temporary scripts (cleaned up after each operation)
- Token never appears in process listings or on disk
Reliability:
- GPG and gpg-agent preflight checks before backup/restore
- Transport repo existence check before backup (clear error instead of crash)
- Failed backups now clean up orphaned version folders and reset git staging
- tar/gpg stderr captured and displayed on failure instead of being swallowed
- SKILL.md workflows updated to always run setup.py first (idempotent sync)
Compatibility:
- Renamed .env.example to env-example.txt for ClawHub compatibility
v1.0.0
Initial release — encrypted backup and restore for .openclaw agent folder.
- GPG AES-256 encryption
- Automatic chunking for files over 95MB (GitHub file limit)
- SHA-256 integrity verification on restore
- Auto-cleanup of old versions (keeps last 10)
- CLI args for non-interactive AI agent usage (--latest, --version, --list)
- Backwards compatible with legacy single-file backups
元数据
常见问题
OpenClaw Backup & Restore — Encrypted OpenClaw Snapshots 是什么?
Backup and restore the .openclaw agent folder — encrypted snapshots pushed to a private GitHub repo. Use this skill whenever the user mentions backup, restor... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 205 次。
如何安装 OpenClaw Backup & Restore — Encrypted OpenClaw Snapshots?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install snapshot」即可一键安装,无需额外配置。
OpenClaw Backup & Restore — Encrypted OpenClaw Snapshots 是免费的吗?
是的,OpenClaw Backup & Restore — Encrypted OpenClaw Snapshots 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
OpenClaw Backup & Restore — Encrypted OpenClaw Snapshots 支持哪些平台?
OpenClaw Backup & Restore — Encrypted OpenClaw Snapshots 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 OpenClaw Backup & Restore — Encrypted OpenClaw Snapshots?
由 KrishBhimani(@krishbhimani)开发并维护,当前版本 v1.2.0。
推荐 Skills