Skip to content

Ark β€” Encrypted backup & restore plugin for OpenClaw 🚒

License

Notifications You must be signed in to change notification settings

Quackstro/openclaw-ark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

@quackstro/ark 🚒

Ark β€” Encrypted backup & restore plugin for OpenClaw. Preserve your entire setup and migrate to a new system in one command.

Features

  • AES-256-GCM encryption with PBKDF2 key derivation (600K iterations)
  • Selective backup/restore β€” choose which categories to include
  • 10 backup categories: config, credentials, wallet, brain, doc-rag, cron, extensions, workspace, devices, identity
  • Retention policy β€” auto-prune old backups by count or age
  • Agent tools β€” backup_create, backup_restore, backup_list, backup_status
  • CLI commands β€” openclaw backup create|restore|list|prune
  • Slash commands β€” /ark, /ark backup, /ark list, /ark restore, /ark prune, /ark help
  • Zero external dependencies β€” uses Node.js built-in crypto, zlib, and a minimal tar implementation

Install

From source (recommended)

cd ~/.openclaw/extensions
git clone https://github.com/Quackstro/openclaw-ark ark
cd ark && npm install && npm run build

Via npm (coming soon)

openclaw plugins install @quackstro/ark

Documentation

  • Command Reference β€” All slash commands, agent tools, and CLI usage
  • Architecture β€” Archive format, encryption, categories, tar implementation
  • Migration Guide β€” Step-by-step guide for moving to a new system

Usage

Telegram

Command Description
/ark Status overview
/ark backup <passphrase> Create encrypted backup
/ark list List all backups
/ark restore Restore instructions
/ark prune Remove old backups
/ark help Command reference

CLI

# Create a backup (all categories)
openclaw backup create -p "my-secure-passphrase"

# Create with specific categories only
openclaw backup create -p "my-passphrase" -c config,wallet,brain

# List backups
openclaw backup list

# Restore (all categories)
openclaw backup restore ./backups/openclaw-backup-2026-02-11.ocbak -p "my-passphrase"

# Restore specific categories only
openclaw backup restore ./backup.ocbak -p "my-passphrase" -c config,workspace

# Dry-run restore (preview without writing)
openclaw backup restore ./backup.ocbak -p "my-passphrase" --dry-run

# Prune old backups per retention policy
openclaw backup prune

Agent (conversational)

"Create a backup with passphrase 'hunter2'" "Show backup status" "Restore from the latest backup" "List my backups"

Configuration

{
  plugins: {
    entries: {
      ark: {
        enabled: true,
        config: {
          backupDir: "~/.openclaw/backups",
          categories: {
            config: true,
            credentials: true,
            wallet: true,
            brain: true,
            docrag: true,
            cron: true,
            extensions: true,
            workspace: true,
            devices: true,
            identity: true
          },
          retention: {
            maxBackups: 5,
            maxAgeDays: 30
          },
          notifications: {
            enabled: true,
            channel: "telegram",
            target: "your-chat-id"
          }
        }
      }
    }
  }
}

Backup Categories

Category Contains Sensitive
config openclaw.json (API keys, channel tokens) πŸ” Yes
credentials OAuth tokens, provider credentials πŸ” Yes
wallet DOGE keystore, UTXOs, audit log πŸ” Yes
brain Brain stores (LanceDB), pending actions No
docrag Ingested documents + embeddings No
cron Cron job definitions + run history No
extensions Installed plugins (source code) No
workspace Agent workspace (AGENTS.md, memory/, scripts/) Mixed
devices Paired device configs No
identity Agent identity data No

Archive Format (.ocbak)

OCBAK1 (6 bytes magic)
Salt   (32 bytes β€” random)
IV     (16 bytes β€” random)
AuthTag(16 bytes β€” GCM auth tag)
Body   (AES-256-GCM encrypted tar.gz)

Key derivation: PBKDF2-SHA512, 600,000 iterations.

Migration Workflow

  1. On old system: openclaw backup create -p "migrate-2026"
  2. Copy the .ocbak file to the new system
  3. On new system: Install OpenClaw, then openclaw backup restore ./file.ocbak -p "migrate-2026"
  4. Restart: sudo supervisorctl restart openclaw

Testing

# Run all tests
npm test

# Or directly
node --test tests/config.test.ts tests/engine.test.ts

23 tests covering:

  • Config parsing (defaults, overrides, categories, tilde expansion)
  • Backup creation, listing, restore (correct/wrong passphrase, dry-run, selective)
  • Pruning (max count enforcement)
  • Archive format (magic bytes, salt, ciphertext uniqueness)

License

MIT β€” Quackstro LLC

About

Ark β€” Encrypted backup & restore plugin for OpenClaw 🚒

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published