agentdock-cli 1.0.1 → 1.2.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/README.md +47 -2
- package/dist/package.json +2 -1
- package/dist/src/cli.js +42 -1
- package/dist/src/commands/diff.js +71 -0
- package/dist/src/commands/doctor.js +1 -0
- package/dist/src/commands/history.js +107 -0
- package/dist/src/commands/recover.js +180 -0
- package/dist/src/commands/restore.js +103 -0
- package/dist/src/commands/snapshot.js +154 -0
- package/dist/src/constants/command-error-codes.js +4 -0
- package/dist/src/core/attest.js +5 -92
- package/dist/src/core/doctor.js +281 -0
- package/dist/src/core/report-html.js +72 -0
- package/dist/src/core/snapshot-diff.js +122 -0
- package/dist/src/core/snapshot.js +535 -0
- package/dist/src/core/supply-chain.js +114 -0
- package/dist/src/i18n/index.js +96 -4
- package/package.json +2 -1
package/dist/src/i18n/index.js
CHANGED
|
@@ -10,8 +10,8 @@ const FALLBACK = 'en';
|
|
|
10
10
|
/** User-facing strings. Machines read `--json` output, which is never localized. */
|
|
11
11
|
const DICTIONARIES = {
|
|
12
12
|
en: {
|
|
13
|
-
'cli.usage': 'Usage: agentdock <scan|export|pack|install|verify|attest|keygen|sign|validate|doctor|report|list|diff|config|uninstall|sync> [path]',
|
|
14
|
-
'cli.help.commands': 'Commands: scan, export, pack, install, verify, attest, keygen, sign, validate, doctor, report, list, diff, config, uninstall, sync',
|
|
13
|
+
'cli.usage': 'Usage: agentdock <scan|export|pack|install|verify|attest|keygen|sign|validate|doctor|report|list|diff|config|uninstall|sync|snapshot|history|recover|restore> [path]',
|
|
14
|
+
'cli.help.commands': 'Commands: scan, export, pack, install, verify, attest, keygen, sign, validate, doctor, report, list, diff, config, uninstall, sync, snapshot, history, recover, restore',
|
|
15
15
|
'cli.help.docs': 'Docs: https://github.com/spsz831/AgentDock#readme',
|
|
16
16
|
'cli.version': 'agentdock {version}',
|
|
17
17
|
'pack.usage': 'Usage: agentdock pack --from-scan <scan.yml> --out <dir> [--zip] [--env <file>] [--overwrite]',
|
|
@@ -47,6 +47,52 @@ const DICTIONARIES = {
|
|
|
47
47
|
'sync.statusLocalOnly': 'local only ({count}):',
|
|
48
48
|
'sync.statusRemoteOnly': 'bundle only ({count}):',
|
|
49
49
|
'sync.undoSkipped': 'modified since sync — left untouched',
|
|
50
|
+
'snapshot.usage': 'Usage: agentdock snapshot [create|list] [--agent claude|codex|all] [--root <dir>] [--redact] [--if-changed]\n agentdock snapshot push <target-dir> [--snapshot <id>] [--force]\n agentdock snapshot pull <source-dir> [--force]',
|
|
51
|
+
'snapshot.pushUsage': 'Usage: agentdock snapshot push <target-dir> [--snapshot <id>] [--force]',
|
|
52
|
+
'snapshot.pullUsage': 'Usage: agentdock snapshot pull <source-dir> [--force]',
|
|
53
|
+
'snapshot.pushed': 'Snapshot {id} exported to {dest}',
|
|
54
|
+
'snapshot.pulled': 'Imported {count} snapshot(s): {ids}',
|
|
55
|
+
'snapshot.pullSkipped': ' skipped (already exists, use --force to overwrite): {ids}',
|
|
56
|
+
'snapshot.pullNone': 'No snapshots imported',
|
|
57
|
+
'snapshot.created': 'Snapshot created: {id}',
|
|
58
|
+
'snapshot.location': ' location: {path}',
|
|
59
|
+
'snapshot.files': ' files ({count}): {files}',
|
|
60
|
+
'snapshot.counts': ' top-level keys: {top} / env keys: {env} / MCP: {mcp}',
|
|
61
|
+
'snapshot.redacted': ' secrets: redacted',
|
|
62
|
+
'snapshot.plaintext': ' secrets: stored in plaintext (local only — do not commit)',
|
|
63
|
+
'snapshot.empty': 'No snapshots yet — run `agentdock snapshot` to create a baseline',
|
|
64
|
+
'snapshot.unchanged': 'Configuration unchanged since snapshot {id} — skipped',
|
|
65
|
+
'snapshot.listHeader': 'Snapshots ({count}) in {dir}:',
|
|
66
|
+
'snapshot.listItem': ' {id} {agent} {files} file(s){redacted}',
|
|
67
|
+
'history.usage': 'Usage: agentdock history [--agent claude|codex|all] [--root <dir>]',
|
|
68
|
+
'history.header': 'Snapshot history ({count}) in {dir}:',
|
|
69
|
+
'history.entry': ' {id} {agent} {files} file(s) {summary}',
|
|
70
|
+
'history.baseline': 'baseline',
|
|
71
|
+
'history.changes': '{added} added / {removed} removed / {modified} modified',
|
|
72
|
+
'history.highlight': ' {path}',
|
|
73
|
+
'history.empty': 'No snapshots yet — run `agentdock snapshot` to create a baseline',
|
|
74
|
+
'recover.usage': 'Usage: agentdock recover [--snapshot <id>] [--apply] [--undo] [--root <dir>]',
|
|
75
|
+
'recover.header': 'Recovery candidates ({count}) in {dir} (highest score first):',
|
|
76
|
+
'recover.candidate': ' {score}/100 {id} {agent} {files} file(s){redacted}',
|
|
77
|
+
'recover.missing': ' missing: {files}',
|
|
78
|
+
'recover.recommended': ' recommended: {id}',
|
|
79
|
+
'recover.hint': 'Run `agentdock recover --apply` to restore the recommended snapshot, or `agentdock recover --snapshot <id> --apply` to choose another.',
|
|
80
|
+
'recover.empty': 'No snapshots to recover from — run `agentdock snapshot` first',
|
|
81
|
+
'recover.planLine': 'Recovery plan from snapshot {id} ({score}/100, {mode}):',
|
|
82
|
+
'recover.applied': 'Recovered {count} file(s) from snapshot {id}',
|
|
83
|
+
'recover.backup': ' pre-recovery snapshot: {id} (rollback: agentdock recover --undo --apply)',
|
|
84
|
+
'recover.undone': 'Undo complete: restored {count} file(s) from snapshot {id}',
|
|
85
|
+
'diff.snapshotHeader': 'Config diff: snapshot {from} → {to}',
|
|
86
|
+
'diff.noSnapshot': 'No snapshot found — run `agentdock snapshot` first',
|
|
87
|
+
'diff.noChanges': 'No configuration changes',
|
|
88
|
+
'restore.usage': 'Usage: agentdock restore --snapshot <id> [--apply]; rollback: agentdock restore --undo [--apply]',
|
|
89
|
+
'restore.planHeader': 'Restore plan from snapshot {id} ({mode}):',
|
|
90
|
+
'restore.undoPlanHeader': 'Undo plan — restore pre-restore snapshot {id} ({mode}):',
|
|
91
|
+
'restore.modeDryRun': 'dry-run — no changes written, use --apply to execute',
|
|
92
|
+
'restore.modeApply': 'applied',
|
|
93
|
+
'restore.applied': 'Restored {count} file(s) from snapshot {id}',
|
|
94
|
+
'restore.backup': ' pre-restore snapshot: {id} (rollback: agentdock restore --undo --apply)',
|
|
95
|
+
'restore.undone': 'Undo complete: restored {count} file(s) from snapshot {id}',
|
|
50
96
|
'install.complete': 'Install completed: {path}',
|
|
51
97
|
'uninstall.complete': 'Uninstall complete: {path}',
|
|
52
98
|
'uninstall.dryRunHeader': 'Uninstall plan (dry-run — no changes made): {path}',
|
|
@@ -67,8 +113,8 @@ const DICTIONARIES = {
|
|
|
67
113
|
'config.unsetValue': '(unset)',
|
|
68
114
|
},
|
|
69
115
|
'zh-CN': {
|
|
70
|
-
'cli.usage': '用法:agentdock <scan|export|pack|install|verify|attest|keygen|sign|validate|doctor|report|list|diff|config|uninstall|sync> [path]',
|
|
71
|
-
'cli.help.commands': '命令:scan、export、pack、install、verify、attest、keygen、sign、validate、doctor、report、list、diff、config、uninstall、sync',
|
|
116
|
+
'cli.usage': '用法:agentdock <scan|export|pack|install|verify|attest|keygen|sign|validate|doctor|report|list|diff|config|uninstall|sync|snapshot|history|recover|restore> [path]',
|
|
117
|
+
'cli.help.commands': '命令:scan、export、pack、install、verify、attest、keygen、sign、validate、doctor、report、list、diff、config、uninstall、sync、snapshot、history、recover、restore',
|
|
72
118
|
'cli.help.docs': '文档:https://github.com/spsz831/AgentDock#readme',
|
|
73
119
|
'cli.version': 'agentdock {version}',
|
|
74
120
|
'pack.usage': '用法:agentdock pack --from-scan <scan.yml> --out <目录> [--zip] [--env <文件>] [--overwrite]',
|
|
@@ -104,6 +150,52 @@ const DICTIONARIES = {
|
|
|
104
150
|
'sync.statusLocalOnly': '仅本机有({count}):',
|
|
105
151
|
'sync.statusRemoteOnly': '仅 bundle 有({count}):',
|
|
106
152
|
'sync.undoSkipped': '同步后被修改过,保持不动',
|
|
153
|
+
'snapshot.usage': '用法:agentdock snapshot [create|list] [--agent claude|codex|all] [--root <目录>] [--redact] [--if-changed]\n agentdock snapshot push <目标目录> [--snapshot <id>] [--force]\n agentdock snapshot pull <来源目录> [--force]',
|
|
154
|
+
'snapshot.pushUsage': '用法:agentdock snapshot push <目标目录> [--snapshot <id>] [--force]',
|
|
155
|
+
'snapshot.pullUsage': '用法:agentdock snapshot pull <来源目录> [--force]',
|
|
156
|
+
'snapshot.pushed': '快照 {id} 已导出到 {dest}',
|
|
157
|
+
'snapshot.pulled': '已导入 {count} 份快照:{ids}',
|
|
158
|
+
'snapshot.pullSkipped': ' 已跳过(本地已存在,--force 可覆盖):{ids}',
|
|
159
|
+
'snapshot.pullNone': '没有导入任何快照',
|
|
160
|
+
'snapshot.created': '快照已创建:{id}',
|
|
161
|
+
'snapshot.location': ' 位置:{path}',
|
|
162
|
+
'snapshot.files': ' 文件({count}):{files}',
|
|
163
|
+
'snapshot.counts': ' 顶层键:{top} / env 键:{env} / MCP:{mcp}',
|
|
164
|
+
'snapshot.redacted': ' 敏感值:已打码',
|
|
165
|
+
'snapshot.plaintext': ' 敏感值:明文保存(仅本机,请勿提交)',
|
|
166
|
+
'snapshot.empty': '尚无快照 —— 先运行 `agentdock snapshot` 建立基线',
|
|
167
|
+
'snapshot.unchanged': '配置自快照 {id} 以来没有变化 —— 已跳过',
|
|
168
|
+
'snapshot.listHeader': '快照({count})位于 {dir}:',
|
|
169
|
+
'snapshot.listItem': ' {id} {agent} {files} 个文件{redacted}',
|
|
170
|
+
'history.usage': '用法:agentdock history [--agent claude|codex|all] [--root <目录>]',
|
|
171
|
+
'history.header': '快照时间线({count})位于 {dir}:',
|
|
172
|
+
'history.entry': ' {id} {agent} {files} 个文件 {summary}',
|
|
173
|
+
'history.baseline': '基线',
|
|
174
|
+
'history.changes': '{added} 新增 / {removed} 删除 / {modified} 修改',
|
|
175
|
+
'history.highlight': ' {path}',
|
|
176
|
+
'history.empty': '尚无快照 —— 先运行 `agentdock snapshot` 建立基线',
|
|
177
|
+
'recover.usage': '用法:agentdock recover [--snapshot <id>] [--apply] [--undo] [--root <目录>]',
|
|
178
|
+
'recover.header': '恢复候选({count})位于 {dir}(按完整度评分排序):',
|
|
179
|
+
'recover.candidate': ' {score}/100 {id} {agent} {files} 个文件{redacted}',
|
|
180
|
+
'recover.missing': ' 缺失:{files}',
|
|
181
|
+
'recover.recommended': ' 推荐:{id}',
|
|
182
|
+
'recover.hint': '运行 `agentdock recover --apply` 恢复推荐快照,或 `agentdock recover --snapshot <id> --apply` 选择其他快照。',
|
|
183
|
+
'recover.empty': '没有可恢复的快照 —— 先运行 `agentdock snapshot` 建立基线',
|
|
184
|
+
'recover.planLine': '恢复计划(快照 {id},评分 {score}/100,{mode}):',
|
|
185
|
+
'recover.applied': '已从快照 {id} 恢复 {count} 个文件',
|
|
186
|
+
'recover.backup': ' 写前快照:{id}(回滚:agentdock recover --undo --apply)',
|
|
187
|
+
'recover.undone': '撤销完成:已从快照 {id} 恢复 {count} 个文件',
|
|
188
|
+
'diff.snapshotHeader': '配置差异:快照 {from} → {to}',
|
|
189
|
+
'diff.noSnapshot': '尚未找到快照 —— 先运行 `agentdock snapshot`',
|
|
190
|
+
'diff.noChanges': '配置没有变化',
|
|
191
|
+
'restore.usage': '用法:agentdock restore --snapshot <id> [--apply];回滚:agentdock restore --undo [--apply]',
|
|
192
|
+
'restore.planHeader': '恢复计划(快照 {id},{mode}):',
|
|
193
|
+
'restore.undoPlanHeader': '撤销计划 —— 还原写前快照 {id}({mode}):',
|
|
194
|
+
'restore.modeDryRun': 'dry-run — 未写入任何改动,--apply 才会执行',
|
|
195
|
+
'restore.modeApply': '已执行',
|
|
196
|
+
'restore.applied': '已从快照 {id} 恢复 {count} 个文件',
|
|
197
|
+
'restore.backup': ' 写前快照:{id}(回滚:agentdock restore --undo --apply)',
|
|
198
|
+
'restore.undone': '撤销完成:已从快照 {id} 恢复 {count} 个文件',
|
|
107
199
|
'install.complete': '安装完成:{path}',
|
|
108
200
|
'uninstall.complete': '卸载完成:{path}',
|
|
109
201
|
'uninstall.dryRunHeader': '卸载计划(dry-run — 未做任何改动):{path}',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentdock-cli",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Diagnose, migrate, and back up your AI coding assistant environment (Claude Code / Codex) — Chinese health reports, MCP servers, Skills, Agents, Plugins, Hooks, and memory, with secret isolation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"dev": "tsx src/cli.ts",
|
|
37
37
|
"test": "vitest run",
|
|
38
38
|
"e2e": "tsx scripts/e2e.ts",
|
|
39
|
+
"e2e:sync": "tsx scripts/e2e-sync.ts",
|
|
39
40
|
"cli": "tsx src/cli.ts",
|
|
40
41
|
"prepublishOnly": "npm run build",
|
|
41
42
|
"release:commits": "node scripts/generate-commit-groups.js"
|