@clawmover/cli 0.0.1 → 0.0.2

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.
Files changed (3) hide show
  1. package/README.md +122 -122
  2. package/dist/index.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,25 +1,25 @@
1
1
  # @clawmover/cli
2
2
 
3
- OpenClaw 数据备份和恢复命令行工具。
3
+ Command-line tool for OpenClaw data backup and recovery.
4
4
 
5
- ## 功能特性
5
+ ## Features
6
6
 
7
- - 🔄 **自动备份**: OpenClaw 数据备份到远程服务器
8
- - 📥 **数据恢复**: 从服务器快速恢复数据到本地
9
- - 🔒 **数据加密**: 使用 data-secret-key 加密所有备份数据
10
- - ⚡ **增量备份**: 基于 restic 的增量备份,节省存储空间
11
- - 🏷️ **标签管理**: 使用标签组织和筛选备份
12
- - ⚖️ **冲突处理**: 多种策略处理文件冲突
13
- - 📊 **进度显示**: 实时显示备份和恢复进度
14
- - 🔍 **详细日志**: 完整的操作日志记录
7
+ - 🔄 **Auto Backup**: Backup OpenClaw data to remote servers
8
+ - 📥 **Data Recovery**: Quickly restore data from server to local
9
+ - 🔒 **Data Encryption**: All backup data encrypted with data-secret-key
10
+ - ⚡ **Incremental Backup**: Restic-based incremental backup saves storage
11
+ - 🏷️ **Tag Management**: Organize and filter backups with tags
12
+ - ⚖️ **Conflict Handling**: Multiple strategies for file conflicts
13
+ - 📊 **Progress Display**: Real-time backup and restore progress
14
+ - 🔍 **Detailed Logs**: Complete operation log records
15
15
 
16
- ## 安装
16
+ ## Installation
17
17
 
18
18
  ```bash
19
19
  npm install -g @clawmover/cli
20
20
  ```
21
21
 
22
- 或从源码安装:
22
+ Or install from source:
23
23
 
24
24
  ```bash
25
25
  git clone https://github.com/clawmover/clawmover-cli.git
@@ -29,32 +29,32 @@ npm run build
29
29
  npm link
30
30
  ```
31
31
 
32
- ## 配置
32
+ ## Configuration
33
33
 
34
- 工具会自动读取 OpenClaw 配置文件,你也可以通过命令行参数覆盖:
34
+ The tool automatically reads OpenClaw config file. You can also override via command-line options:
35
35
 
36
36
  ```bash
37
- # 查看配置文件路径
37
+ # Show config file path
38
38
  openclaw config file
39
39
  ```
40
40
 
41
- ## 使用方法
41
+ ## Usage
42
42
 
43
- ### 备份数据
43
+ ### Backup Data
44
44
 
45
- 基本备份命令:
45
+ Basic backup command:
46
46
 
47
47
  ```bash
48
48
  clawmover backup
49
49
  ```
50
50
 
51
- 指定实例 ID 和密钥:
51
+ Specify instance ID and key:
52
52
 
53
53
  ```bash
54
54
  clawmover backup --instance-id your-instance-id --data-secret-key your-secret-key
55
55
  ```
56
56
 
57
- 高级选项:
57
+ Advanced options:
58
58
 
59
59
  ```bash
60
60
  clawmover backup \
@@ -67,38 +67,38 @@ clawmover backup \
67
67
  --log-level debug
68
68
  ```
69
69
 
70
- **参数说明:**
70
+ **Options:**
71
71
 
72
- - `--instance-id <id>`: 实例 ID (覆盖配置文件)
73
- - `--data-secret-key <key>`: 数据密钥 (覆盖配置文件)
74
- - `--tags <tags>`: 逗号分隔的标签列表
75
- - `--conflict-strategy <strategy>`: 冲突处理策略 (smart|interactive|overwrite),默认: smart
76
- - `--skip-temp`: 跳过临时文件
77
- - `--skip-cache`: 跳过缓存文件
78
- - `--storage-path <path>`: 自定义存储路径
79
- - `--log-level <level>`: 日志级别 (debug|info|warn|error)
72
+ - `--instance-id <id>`: Instance ID (override config file)
73
+ - `--data-secret-key <key>`: Data secret key (override config file)
74
+ - `--tags <tags>`: Comma-separated tag list
75
+ - `--conflict-strategy <strategy>`: Conflict strategy (smart|interactive|overwrite), default: smart
76
+ - `--skip-temp`: Skip temporary files
77
+ - `--skip-cache`: Skip cache files
78
+ - `--storage-path <path>`: Custom storage path
79
+ - `--log-level <level>`: Log level (debug|info|warn|error)
80
80
 
81
- ### 恢复数据
81
+ ### Restore Data
82
82
 
83
- 基本恢复命令:
83
+ Basic restore command:
84
84
 
85
85
  ```bash
86
86
  clawmover restore
87
87
  ```
88
88
 
89
- 指定快照 ID:
89
+ Specify snapshot ID:
90
90
 
91
91
  ```bash
92
92
  clawmover restore --snapshot-id abc123
93
93
  ```
