clawvault 2.5.1 → 2.5.3

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 (88) hide show
  1. package/README.md +159 -199
  2. package/bin/clawvault.js +111 -111
  3. package/bin/command-registration.test.js +166 -165
  4. package/bin/command-runtime.js +93 -77
  5. package/bin/command-runtime.test.js +154 -102
  6. package/bin/help-contract.test.js +39 -28
  7. package/bin/register-config-commands.js +153 -153
  8. package/bin/register-config-route-commands.test.js +121 -121
  9. package/bin/register-core-commands.js +237 -237
  10. package/bin/register-kanban-commands.js +56 -56
  11. package/bin/register-kanban-commands.test.js +83 -83
  12. package/bin/register-maintenance-commands.js +282 -248
  13. package/bin/register-project-commands.js +209 -209
  14. package/bin/register-project-commands.test.js +206 -201
  15. package/bin/register-query-commands.js +317 -312
  16. package/bin/register-query-commands.test.js +65 -0
  17. package/bin/register-resilience-commands.js +182 -182
  18. package/bin/register-resilience-commands.test.js +81 -81
  19. package/bin/register-route-commands.js +114 -114
  20. package/bin/register-session-lifecycle-commands.js +206 -206
  21. package/bin/register-tailscale-commands.js +106 -106
  22. package/bin/register-task-commands.js +348 -348
  23. package/bin/register-task-commands.test.js +69 -69
  24. package/bin/register-template-commands.js +72 -72
  25. package/bin/register-vault-operations-commands.js +300 -300
  26. package/bin/test-helpers/cli-command-fixtures.js +119 -119
  27. package/dashboard/lib/graph-diff.js +104 -104
  28. package/dashboard/lib/graph-diff.test.js +75 -75
  29. package/dashboard/lib/vault-parser.js +556 -556
  30. package/dashboard/lib/vault-parser.test.js +254 -254
  31. package/dashboard/public/app.js +796 -796
  32. package/dashboard/public/index.html +52 -52
  33. package/dashboard/public/styles.css +221 -221
  34. package/dashboard/server.js +374 -374
  35. package/dist/{chunk-G3OQJ2NQ.js → chunk-2YDBJS7M.js} +1 -1
  36. package/dist/chunk-3FP5BJ42.js +88 -0
  37. package/dist/{chunk-C3PF7WBA.js → chunk-4IV3R2F5.js} +2 -2
  38. package/dist/{chunk-7OHQFMJK.js → chunk-AY4PGUVL.js} +5 -4
  39. package/dist/chunk-FG6RJMCN.js +33 -0
  40. package/dist/{chunk-WIICLBNF.js → chunk-GFJ3LIIB.js} +1 -1
  41. package/dist/chunk-IZEY5S74.js +541 -0
  42. package/dist/chunk-LMEMZGUV.js +332 -0
  43. package/dist/{chunk-6RQPD7X6.js → chunk-M25QVSJM.js} +4 -3
  44. package/dist/{chunk-6B3JWM7J.js → chunk-O7XHXF7F.js} +34 -7
  45. package/dist/chunk-OSMS7QIG.js +406 -0
  46. package/dist/{chunk-PAYUH64O.js → chunk-QVMXF7FY.js} +11 -1
  47. package/dist/{chunk-TMZMN7OS.js → chunk-S2IG7VNM.js} +24 -12
  48. package/dist/{chunk-LMCC5OC7.js → chunk-TPDH3JPP.js} +1 -1
  49. package/dist/cli/index.d.ts +5 -0
  50. package/dist/cli/index.js +31 -0
  51. package/dist/commands/canvas.js +3 -3
  52. package/dist/commands/compat.js +1 -1
  53. package/dist/commands/context.js +4 -4
  54. package/dist/commands/doctor.js +16 -309
  55. package/dist/commands/embed.d.ts +17 -0
  56. package/dist/commands/embed.js +10 -0
  57. package/dist/commands/migrate-observations.js +2 -2
  58. package/dist/commands/observe.d.ts +1 -0
  59. package/dist/commands/observe.js +7 -6
  60. package/dist/commands/rebuild.js +5 -5
  61. package/dist/commands/reflect.js +3 -3
  62. package/dist/commands/replay.js +7 -7
  63. package/dist/commands/setup.d.ts +1 -0
  64. package/dist/commands/setup.js +2 -2
  65. package/dist/commands/sleep.d.ts +2 -1
  66. package/dist/commands/sleep.js +15 -15
  67. package/dist/commands/status.d.ts +9 -1
  68. package/dist/commands/status.js +33 -8
  69. package/dist/commands/wake.d.ts +1 -1
  70. package/dist/commands/wake.js +6 -6
  71. package/dist/index.d.ts +82 -5
  72. package/dist/index.js +127 -105
  73. package/dist/{types-jjuYN2Xn.d.ts → types-C74wgGL1.d.ts} +2 -0
  74. package/hooks/clawvault/HOOK.md +83 -74
  75. package/hooks/clawvault/handler.js +816 -812
  76. package/hooks/clawvault/handler.test.js +263 -263
  77. package/package.json +94 -125
  78. package/templates/checkpoint.md +19 -19
  79. package/templates/daily-note.md +19 -19
  80. package/templates/daily.md +19 -19
  81. package/templates/decision.md +17 -17
  82. package/templates/handoff.md +19 -19
  83. package/templates/lesson.md +16 -16
  84. package/templates/person.md +19 -19
  85. package/templates/project.md +23 -23
  86. package/dist/chunk-2RK2AG32.js +0 -743
  87. package/dist/{chunk-FW465EEA.js → chunk-VXEOHTSL.js} +3 -3
  88. package/dist/{chunk-KCCHROBR.js → chunk-YOSEUUNB.js} +4 -4
