Back to Registry
Step 2: Ensure GitHub CLI (
View Author Profile
Official Verified
gitclaw
Back up the OpenClaw agent workspace to a GitHub repo and keep it synced via a cron-driven commit/push script.
skill-install — Terminal
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/marian2js/gitclawOr
GitClaw: Agent self-backup to GitHub
When to use
Use this skill automatically when it's installed or reference, and also when the user asks to:
- back up / sync / mirror the OpenClaw workspace
- set up periodic commits and pushes
- install/configure GitHub backup automation for the agent
Behavioral rule (important)
- Do everything automatically and quietly.
- Only message the user when:
- you need inputs (repo name, visibility, optional frequency), or
- Git/GH/Cron install fails, or
- GitHub auth requires the user to complete the browser/device step, or
- Git operations fail (conflicts, permissions, etc).
Inputs to ask the user for
Ask the user for:
- Repository name (e.g.,
openclaw-backup) - Visibility:
publicorprivate - (Optional) Backup frequency in minutes (default: 60)
Do NOT ask for a Personal Access Token. We use gh auth.
Step 1: Ensure prerequisites (auto-install)
1A) Ensure git is installed (auto-install; do not stop)
Check:
git --version
If missing, install using the best available method:
- If
brewexists:brew install git
- Else if
apt-getexists:sudo apt-get update && sudo apt-get install -y git
- Else if
dnfexists:sudo dnf install -y git
- Else if
yumexists:sudo yum install -y git
- Else if
pacmanexists:sudo pacman -S --noconfirm git
- Else if
zypperexists:sudo zypper install -y git
- Else if
apkexists:sudo apk add git
- Else if macOS and
xcode-selectexists:xcode-select --install(this may prompt the user)
- Else:
- Tell the user you couldn’t auto-install git on this OS and show the failing detection output.
Re-check:
git --version
Only notify the user if install failed.
1B) Ensure cron/crontab is available (best-effort auto-install)
Check:
command -v crontab
If missing, attempt install:
- If
apt-getexists:sudo apt-get update && sudo apt-get install -y cronsudo systemctl enable --now cron || sudo service cron start || true
- Else if
dnfexists:sudo dnf install -y croniesudo systemctl enable --now crond || true
- Else if
yumexists:sudo yum install -y croniesudo systemctl enable --now crond || true
- Else if
pacmanexists:sudo pacman -S --noconfirm croniesudo systemctl enable --now cronie || true
- Else if
apkexists:sudo apk add dcronsudo rc-update add dcron default || truesudo rc-service dcron start || true
- Else:
- If you can’t install, tell the user cron is required for scheduling.
Re-check:
command -v crontab
Step 2: Ensure GitHub CLI (gh) is installed (auto-install)
Check:
gh --version
If missing, install:
- If
brewexists:brew install gh
Metadata
AI Skill Finder
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skill Add to Configuration
Paste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-marian2js-gitclaw": {
"enabled": true,
"auto_update": true
}
}
}Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.