94
94
 
95
- 按标签筛选:
95
+ Filter by tags:
96
96
 
97
97
  ```bash
98
98
  clawmover restore --tags core,imessage-db
99
99
  ```
100
100
 
101
- 高级选项:
101
+ Advanced options:
102
102
 
103
103
  ```bash
104
104
  clawmover restore \
@@ -111,178 +111,178 @@ clawmover restore \
111
111
  --log-level info
112
112
  ```
113
113
 
114
- **参数说明:**
114
+ **Options:**
115
115
 
116
- - `--instance-id <id>`: 实例 ID (覆盖配置文件)
117
- - `--data-secret-key <key>`: 数据密钥 (覆盖配置文件)
118
- - `--snapshot-id <id>`: 要恢复的快照 ID (默认: 最新)
119
- - `--tags <tags>`: 逗号分隔的标签,用于筛选快照
120
- - `--conflict-strategy <strategy>`: 冲突处理策略 (smart|interactive|overwrite),默认: smart
121
- - `--target-path <path>`: 恢复的目标目录
122
- - `--log-level <level>`: 日志级别 (debug|info|warn|error)
116
+ - `--instance-id <id>`: Instance ID (override config file)
117
+ - `--data-secret-key <key>`: Data secret key (override config file)
118
+ - `--snapshot-id <id>`: Snapshot ID to restore (default: latest)
119
+ - `--tags <tags>`: Comma-separated tags to filter snapshots
120
+ - `--conflict-strategy <strategy>`: Conflict strategy (smart|interactive|overwrite), default: smart
121
+ - `--target-path <path>`: Target directory for restoration
122
+ - `--log-level <level>`: Log level (debug|info|warn|error)
123
123
 
124
- ## 冲突处理策略
124
+ ## Conflict Handling Strategies
125
125
 
126
- ### Smart (智能处理,推荐)
126
+ ### Smart (Recommended)
127
127
 
128
- - **配置文件**: 询问用户如何处理
129
- - **数据库**: 自动备份旧版本
130
- - **附件**: 重命名本地文件
131
- - **普通文件**: 比较修改时间,保留较新的
128
+ - **Config files**: Ask user for decision
129
+ - **Database**: Auto backup old version
130
+ - **Attachments**: Rename local file
131
+ - **Regular files**: Compare modification time, keep newer
132
132
 
133
- ### Interactive (交互式处理)
133
+ ### Interactive
134
134
 
135
- 每个冲突都会询问用户选择:
136
- - 备份现有文件并覆盖
137
- - 重命名现有文件
138
- - 跳过此文件
139
- - 直接覆盖
135
+ Ask user for each conflict:
136
+ - Backup existing file and overwrite
137
+ - Rename existing file
138
+ - Skip this file
139
+ - Overwrite directly
140
140
 
141
- ### Overwrite (自动覆盖)
141
+ ### Overwrite
142
142
 
143
- 直接覆盖所有冲突文件,不进行备份
143
+ Overwrite all conflicting files without backup
144
144
 
145
- ## 备份计划
145
+ ## Backup Plan
146
146
 
147
- 工具会自动生成备份计划,包含以下数据类型:
147
+ The tool automatically generates backup plan with these data types:
148
148
 
149
- 1. **Core 数据** (必需)
150
- - OpenClaw 核心配置和数据
151
- - 标签: `core`
149
+ 1. **Core Data** (Required)
150
+ - OpenClaw core config and data
151
+ - Tag: `core`
152
152
 
153
- 2. **iMessage 数据库** (可选)
154
- - 如果配置了 `imessageDb`
155
- - 标签: `imessage-db`, `core`
153
+ 2. **iMessage Database** (Optional)
154
+ - If `imessageDb` is configured
155
+ - Tags: `imessage-db`, `core`
156
156
 
157
- 3. **iMessage 附件** (可选)
158
- - 如果配置了 `imessageAttachments`
159
- - 标签: `imessage-attachments`, `core`
157
+ 3. **iMessage Attachments** (Optional)
158
+ - If `imessageAttachments` is configured
159
+ - Tags: `imessage-attachments`, `core`
160
160
 
161
- 4. **Sandbox 数据** (可选)
162
- - 沙箱环境数据
163
- - 标签: `sandbox`
161
+ 4. **Sandbox Data** (Optional)
162
+ - Sandbox environment data
163
+ - Tag: `sandbox`
164
164
 
165
- 5. **缓存数据** (可选)
166
- - 应用缓存
167
- - 标签: `cache`
165
+ 5. **Cache Data** (Optional)
166
+ - Application cache
167
+ - Tag: `cache`
168
168
 
169
- 6. **临时文件** (可选)
170
- - 临时文件
171
- - 标签: `temp`
169
+ 6. **Temporary Files** (Optional)
170
+ - Temporary files
171
+ - Tag: `temp`
172
172
 
173
- ## 标签系统
173
+ ## Tag System
174
174
 
175
- 使用标签可以更好地组织和筛选备份:
175
+ Use tags to organize and filter backups:
176
176
 
