clawkeep 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ClawKeep
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,295 @@
1
+ <p align="center">
2
+ <img src="assets/banner.jpg" alt="ClawKeep" width="100%" />
3
+ </p>
4
+
5
+ <h1 align="center">🐾 ClawKeep</h1>
6
+
7
+ <p align="center">
8
+ <strong>Time-travel backups for AI agents and everything else.</strong><br>
9
+ <sub>Every change tracked. Every version recoverable. Set it and forget it.</sub>
10
+ </p>
11
+
12
+ <p align="center">
13
+ <a href="https://www.npmjs.com/package/clawkeep"><img src="https://img.shields.io/npm/v/clawkeep.svg?style=flat-square&color=38bdf8" alt="npm"></a>
14
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-38bdf8.svg?style=flat-square" alt="license"></a>
15
+ <a href="#quick-start"><img src="https://img.shields.io/badge/setup-30_seconds-38bdf8.svg?style=flat-square" alt="setup"></a>
16
+ </p>
17
+
18
+ ---
19
+
20
+ ## The Problem
21
+
22
+ You're running an AI agent. It rewrites its own memory files, edits configs, updates state. One bad run and your agent's personality is gone. Its memory, corrupted. Its config, overwritten.
23
+
24
+ You reach for a backup. All you have is a zip from three days ago.
25
+
26
+ **That's not enough.**
27
+
28
+ ## The Solution
29
+
30
+ ClawKeep gives your files **full version history with encrypted backups**. Every change is tracked. Every state is recoverable. Back up to a local path, S3, or (soon) ClawKeep Cloud — all encrypted, all incremental. Built on git internally, but you never touch git.
31
+
32
+ ```
33
+ clawkeep init → start tracking
34
+ clawkeep watch → auto-backup on every change
35
+ clawkeep restore → go back to any point in time
36
+ ```
37
+
38
+ That's it. Three commands. Your files are protected forever.
39
+
40
+ ## Quick Start
41
+
42
+ ```bash
43
+ npm install -g clawkeep
44
+ ```
45
+
46
+ ```bash
47
+ cd ~/my-project
48
+ clawkeep init
49
+ ```
50
+ ```
51
+ ✔ ClawKeep initialized!
52
+ 🐾 Directory is now version-controlled
53
+ Tracked 42 files
54
+ Backup a8f3c2d1
55
+ ```
56
+
57
+ ```bash
58
+ # Set it and forget it — runs in background
59
+ clawkeep watch --daemon
60
+ ```
61
+
62
+ Done. Every file change is now automatically versioned.
63
+
64
+ ## Commands
65
+
66
+ | Command | What it does |
67
+ |---|---|
68
+ | `clawkeep init` | Start tracking a directory |
69
+ | `clawkeep watch` | Auto-backup on file changes. `--daemon` for background mode |
70
+ | `clawkeep snap` | Manual backup with optional `-m "message"` |
71
+ | `clawkeep log` | Browse your backup timeline |
72
+ | `clawkeep restore <ref>` | Time-travel to any backup |
73
+ | `clawkeep diff` | See what changed since last backup |
74
+ | `clawkeep backup` | Manage encrypted backup targets (local, S3, cloud) |
75
+ | `clawkeep backup sync` | Sync encrypted backup to target |
76
+ | `clawkeep backup restore` | Restore from encrypted backup |
77
+ | `clawkeep export` | AES-256 encrypted portable archive |
78
+ | `clawkeep import` | Restore from encrypted archive |
79
+ | `clawkeep status` | Show tracking stats |
80
+ | `clawkeep ui` | Launch the web dashboard |
81
+
82
+ ## Backup Targets
83
+
84
+ Choose where your data goes. Configure once, sync automatically.
85
+
86
+ ```bash
87
+ # Set encryption password (once)
88
+ clawkeep backup set-password
89
+
90
+ # Back up to a local path (NAS, external drive, etc.)
91
+ clawkeep backup local /mnt/nas/backups
92
+
93
+ # Sync (incremental — only new changes)
94
+ clawkeep backup sync
95
+
96
+ # Check backup status
97
+ clawkeep backup status
98
+
99
+ # Restore from backup
100
+ clawkeep backup restore /mnt/nas/backups/my-workspace/
101
+ ```
102
+
103
+ All backups are **AES-256-GCM encrypted** and **incremental** — only new changes are synced after the first backup.
104
+
105
+ | Target | Status | Description |
106
+ |---|---|---|
107
+ | **Local path** | ✅ Available | Encrypted chunks on any folder, NAS, or mounted drive |
108
+ | **S3 / R2** | 🔜 Coming soon | Encrypted chunks on object storage |
109
+ | **ClawKeep Cloud** | 🔜 Coming soon | Managed encrypted backup at clawkeep.com |
110
+
111
+ ## Web Dashboard
112
+
113
+ A clean, dark-themed dashboard to manage your backups visually.
114
+
115
+ ```bash
116
+ clawkeep ui --daemon --port 3333
117
+ ```
118
+
119
+ **Four tabs, everything you need:**
120
+
121
+ - **◉ Dashboard** — Protection status, recent changes, pending unsaved files, quick stats
122
+ - **↻ History** — Full backup timeline with expandable diffs, compare any two backups side-by-side
123
+ - **☁ Backup** — Configure backup targets, sync, test connections, download encrypted exports
124
+ - **≡ Browse** — File browser with time-travel — view any file at any point in history
125
+
126
+ **Also includes:**
127
+ - 🎨 Syntax highlighting for JS, Python, Go, Rust, JSON, YAML, CSS, HTML
128
+ - ✏️ Named backups from the UI
129
+ - ⏪ One-click restore to any backup
130
+ - 🔐 Token-based auth, runs as a background daemon
131
+
132
+ ## Framework Integrations
133
+
134
+ ClawKeep works with any directory, but it's especially useful for AI agent frameworks that maintain persistent state:
135
+
136
+ | Framework | What to track | How to integrate |
137
+ |---|---|---|
138
+ | **[Clawdbot](https://github.com/clawdbot/clawdbot)** | `MEMORY.md`, `SOUL.md`, `IDENTITY.md`, config, daily notes | Heartbeat task or watch daemon. See [SKILL.md](SKILL.md) |
139
+ | **[OpenClaw](https://github.com/openclaw)** | `.openclaw/` memory, agent state, tool configs | `clawkeep init && clawkeep watch --daemon` in agent dir |
140
+ | **[Nanobot](https://github.com/nicholasgriffintn/nanobot)** | `nanobot.yml`, conversation history, plugins | Watch daemon on nanobot workspace |
141
+ | **[Claude Code](https://claude.ai/code)** | `CLAUDE.md`, project context, session artifacts | `clawkeep watch --daemon` in project root |
142
+ | **[Codex CLI](https://github.com/openai/codex)** | `codex.md`, workspace files | Watch daemon on workspace |
143
+ | **[CrewAI](https://github.com/joaomdmoura/crewAI)** | Agent memory, task outputs, crew configs | Watch daemon on crew workspace |
144
+ | **[AutoGPT](https://github.com/Significant-Gravitas/AutoGPT)** | Agent state, auto_gpt_workspace, memory | Watch daemon on workspace root |
145
+ | **Generic** | Any directory with files that change | `clawkeep init && clawkeep watch --daemon` |
146
+
147
+ ### Agent Skill
148
+
149
+ ClawKeep ships with a [SKILL.md](SKILL.md) that any AI agent can read and follow. Drop it into your agent's skills directory and it will know how to:
150
+
151
+ - Initialize ClawKeep on its own workspace
152
+ - Run watch mode or periodic backups via heartbeat
153
+ - Restore to previous versions when something goes wrong
154
+ - Take named backups before risky operations
155
+ - Configure backup targets for offsite protection
156
+
157
+ See [SKILL.md](SKILL.md) for the full agent-readable integration guide.
158
+
159
+ ## Smart Ignore
160
+
161
+ ClawKeep ships with sensible defaults. Your `node_modules`, build artifacts, and caches are never tracked:
162
+
163
+ ```bash
164
+ # .clawkeepignore (auto-generated)
165
+ node_modules/
166
+ __pycache__/
167
+ dist/
168
+ .env
169
+ *.log
170
+ ```
171
+
172
+ Add your own patterns. They're automatically synced to `.gitignore` — you never think about it.
173
+
174
+ ## Watch Mode
175
+
176
+ The killer feature. Background daemon that auto-backs-up on file changes:
177
+
178
+ ```bash
179
+ # Foreground (see live output)
180
+ clawkeep watch
181
+
182
+ # Background daemon (survives terminal close)
183
+ clawkeep watch --daemon
184
+
185
+ # Stop the daemon
186
+ clawkeep watch --stop
187
+
188
+ # Auto-push to remote after each backup
189
+ clawkeep watch --daemon --push
190
+ ```
191
+
192
+ Debounced writes, stability detection, smart ignore patterns. Your files are continuously versioned without any manual intervention.
193
+
194
+ ## Restore
195
+
196
+ Go back to any point in time. Your current state is preserved in history — nothing is ever lost.
197
+
198
+ ```bash
199
+ # See the timeline
200
+ clawkeep log
201
+
202
+ # Restore to a specific backup
203
+ clawkeep restore abc123f
204
+
205
+ # Restore to 3 backups ago
206
+ clawkeep restore HEAD~3
207
+ ```
208
+
209
+ Restores are **non-destructive** — ClawKeep checks out the old state and creates a new backup. Your full history is always intact.
210
+
211
+ ## Compare
212
+
213
+ See exactly what changed between any two points in time:
214
+
215
+ - **Dashboard:** Click "Compare" in History tab, select two backups
216
+ - **CLI:** `clawkeep diff` shows changes since last backup
217
+ - **API:** `GET /api/compare?from=abc123&to=def456`
218
+
219
+ ## Encrypted by Default
220
+
221
+ All backups are AES-256-GCM encrypted with scrypt key derivation. Your data is opaque on the target — no file names, no git history, nothing readable. Just numbered `.enc` chunks.
222
+
223
+ ```bash
224
+ # One-off encrypted export (portable archive)
225
+ clawkeep export -p "strong-password"
226
+
227
+ # Import from archive
228
+ clawkeep import backup.clawkeep.enc -p "strong-password"
229
+ ```
230
+
231
+ ## Programmatic API
232
+
233
+ ```javascript
234
+ const { ClawGit } = require('clawkeep');
235
+
236
+ const claw = new ClawGit('/path/to/project');
237
+ await claw.init();
238
+
239
+ // Backup
240
+ const snap = await claw.snap('pre-deploy checkpoint');
241
+
242
+ // History
243
+ const history = await claw.log(10);
244
+
245
+ // Diff between any two backups
246
+ const changes = await claw.diffBetween('abc123', 'def456');
247
+
248
+ // Restore
249
+ await claw.restore('abc123');
250
+
251
+ // Time-travel file browsing
252
+ const files = await claw.listFilesAtCommit('abc123', 'memory/');
253
+ const content = await claw.showFileAtCommit('abc123', 'MEMORY.md');
254
+ ```
255
+
256
+ ## Built for AI Agents, Works for Everything
257
+
258
+ ClawKeep was built because AI agents break their own files. But it works for anything:
259
+
260
+ - **AI agent memory & config** — the original use case
261
+ - **Dotfiles** — version your shell config without thinking
262
+ - **Writing projects** — every draft saved, every version recoverable
263
+ - **Config management** — track infrastructure config changes over time
264
+ - **Any directory** — if files change, ClawKeep can track them
265
+
266
+ ## Why Not Just Git?
267
+
268
+ You *could* set up git, write a cron job, handle `.gitignore`, remember to commit, deal with merge conflicts, configure remotes...
269
+
270
+ Or you could run `clawkeep watch --daemon` and never think about it again.
271
+
272
+ | | Raw git | ClawKeep |
273
+ |---|---|---|
274
+ | Setup | Multiple commands | `clawkeep init` |
275
+ | Auto-backup | DIY cron/hooks | `clawkeep watch --daemon` |
276
+ | Ignore patterns | Manual `.gitignore` | Auto-managed `.clawkeepignore` |
277
+ | Time travel | `git checkout` / `git stash` | `clawkeep restore` |
278
+ | Visual history | External GUI needed | Built-in web dashboard |
279
+ | Backup targets | Manual remote config | `clawkeep backup local /path` (encrypted) |
280
+ | Encrypted export | Not built-in | `clawkeep export` |
281
+ | Learning curve | Steep | Three commands |
282
+
283
+ ClawKeep *is* git underneath. You get all the power with none of the ceremony.
284
+
285
+ ## Roadmap
286
+
287
+ - [ ] `clawkeep.com` — hosted dashboard & remote storage
288
+ - [ ] S3/R2 backend support
289
+ - [ ] Webhooks on file changes
290
+ - [ ] Multi-directory sync
291
+ - [ ] Team sharing & access control
292
+
293
+ ## License
294
+
295
+ MIT — [ClawKeep](https://clawkeep.com) 🐾
@@ -0,0 +1,145 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { program } = require('commander');
5
+ const chalk = require('chalk');
6
+ const pkg = require('../package.json');
7
+
8
+ const LOGO = chalk.cyan(`
9
+ _____ _ _ __
10
+ / ____| | | |/ /
11
+ | | | | __ ___ __| ' / ___ ___ _ __
12
+ | | | |/ _\` \\ \\ /\\ / /| < / _ \\/ _ \\ '_ \\
13
+ | |____| | (_| |\\ V V / | . \\ __/ __/ |_) |
14
+ \\_____|_|\\__,_| \\_/\\_/ |_|\\_\\___|\\___| .__/
15
+ | |
16
+ |_|
17
+ `);
18
+
19
+ program
20
+ .name('clawkeep')
21
+ .description(
22
+ chalk.dim('Git-backed versioned backups — set it and forget it') +
23
+ '\n' +
24
+ chalk.dim(' https://clawkeep.com')
25
+ )
26
+ .version(pkg.version, '-v, --version')
27
+ .addHelpText('beforeAll', LOGO);
28
+
29
+ // init
30
+ program
31
+ .command('init')
32
+ .description('Initialize versioned backup tracking in a directory')
33
+ .option('-d, --dir <path>', 'Target directory to track', '.')
34
+ .action((opts) => require('../src/commands/init')(opts));
35
+
36
+ // snap
37
+ program
38
+ .command('snap')
39
+ .description('Back up current state (save all changes)')
40
+ .option('-m, --message <msg>', 'Custom backup message')
41
+ .option('-d, --dir <path>', 'Target directory', '.')
42
+ .option('-q, --quiet', 'Minimal output', false)
43
+ .action((opts) => require('../src/commands/snap')(opts));
44
+
45
+ // diff
46
+ program
47
+ .command('diff')
48
+ .description('Show changes since last backup')
49
+ .option('-d, --dir <path>', 'Target directory', '.')
50
+ .option('--stat', 'Show file-level summary only', false)
51
+ .action((opts) => require('../src/commands/diff')(opts));
52
+
53
+ // log
54
+ program
55
+ .command('log')
56
+ .description('Show backup history timeline')
57
+ .option('-d, --dir <path>', 'Target directory', '.')
58
+ .option('-n, --limit <n>', 'Number of entries', '20')
59
+ .option('--oneline', 'Compact single-line format', false)
60
+ .option('--json', 'Output as JSON', false)
61
+ .action((opts) => require('../src/commands/log')(opts));
62
+
63
+ // restore
64
+ program
65
+ .command('restore [ref]')
66
+ .description('Restore to a specific backup point')
67
+ .option('-d, --dir <path>', 'Target directory', '.')
68
+ .option('--hard', 'Discard current changes (destructive)', false)
69
+ .action((ref, opts) => require('../src/commands/restore')(ref, opts));
70
+
71
+ // push
72
+ program
73
+ .command('push')
74
+ .description('Push backups to remote')
75
+ .option('-d, --dir <path>', 'Target directory', '.')
76
+ .option('-r, --remote <url>', 'Set remote repository URL')
77
+ .action((opts) => require('../src/commands/push')(opts));
78
+
79
+ // pull
80
+ program
81
+ .command('pull')
82
+ .description('Pull latest backups from remote')
83
+ .option('-d, --dir <path>', 'Target directory', '.')
84
+ .action((opts) => require('../src/commands/pull')(opts));
85
+
86
+ // backup
87
+ program
88
+ .command('backup [subcommand] [path]')
89
+ .description('Manage backup target (local, cloud, s3, git)')
90
+ .option('-d, --dir <path>', 'Target directory', '.')
91
+ .option('-p, --password <pass>', 'Encryption password (or CLAWKEEP_PASSWORD env)')
92
+ .action((subcommand, targetPath, opts) => {
93
+ opts.args = targetPath ? [targetPath] : [];
94
+ opts.path = targetPath;
95
+ require('../src/commands/backup')(subcommand, opts.args, opts);
96
+ });
97
+
98
+ // watch
99
+ program
100
+ .command('watch')
101
+ .description('Watch for file changes and auto-backup')
102
+ .option('-d, --dir <path>', 'Target directory', '.')
103
+ .option('--interval <ms>', 'Debounce interval in ms', '5000')
104
+ .option('--push', 'Auto-push after each snap', false)
105
+ .option('--daemon', 'Run in background')
106
+ .option('--stop', 'Stop background watcher')
107
+ .option('-q, --quiet', 'Minimal output', false)
108
+ .action((opts) => require('../src/commands/watch')(opts));
109
+
110
+ // export
111
+ program
112
+ .command('export')
113
+ .description('Export encrypted archive of full history')
114
+ .option('-d, --dir <path>', 'Target directory', '.')
115
+ .option('-o, --output <file>', 'Output file path')
116
+ .option('-p, --password <pass>', 'Encryption password (or CLAWKEEP_PASSWORD env)')
117
+ .action((opts) => require('../src/commands/export')(opts));
118
+
119
+ // import
120
+ program
121
+ .command('import <file>')
122
+ .description('Import and restore from encrypted archive')
123
+ .option('-d, --dir <path>', 'Restore destination', '.')
124
+ .option('-p, --password <pass>', 'Decryption password (or CLAWKEEP_PASSWORD env)')
125
+ .action((file, opts) => require('../src/commands/import')(file, opts));
126
+
127
+ // ui
128
+ program
129
+ .command('ui')
130
+ .description('Launch the web dashboard')
131
+ .option('-d, --dir <path>', 'Target directory', '.')
132
+ .option('--port <port>', 'Port number', '3333')
133
+ .option('--host <host>', 'Bind address', '0.0.0.0')
134
+ .option('--daemon', 'Run in background')
135
+ .option('--stop', 'Stop background dashboard')
136
+ .action((opts) => require('../src/commands/ui')(opts));
137
+
138
+ // status
139
+ program
140
+ .command('status')
141
+ .description('Show tracking status and stats')
142
+ .option('-d, --dir <path>', 'Target directory', '.')
143
+ .action((opts) => require('../src/commands/status')(opts));
144
+
145
+ program.parse();
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "clawkeep",
3
+ "version": "0.1.0",
4
+ "description": "Git-backed memory persistence for AI agents. Your agent's memory deserves version control.",
5
+ "main": "src/index.js",
6
+ "bin": {
7
+ "clawkeep": "./bin/clawkeep.js"
8
+ },
9
+ "scripts": {
10
+ "test": "node test/run.js",
11
+ "lint": "echo 'TODO: add linter'"
12
+ },
13
+ "keywords": [
14
+ "ai",
15
+ "agent",
16
+ "backup",
17
+ "memory",
18
+ "persistence",
19
+ "git",
20
+ "version-control",
21
+ "openclaw",
22
+ "clawdbot",
23
+ "nanobot",
24
+ "claude",
25
+ "codex",
26
+ "llm",
27
+ "snapshot",
28
+ "restore",
29
+ "time-travel"
30
+ ],
31
+ "author": "ClawKeep <hello@clawkeep.com>",
32
+ "license": "MIT",
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "https://github.com/taco-devs/clawkeep.git"
36
+ },
37
+ "homepage": "https://clawkeep.com",
38
+ "bugs": {
39
+ "url": "https://github.com/taco-devs/clawkeep/issues"
40
+ },
41
+ "dependencies": {
42
+ "chalk": "^4.1.2",
43
+ "chokidar": "^3.6.0",
44
+ "commander": "^12.0.0",
45
+ "ora": "^5.4.1",
46
+ "simple-git": "^3.22.0",
47
+ "tar": "^6.2.1"
48
+ },
49
+ "engines": {
50
+ "node": ">=18.0.0"
51
+ },
52
+ "files": [
53
+ "bin/",
54
+ "src/",
55
+ "ui/",
56
+ "README.md",
57
+ "LICENSE"
58
+ ]
59
+ }