@@ -1,248 +1,282 @@
1
- /**
2
- * Maintenance and graph-oriented command registrations.
3
- * Split from the main CLI entrypoint to keep bin/clawvault.js maintainable.
4
- */
5
-
6
- export function registerMaintenanceCommands(program, { chalk }) {
7
- // === DOCTOR (health check) ===
8
- program
9
- .command('doctor')
10
- .description('Check ClawVault setup health')
11
- .option('-v, --vault <path>', 'Vault path')
12
- .action(async (options) => {
13
- try {
14
- const { doctor } = await import('../dist/commands/doctor.js');
15
- const report = await doctor(options.vault);
16
-
17
- console.log(chalk.cyan('\n🩺 ClawVault Health Check\n'));
18
- if (report.vaultPath) {
19
- console.log(chalk.dim(`Vault: ${report.vaultPath}`));
20
- console.log();
21
- }
22
-
23
- for (const check of report.checks) {
24
- const prefix = check.status === 'ok'
25
- ? chalk.green('✓')
26
- : check.status === 'warn'
27
- ? chalk.yellow('')
28
- : chalk.red('✗');
29
- const detail = check.detail ? ` ${check.detail}` : '';
30
- console.log(`${prefix} ${check.label}${detail}`);
31
- if (check.hint) {
32
- console.log(chalk.dim(` ${check.hint}`));
33
- }
34
- }
35
-
36
- const issues = report.warnings + report.errors;
37
- console.log();
38
- if (issues === 0) {
39
- console.log(chalk.green('✅ ClawVault is healthy!\n'));
40
- } else {
41
- console.log(chalk.yellow(`⚠ ${issues} issue(s) found\n`));
42
- }
43
- } catch (err) {
44
- console.error(chalk.red(`Error: ${err.message}`));
45
- process.exit(1);
46
- }
47
- });
48
-
49
- // === COMPAT (OpenClaw compatibility) ===
50
- program
51
- .command('compat')
52
- .description('Check OpenClaw compatibility status')
53
- .option('--strict', 'Exit non-zero when warnings are present')
54
- .option('--base-dir <path>', 'Validate compatibility against alternate project root')
55
- .option('--json', 'Output as JSON')
56
- .action(async (options) => {
57
- try {
58
- const { compatCommand, compatibilityExitCode } = await import('../dist/commands/compat.js');
59
- const report = await compatCommand({
60
- json: options.json,
61
- strict: options.strict,
62
- baseDir: options.baseDir
63
- });
64
- const exitCode = compatibilityExitCode(report, { strict: options.strict });
65
- if (exitCode !== 0) {
66
- process.exitCode = exitCode;
67
- }
68
- } catch (err) {
69
- console.error(chalk.red(`Error: ${err.message}`));
70
- process.exit(1);
71
- }
72
- });
73
-
74
- // === GRAPH ===
75
- program
76
- .command('graph')
77
- .description('Show typed memory graph summary')
78
- .option('-v, --vault <path>', 'Vault path')
79
- .option('--refresh', 'Rebuild graph index before showing summary')
80
- .option('--json', 'Output as JSON')
81
- .action(async (options) => {
82
- try {
83
- const { graphCommand } = await import('../dist/commands/graph.js');
84
- await graphCommand({
85
- vaultPath: options.vault,
86
- refresh: options.refresh,
87
- json: options.json
88
- });
89
- } catch (err) {
90
- console.error(chalk.red(`Error: ${err.message}`));
91
- process.exit(1);
92
- }
93
- });
94
-
95
- // === ENTITIES ===
96
- program
97
- .command('entities')
98
- .description('List all linkable entities in the vault')
99
- .option('-v, --vault <path>', 'Vault path')
100
- .option('--json', 'Output as JSON')
101
- .action(async (options) => {
102
- try {
103
- const { entitiesCommand } = await import('../dist/commands/entities.js');
104
- await entitiesCommand({ json: options.json, vaultPath: options.vault });
105
- } catch (err) {
106
- console.error(chalk.red(`Error: ${err.message}`));
107
- process.exit(1);
108
- }
109
- });
110
-
111
- // === LINK ===
112
- program
113
- .command('link [file]')
114
- .description('Auto-link entity mentions in markdown files')
115
- .option('--all', 'Link all files in vault')
116
- .option('--backlinks <file>', 'Show backlinks to a file')
117
- .option('--dry-run', 'Show what would be linked without changing files')
118
- .option('--orphans', 'List broken wiki-links')
119
- .option('--rebuild', 'Rebuild backlinks index')
120
- .option('-v, --vault <path>', 'Vault path')
121
- .action(async (file, options) => {
122
- try {
123
- const { linkCommand } = await import('../dist/commands/link.js');
124
- await linkCommand(file, {
125
- all: options.all,
126
- dryRun: options.dryRun,
127
- backlinks: options.backlinks,
128
- orphans: options.orphans,
129
- rebuild: options.rebuild,
130
- vaultPath: options.vault
131
- });
132
- } catch (err) {
133
- console.error(chalk.red(`Error: ${err.message}`));
134
- process.exit(1);
135
- }
136
- });
137
-
138
- // === REBUILD ===
139
- program
140
- .command('rebuild')
141
- .description('Rebuild observations from ledger/raw transcripts')
142
- .option('--from <date>', 'Start date (YYYY-MM-DD)')
143
- .option('--to <date>', 'End date (YYYY-MM-DD)')
144
- .option('-v, --vault <path>', 'Vault path')
145
- .action(async (options) => {
146
- try {
147
- const { rebuildCommand } = await import('../dist/commands/rebuild.js');
148
- await rebuildCommand({
149
- vaultPath: options.vault,
150
- from: options.from,
151
- to: options.to
152
- });
153
- } catch (err) {
154
- console.error(chalk.red(`Error: ${err.message}`));
155
- process.exit(1);
156
- }
157
- });
158
-
159
- // === ARCHIVE ===
160
- program
161
- .command('archive')
162
- .description('Archive old observations into ledger/archive')
163
- .option('--older-than <days>', 'Archive observations older than this many days', '14')
164
- .option('--dry-run', 'Show archive candidates without writing')
165
- .option('-v, --vault <path>', 'Vault path')
166
- .action(async (options) => {
167
- try {
168
- const { archiveCommand } = await import('../dist/commands/archive.js');
169
- const olderThan = Number.parseInt(options.olderThan, 10);
170
- if (!Number.isFinite(olderThan) || olderThan <= 0) {
171
- throw new Error(`Invalid --older-than value: ${options.olderThan}`);
172
- }
173
- await archiveCommand({
174
- vaultPath: options.vault,
175
- olderThan,
176
- dryRun: options.dryRun
177
- });
178
- } catch (err) {
179
- console.error(chalk.red(`Error: ${err.message}`));
180
- process.exit(1);
181
- }
182
- });
183
-
184
- // === MIGRATE-OBSERVATIONS ===
185
- program
186
- .command('migrate-observations')
187
- .description('Convert legacy emoji observations to scored format')
188
- .option('--dry-run', 'Show migration candidates without writing')
189
- .option('-v, --vault <path>', 'Vault path')
190
- .action(async (options) => {
191
- try {
192
- const { migrateObservationsCommand } = await import('../dist/commands/migrate-observations.js');
193
- await migrateObservationsCommand({
194
- vaultPath: options.vault,
195
- dryRun: options.dryRun
196
- });
197
- } catch (err) {
198
- console.error(chalk.red(`Error: ${err.message}`));
199
- process.exit(1);
200
- }
201
- });
202
-
203
- // === REPLAY ===
204
- program
205
- .command('replay')
206
- .description('Replay historical conversation exports through observe pipeline')
207
- .requiredOption('--source <platform>', 'Source platform (chatgpt|claude|opencode|openclaw)')
208
- .requiredOption('--input <path>', 'Input export file or directory')
209
- .option('--from <date>', 'Start date (YYYY-MM-DD)')
210
- .option('--to <date>', 'End date (YYYY-MM-DD)')
211
- .option('--dry-run', 'Preview replay candidates without writing')
212
- .option('-v, --vault <path>', 'Vault path')
213
- .action(async (options) => {
214
- try {
215
- const { replayCommand } = await import('../dist/commands/replay.js');
216
- await replayCommand({
217
- source: options.source,
218
- inputPath: options.input,
219
- from: options.from,
220
- to: options.to,
221
- dryRun: options.dryRun,
222
- vaultPath: options.vault
223
- });
224
- } catch (err) {
225
- console.error(chalk.red(`Error: ${err.message}`));
226
- process.exit(1);
227
- }
228
- });
229
-
230
- // === SYNC-BD ===
231
- program
232
- .command('sync-bd')
233
- .description('Sync active Beads tasks into views/now.md (optional)')
234
- .option('--dry-run', 'Show sync output without writing')
235
- .option('-v, --vault <path>', 'Vault path')
236
- .action(async (options) => {
237
- try {
238
- const { syncBdCommand } = await import('../dist/commands/sync-bd.js');
239
- await syncBdCommand({
240
- vaultPath: options.vault,
241
- dryRun: options.dryRun
242
- });
243
- } catch (err) {
244
- console.error(chalk.red(`Error: ${err.message}`));
245
- process.exit(1);
246
- }
247
- });
248
- }
1
+ /**
2
+ * Maintenance and graph-oriented command registrations.
3
+ * Split from the main CLI entrypoint to keep bin/clawvault.js maintainable.
4
+ */
5
+
6
+ export function registerMaintenanceCommands(program, { chalk }) {
7
+ // === DOCTOR (health check) ===
8
+ program
9
+ .command('doctor')
10
+ .description('Diagnose vault health and optionally apply fixes')
11
+ .option('-v, --vault <path>', 'Vault path')
12
+ .option('--fix', 'Apply safe auto-fixes for qmd index, embeddings, and dead collections')
13
+ .option('--json', 'Output machine-readable JSON')
14
+ .action(async (options) => {
15
+ try {
16
+ const { doctor } = await import('../dist/commands/doctor.js');
17
+ const report = await doctor({
18
+ vaultPath: options.vault,
19
+ fix: options.fix
20
+ });
21
+
22
+ if (options.json) {
23
+ console.log(JSON.stringify(report, null, 2));
24
+ return;
25
+ }
26
+
27
+ console.log(chalk.cyan('\n🩺 ClawVault Health Check\n'));
28
+ console.log(chalk.dim(`Vault: ${report.vaultPath}`));
29
+ console.log(chalk.dim(`qmd collection: ${report.qmdCollection}`));
30
+ console.log(chalk.dim(`qmd root: ${report.qmdRoot}`));
31
+ console.log();
32
+
33
+ for (const check of report.checks) {
34
+ const prefix = check.status === 'ok'
35
+ ? chalk.green('✓')
36
+ : check.status === 'warn'
37
+ ? chalk.yellow('⚠')
38
+ : chalk.red('✗');
39
+ const line = `${check.label}: ${check.detail}`;
40
+ const renderedLine = check.status === 'ok'
41
+ ? chalk.green(line)
42
+ : check.status === 'warn'
43
+ ? chalk.yellow(line)
44
+ : chalk.red(line);
45
+ console.log(`${prefix} ${renderedLine}`);
46
+ if (check.hint) {
47
+ console.log(chalk.dim(` ${check.hint}`));
48
+ }
49
+ }
50
+
51
+ const issues = report.warnings + report.errors;
52
+ console.log();
53
+ if (issues === 0) {
54
+ console.log(chalk.green(' ClawVault is healthy!\n'));
55
+ } else {
56
+ const summary = `${report.errors} error(s), ${report.warnings} warning(s)`;
57
+ const colorized = report.errors > 0 ? chalk.red(summary) : chalk.yellow(summary);
58
+ console.log(`${report.errors > 0 ? '✗' : ''} ${colorized}\n`);
59
+ }
60
+ } catch (err) {
61
+ console.error(chalk.red(`Error: ${err.message}`));
62
+ process.exit(1);
63
+ }
64
+ });
65
+
66
+ // === EMBED ===
67
+ program
68
+ .command('embed')
69
+ .description('Run qmd embedding for pending vault documents')
70
+ .option('-v, --vault <path>', 'Vault path')
71
+ .action(async (options) => {
72
+ try {
73
+ const { embedCommand } = await import('../dist/commands/embed.js');
74
+ await embedCommand({
75
+ vaultPath: options.vault
76
+ });
77
+ } catch (err) {
78
+ console.error(chalk.red(`Error: ${err.message}`));
79
+ process.exit(1);
80
+ }
81
+ });
82
+
83
+ // === COMPAT (OpenClaw compatibility) ===
84
+ program
85
+ .command('compat')
86
+ .description('Check OpenClaw compatibility status')
87
+ .option('--strict', 'Exit non-zero when warnings are present')
88
+ .option('--base-dir <path>', 'Validate compatibility against alternate project root')
89
+ .option('--json', 'Output as JSON')
90
+ .action(async (options) => {
91
+ try {
92
+ const { compatCommand, compatibilityExitCode } = await import('../dist/commands/compat.js');
93
+ const report = await compatCommand({
94
+ json: options.json,
95
+ strict: options.strict,
96
+ baseDir: options.baseDir
97
+ });
98
+ const exitCode = compatibilityExitCode(report, { strict: options.strict });
99
+ if (exitCode !== 0) {
100
+ process.exitCode = exitCode;
101
+ }
102
+ } catch (err) {
103
+ console.error(chalk.red(`Error: ${err.message}`));
104
+ process.exit(1);
105
+ }
106
+ });
107
+
108
+ // === GRAPH ===
109
+ program
110
+ .command('graph')
111
+ .description('Show typed memory graph summary')
112
+ .option('-v, --vault <path>', 'Vault path')
113
+ .option('--refresh', 'Rebuild graph index before showing summary')
114
+ .option('--json', 'Output as JSON')
115
+ .action(async (options) => {
116
+ try {
117
+ const { graphCommand } = await import('../dist/commands/graph.js');
118
+ await graphCommand({
119
+ vaultPath: options.vault,
120
+ refresh: options.refresh,
121
+ json: options.json
122
+ });
123
+ } catch (err) {
124
+ console.error(chalk.red(`Error: ${err.message}`));
125
+ process.exit(1);
126
+ }
127
+ });
128
+
129
+ // === ENTITIES ===
130
+ program
131
+ .command('entities')
132
+ .description('List all linkable entities in the vault')
133
+ .option('-v, --vault <path>', 'Vault path')
134
+ .option('--json', 'Output as JSON')
135
+ .action(async (options) => {
136
+ try {
137
+ const { entitiesCommand } = await import('../dist/commands/entities.js');
138
+ await entitiesCommand({ json: options.json, vaultPath: options.vault });
139
+ } catch (err) {
140
+ console.error(chalk.red(`Error: ${err.message}`));
141
+ process.exit(1);
142
+ }
143
+ });
144
+
145
+ // === LINK ===
146
+ program
147
+ .command('link [file]')
148
+ .description('Auto-link entity mentions in markdown files')
149
+ .option('--all', 'Link all files in vault')
150
+ .option('--backlinks <file>', 'Show backlinks to a file')
151
+ .option('--dry-run', 'Show what would be linked without changing files')
152
+ .option('--orphans', 'List broken wiki-links')
153
+ .option('--rebuild', 'Rebuild backlinks index')
154
+ .option('-v, --vault <path>', 'Vault path')
155
+ .action(async (file, options) => {
156
+ try {
157
+ const { linkCommand } = await import('../dist/commands/link.js');
158
+ await linkCommand(file, {
159
+ all: options.all,
160
+ dryRun: options.dryRun,
161
+ backlinks: options.backlinks,
162
+ orphans: options.orphans,
163
+ rebuild: options.rebuild,
164
+ vaultPath: options.vault
165
+ });
166
+ } catch (err) {
167
+ console.error(chalk.red(`Error: ${err.message}`));
168
+ process.exit(1);
169
+ }
170
+ });
171
+
172
+ // === REBUILD ===
173
+ program
174
+ .command('rebuild')
175
+ .description('Rebuild observations from ledger/raw transcripts')
176
+ .option('--from <date>', 'Start date (YYYY-MM-DD)')
177
+ .option('--to <date>', 'End date (YYYY-MM-DD)')
178
+ .option('-v, --vault <path>', 'Vault path')
179
+ .action(async (options) => {
180
+ try {
181
+ const { rebuildCommand } = await import('../dist/commands/rebuild.js');
182
+ await rebuildCommand({
183
+ vaultPath: options.vault,
184
+ from: options.from,
185
+ to: options.to
186
+ });
187
+ } catch (err) {
188
+ console.error(chalk.red(`Error: ${err.message}`));
189
+ process.exit(1);
190
+ }
191
+ });
192
+
193
+ // === ARCHIVE ===
194
+ program
195
+ .command('archive')
196
+ .description('Archive old observations into ledger/archive')
197
+ .option('--older-than <days>', 'Archive observations older than this many days (default: 14)', '14')
198
+ .option('--dry-run', 'Show archive candidates without writing')
199
+ .option('-v, --vault <path>', 'Vault path')
200
+ .action(async (options) => {
201
+ try {
202
+ const { archiveCommand } = await import('../dist/commands/archive.js');
203
+ const olderThan = Number.parseInt(options.olderThan, 10);
204
+ if (!Number.isFinite(olderThan) || olderThan <= 0) {
205
+ throw new Error(`Invalid --older-than value: ${options.olderThan}`);
206
+ }
207
+ await archiveCommand({
208
+ vaultPath: options.vault,
209
+ olderThan,
210
+ dryRun: options.dryRun
211
+ });
212
+ } catch (err) {
213
+ console.error(chalk.red(`Error: ${err.message}`));
214
+ process.exit(1);
215
+ }
216
+ });
217
+
218
+ // === MIGRATE-OBSERVATIONS ===
219
+ program
220
+ .command('migrate-observations')
221
+ .description('Convert legacy emoji observations to scored format')
222
+ .option('--dry-run', 'Show migration candidates without writing')
223
+ .option('-v, --vault <path>', 'Vault path')
224
+ .action(async (options) => {
225
+ try {
226
+ const { migrateObservationsCommand } = await import('../dist/commands/migrate-observations.js');
227
+ await migrateObservationsCommand({
228
+ vaultPath: options.vault,
229
+ dryRun: options.dryRun
230
+ });
231
+ } catch (err) {
232
+ console.error(chalk.red(`Error: ${err.message}`));
233
+ process.exit(1);
234
+ }
235
+ });
236
+
237
+ // === REPLAY ===
238
+ program
239
+ .command('replay')
240
+ .description('Replay historical conversation exports through observe pipeline')
241
+ .requiredOption('--source <platform>', 'Source platform (chatgpt|claude|opencode|openclaw)')
242
+ .requiredOption('--input <path>', 'Input export file or directory')
243
+ .option('--from <date>', 'Start date (YYYY-MM-DD)')
244
+ .option('--to <date>', 'End date (YYYY-MM-DD)')
245
+ .option('--dry-run', 'Preview replay candidates without writing')
246
+ .option('-v, --vault <path>', 'Vault path')
247
+ .action(async (options) => {
248
+ try {
249
+ const { replayCommand } = await import('../dist/commands/replay.js');
250
+ await replayCommand({
251
+ source: options.source,
252
+ inputPath: options.input,
253
+ from: options.from,
254
+ to: options.to,
255
+ dryRun: options.dryRun,
256
+ vaultPath: options.vault
257
+ });
258
+ } catch (err) {
259
+ console.error(chalk.red(`Error: ${err.message}`));
260
+ process.exit(1);
261
+ }
262
+ });
263
+
264
+ // === SYNC-BD ===
265
+ program
266
+ .command('sync-bd')
267
+ .description('Sync active Beads tasks into views/now.md (optional)')
268
+ .option('--dry-run', 'Show sync output without writing')
269
+ .option('-v, --vault <path>', 'Vault path')
270
+ .action(async (options) => {
271
+ try {
272
+ const { syncBdCommand } = await import('../dist/commands/sync-bd.js');
273
+ await syncBdCommand({
274
+ vaultPath: options.vault,
275
+ dryRun: options.dryRun
276
+ });
277
+ } catch (err) {
278
+ console.error(chalk.red(`Error: ${err.message}`));
279
+ process.exit(1);
280
+ }
281
+ });
282
+ }