177
177
  ```bash
178
- # 创建带标签的备份
178
+ # Create backup with tags
179
179
  clawmover backup --tags production,daily
180
180
 
181
- # 恢复特定标签的数据
181
+ # Restore specific tagged data
182
182
  clawmover restore --tags production
183
183
 
184
- # 查看特定实例的所有备份
184
+ # List all backups for an instance
185
185
  clawmover list --instance-id your-instance-id
186
186
  ```
187
187
 
188
- 自动添加的标签:
189
- - `instance:<instanceId>`: 实例 ID
190
- - `date:<YYYY-MM-DD>`: 备份日期
188
+ Auto-added tags:
189
+ - `instance:<instanceId>`: Instance ID
190
+ - `date:<YYYY-MM-DD>`: Backup date
191
191
 
192
- ## 日志和调试
192
+ ## Logging and Debugging
193
193
 
194
- 设置日志级别:
194
+ Set log level:
195
195
 
196
196
  ```bash
197
- # 详细调试信息
197
+ # Verbose debug info
198
198
  clawmover backup --log-level debug
199
199
 
200
- # 只显示错误
200
+ # Errors only
201
201
  clawmover backup --log-level error
202
202
  ```
203
203
 
204
- 日志文件默认保存在 `./logs/clawmover.log`。
204
+ Log file is saved to `./logs/clawmover.log` by default.
205
205
 
206
- ## 开发
206
+ ## Development
207
207
 
208
- ### 项目结构
208
+ ### Project Structure
209
209
 
210
210
  ```
211
211
  @clawmover/cli/
212
212
  ├── src/
213
- │ ├── commands/ # 命令执行层
214
- │ ├── services/ # 核心服务层
215
- │ ├── integrations/ # 外部集成层
216
- │ ├── system/ # 系统服务层
217
- │ ├── types/ # 类型定义
218
- │ ├── utils/ # 工具函数
219
- │ └── index.ts # 入口文件
220
- ├── tests/ # 测试文件
213
+ │ ├── commands/ # Command execution layer
214
+ │ ├── services/ # Core service layer
215
+ │ ├── integrations/ # External integration layer
216
+ │ ├── system/ # System service layer
217
+ │ ├── types/ # Type definitions
218
+ │ ├── utils/ # Utility functions
219
+ │ └── index.ts # Entry point
220
+ ├── tests/ # Test files
221
221
  ├── package.json
222
222
  ├── tsconfig.json
223
223
  └── README.md
224
224
  ```
225
225
 
226
- ### 构建
226
+ ### Build
227
227
 
228
228
  ```bash
229
229
  npm run build
230
230
  ```
231
231
 
232
- ### 测试
232
+ ### Test
233
233
 
234
234
  ```bash
235
- # 运行所有测试
235
+ # Run all tests
236
236
  npm test
237
237
 
238
- # 监视模式
238
+ # Watch mode
239
239
  npm run test:watch
240
240
 
241
- # 覆盖率报告
241
+ # Coverage report
242
242
  npm run test:coverage
243
243
  ```
244
244
 
245
- ### 代码质量
245
+ ### Code Quality
246
246
 
247
247
  ```bash
248
248
  # Lint
249
249
  npm run lint
250
250
 
251
- # 自动修复
251
+ # Auto fix
252
252
  npm run lint:fix
253
253
 
254
- # 格式化代码
254
+ # Format code
255
255
  npm run format
256
256
  ```
257
257
 
258
- ## 故障排除
258
+ ## Troubleshooting
259
259
 
260
- ### 备份失败
260
+ ### Backup Failed
261
261
 
262
- 1. 检查网络连接
263
- 2. 验证 `data-secret-key` 是否正确
264
- 3. 查看日志文件获取详细错误信息
262
+ 1. Check network connection
263
+ 2. Verify `data-secret-key` is correct
264
+ 3. Check log file for detailed error info
265
265
 
266
- ### 恢复失败
266
+ ### Restore Failed
267
267
 
268
- 1. 确认快照 ID 存在
269
- 2. 检查目标目录权限
270
- 3. 验证 `data-secret-key` 是否与备份时相同
268
+ 1. Confirm snapshot ID exists
269
+ 2. Check target directory permissions
270
+ 3. Verify `data-secret-key` matches the backup
271
271
 
272
- ### 找不到 OpenClaw 配置
272
+ ### OpenClaw Config Not Found
273
273
 
274
- 运行以下命令检查配置文件位置:
274
+ Run this command to check config file location:
275
275
 
276
276
  ```bash
277
277
  openclaw config file
278
278
  ```
279
279
 
280
- ## 许可证
280
+ ## License
281
281
 
282
282
  MIT
283
283
 
284
- ## 支持
284
+ ## Support
285
285
 
286
- 如有问题或建议,请访问:
286
+ For issues or suggestions, visit:
287
287
  - GitHub Issues: https://github.com/clawmover/clawmover-cli/issues
288
- - 文档: https://github.com/clawmover/clawmover-cli#readme
288
+ - Documentation: https://github.com/clawmover/clawmover-cli#readme