@wundr.io/cli 1.0.0 ā 1.0.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.
- package/README.md +696 -280
- package/dist/ai/ai-service.d.ts +2 -2
- package/dist/ai/ai-service.d.ts.map +1 -1
- package/dist/ai/ai-service.js +1 -1
- package/dist/ai/ai-service.js.map +1 -1
- package/dist/ai/claude-client.d.ts.map +1 -1
- package/dist/ai/claude-client.js +2 -1
- package/dist/ai/claude-client.js.map +1 -1
- package/dist/ai/conversation-manager.d.ts +2 -2
- package/dist/ai/conversation-manager.d.ts.map +1 -1
- package/dist/ai/conversation-manager.js +5 -3
- package/dist/ai/conversation-manager.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +32 -13
- package/dist/cli.js.map +1 -1
- package/dist/commands/ai.d.ts +3 -3
- package/dist/commands/ai.d.ts.map +1 -1
- package/dist/commands/ai.js +2 -2
- package/dist/commands/ai.js.map +1 -1
- package/dist/commands/alignment.d.ts +78 -0
- package/dist/commands/alignment.d.ts.map +1 -0
- package/dist/commands/alignment.js +817 -0
- package/dist/commands/alignment.js.map +1 -0
- package/dist/commands/analyze-optimized.d.ts.map +1 -1
- package/dist/commands/analyze-optimized.js +9 -6
- package/dist/commands/analyze-optimized.js.map +1 -1
- package/dist/commands/analyze.d.ts +3 -3
- package/dist/commands/analyze.d.ts.map +1 -1
- package/dist/commands/analyze.js +2 -2
- package/dist/commands/analyze.js.map +1 -1
- package/dist/commands/batch.d.ts +3 -3
- package/dist/commands/batch.d.ts.map +1 -1
- package/dist/commands/batch.js +7 -7
- package/dist/commands/batch.js.map +1 -1
- package/dist/commands/chat.d.ts +3 -3
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +3 -3
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/claude-init.d.ts +1 -1
- package/dist/commands/claude-init.d.ts.map +1 -1
- package/dist/commands/claude-init.js +11 -7
- package/dist/commands/claude-init.js.map +1 -1
- package/dist/commands/claude-setup.d.ts +88 -1
- package/dist/commands/claude-setup.d.ts.map +1 -1
- package/dist/commands/claude-setup.js +549 -46
- package/dist/commands/claude-setup.js.map +1 -1
- package/dist/commands/computer-setup-commands.d.ts +17 -3
- package/dist/commands/computer-setup-commands.d.ts.map +1 -1
- package/dist/commands/computer-setup-commands.js +145 -3
- package/dist/commands/computer-setup-commands.js.map +1 -1
- package/dist/commands/computer-setup.d.ts.map +1 -1
- package/dist/commands/computer-setup.js +372 -4
- package/dist/commands/computer-setup.js.map +1 -1
- package/dist/commands/create-command.d.ts.map +1 -1
- package/dist/commands/create-command.js +3 -3
- package/dist/commands/create-command.js.map +1 -1
- package/dist/commands/create.d.ts +3 -3
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +3 -3
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dashboard.d.ts +3 -3
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dashboard.js +4 -3
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/govern.d.ts +3 -3
- package/dist/commands/govern.d.ts.map +1 -1
- package/dist/commands/govern.js +4 -3
- package/dist/commands/govern.js.map +1 -1
- package/dist/commands/governance.d.ts +17 -0
- package/dist/commands/governance.d.ts.map +1 -0
- package/dist/commands/governance.js +703 -0
- package/dist/commands/governance.js.map +1 -0
- package/dist/commands/guardian.d.ts +20 -0
- package/dist/commands/guardian.d.ts.map +1 -0
- package/dist/commands/guardian.js +597 -0
- package/dist/commands/guardian.js.map +1 -0
- package/dist/commands/init.d.ts +7 -3
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +71 -5
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/performance-optimizer.d.ts +2 -2
- package/dist/commands/performance-optimizer.d.ts.map +1 -1
- package/dist/commands/performance-optimizer.js +8 -7
- package/dist/commands/performance-optimizer.js.map +1 -1
- package/dist/commands/plugins.d.ts +3 -3
- package/dist/commands/plugins.d.ts.map +1 -1
- package/dist/commands/plugins.js +2 -2
- package/dist/commands/plugins.js.map +1 -1
- package/dist/commands/rag.d.ts +7 -0
- package/dist/commands/rag.d.ts.map +1 -0
- package/dist/commands/rag.js +748 -0
- package/dist/commands/rag.js.map +1 -0
- package/dist/commands/session.d.ts +41 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +441 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/setup.d.ts +3 -3
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +1 -3
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/test-init.d.ts.map +1 -1
- package/dist/commands/test-init.js +2 -2
- package/dist/commands/test-init.js.map +1 -1
- package/dist/commands/test.d.ts.map +1 -1
- package/dist/commands/test.js +2 -2
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/vp.d.ts +7 -0
- package/dist/commands/vp.d.ts.map +1 -0
- package/dist/commands/vp.js +571 -0
- package/dist/commands/vp.js.map +1 -0
- package/dist/commands/watch.d.ts +3 -3
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +10 -7
- package/dist/commands/watch.js.map +1 -1
- package/dist/commands/worktree.d.ts +63 -0
- package/dist/commands/worktree.d.ts.map +1 -0
- package/dist/commands/worktree.js +774 -0
- package/dist/commands/worktree.js.map +1 -0
- package/dist/context/context-manager.d.ts +1 -1
- package/dist/context/context-manager.d.ts.map +1 -1
- package/dist/context/context-manager.js +1 -1
- package/dist/context/context-manager.js.map +1 -1
- package/dist/context/session-manager.d.ts +2 -2
- package/dist/context/session-manager.d.ts.map +1 -1
- package/dist/context/session-manager.js +9 -5
- package/dist/context/session-manager.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interactive/interactive-mode.d.ts +2 -2
- package/dist/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/interactive/interactive-mode.js +6 -4
- package/dist/interactive/interactive-mode.js.map +1 -1
- package/dist/nlp/command-mapper.d.ts +1 -1
- package/dist/nlp/command-mapper.d.ts.map +1 -1
- package/dist/nlp/command-mapper.js +3 -2
- package/dist/nlp/command-mapper.js.map +1 -1
- package/dist/nlp/command-parser.d.ts +1 -1
- package/dist/nlp/command-parser.d.ts.map +1 -1
- package/dist/nlp/command-parser.js +2 -1
- package/dist/nlp/command-parser.js.map +1 -1
- package/dist/nlp/intent-parser.d.ts +1 -1
- package/dist/nlp/intent-parser.d.ts.map +1 -1
- package/dist/nlp/intent-parser.js +14 -9
- package/dist/nlp/intent-parser.js.map +1 -1
- package/dist/plugins/plugin-manager.d.ts +2 -2
- package/dist/plugins/plugin-manager.d.ts.map +1 -1
- package/dist/plugins/plugin-manager.js +3 -3
- package/dist/plugins/plugin-manager.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/backup-rollback-manager.d.ts +72 -0
- package/dist/utils/backup-rollback-manager.d.ts.map +1 -0
- package/dist/utils/backup-rollback-manager.js +289 -0
- package/dist/utils/backup-rollback-manager.js.map +1 -0
- package/dist/utils/claude-config-installer.d.ts +94 -0
- package/dist/utils/claude-config-installer.d.ts.map +1 -0
- package/dist/utils/claude-config-installer.js +628 -0
- package/dist/utils/claude-config-installer.js.map +1 -0
- package/dist/utils/config-manager.d.ts +1 -1
- package/dist/utils/config-manager.d.ts.map +1 -1
- package/dist/utils/config-manager.js +5 -5
- package/dist/utils/config-manager.js.map +1 -1
- package/dist/utils/error-handler.d.ts +1 -1
- package/dist/utils/error-handler.d.ts.map +1 -1
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/logger.d.ts +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +22 -11
- package/dist/utils/logger.js.map +1 -1
- package/package.json +26 -7
- package/src/ai/ai-service.ts +22 -19
- package/src/ai/claude-client.ts +20 -16
- package/src/ai/conversation-manager.ts +37 -30
- package/src/cli.ts +42 -13
- package/src/commands/ai.ts +59 -57
- package/src/commands/alignment.ts +1212 -0
- package/src/commands/analyze-optimized.ts +70 -62
- package/src/commands/analyze.ts +22 -20
- package/src/commands/batch.ts +41 -38
- package/src/commands/chat.ts +37 -34
- package/src/commands/claude-init.ts +38 -30
- package/src/commands/claude-setup.ts +692 -97
- package/src/commands/computer-setup-commands.ts +203 -37
- package/src/commands/computer-setup.ts +474 -4
- package/src/commands/create-command.ts +7 -7
- package/src/commands/create.ts +36 -33
- package/src/commands/dashboard.ts +33 -28
- package/src/commands/govern.ts +34 -29
- package/src/commands/governance.ts +1005 -0
- package/src/commands/guardian.ts +887 -0
- package/src/commands/init.ts +112 -22
- package/src/commands/performance-optimizer.ts +48 -42
- package/src/commands/plugins.ts +35 -32
- package/src/commands/project-update.ts +1053 -0
- package/src/commands/rag.ts +904 -0
- package/src/commands/session.ts +631 -0
- package/src/commands/setup.ts +35 -31
- package/src/commands/test-init.ts +6 -5
- package/src/commands/test.ts +7 -6
- package/src/commands/vp.ts +762 -0
- package/src/commands/watch.ts +44 -33
- package/src/commands/worktree.ts +1057 -0
- package/src/context/context-manager.ts +15 -12
- package/src/context/session-manager.ts +51 -40
- package/src/index.ts +7 -6
- package/src/interactive/interactive-mode.ts +25 -18
- package/src/lib/conflict-resolution.ts +28 -0
- package/src/lib/merge-strategy.ts +28 -0
- package/src/lib/safety-mechanisms.ts +47 -0
- package/src/lib/state-detection.ts +28 -0
- package/src/nlp/command-mapper.ts +35 -30
- package/src/nlp/command-parser.ts +20 -17
- package/src/nlp/intent-classifier.ts +7 -7
- package/src/nlp/intent-parser.ts +61 -49
- package/src/plugins/plugin-manager.ts +27 -23
- package/src/tests/computer-setup-integration.test.ts +439 -0
- package/src/types/index.ts +1 -1
- package/src/types/modules.d.ts +1 -0
- package/src/utils/backup-rollback-manager.ts +363 -0
- package/src/utils/claude-config-installer.ts +734 -0
- package/src/utils/config-manager.ts +12 -9
- package/src/utils/error-handler.ts +5 -3
- package/src/utils/logger.ts +35 -12
|
@@ -3,25 +3,33 @@
|
|
|
3
3
|
* Integrates real setup orchestrator for provisioning developer machines
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { execSync } from 'child_process';
|
|
7
|
+
import * as fs from 'fs/promises';
|
|
8
|
+
import * as os from 'os';
|
|
9
|
+
|
|
7
10
|
import chalk from 'chalk';
|
|
8
|
-
import ora from 'ora';
|
|
9
11
|
import inquirer from 'inquirer';
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
+
import ora from 'ora';
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
RealSetupOrchestrator,
|
|
16
|
+
} from '../../../computer-setup/dist';
|
|
17
|
+
import { BackupRollbackManager } from '../utils/backup-rollback-manager';
|
|
18
|
+
import { ClaudeConfigInstaller } from '../utils/claude-config-installer';
|
|
12
19
|
import { logger } from '../utils/logger';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import * as fs from 'fs/promises';
|
|
20
|
+
|
|
21
|
+
|
|
16
22
|
// Note: Using relative path import due to workspace resolution issues in this monorepo setup
|
|
17
23
|
// The computer-setup package must be built first before building this CLI package
|
|
18
|
-
import {
|
|
24
|
+
import type {
|
|
19
25
|
SetupPlatform,
|
|
20
26
|
SetupProgress,
|
|
21
27
|
SetupResult,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} from '
|
|
28
|
+
DeveloperProfile} from '../../../computer-setup/dist';
|
|
29
|
+
import type { PluginManager } from '../plugins/plugin-manager';
|
|
30
|
+
import type { ConfigManager } from '../utils/config-manager';
|
|
31
|
+
import type { Command } from 'commander';
|
|
32
|
+
|
|
25
33
|
|
|
26
34
|
// Additional local types
|
|
27
35
|
interface LocalSetupOptions {
|
|
@@ -38,14 +46,18 @@ interface LocalSetupOptions {
|
|
|
38
46
|
export class ComputerSetupCommands {
|
|
39
47
|
private orchestrator: RealSetupOrchestrator;
|
|
40
48
|
private platform: SetupPlatform;
|
|
49
|
+
private backupManager: BackupRollbackManager;
|
|
50
|
+
private claudeInstaller: ClaudeConfigInstaller;
|
|
41
51
|
|
|
42
52
|
constructor(
|
|
43
53
|
private program: Command,
|
|
44
54
|
private configManager: ConfigManager,
|
|
45
|
-
private pluginManager: PluginManager
|
|
55
|
+
private pluginManager: PluginManager,
|
|
46
56
|
) {
|
|
47
57
|
this.platform = this.detectPlatform();
|
|
48
58
|
this.orchestrator = new RealSetupOrchestrator(this.platform);
|
|
59
|
+
this.backupManager = new BackupRollbackManager();
|
|
60
|
+
this.claudeInstaller = new ClaudeConfigInstaller();
|
|
49
61
|
this.registerCommands();
|
|
50
62
|
}
|
|
51
63
|
|
|
@@ -55,7 +67,7 @@ export class ComputerSetupCommands {
|
|
|
55
67
|
.alias('setup-machine')
|
|
56
68
|
.alias('provision')
|
|
57
69
|
.description(
|
|
58
|
-
'Set up a new developer machine with all required tools and configurations'
|
|
70
|
+
'Set up a new developer machine with all required tools and configurations',
|
|
59
71
|
)
|
|
60
72
|
.addHelpText(
|
|
61
73
|
'after',
|
|
@@ -66,7 +78,7 @@ Examples:
|
|
|
66
78
|
${chalk.green('wundr computer-setup --team platform')} Apply platform team configuration
|
|
67
79
|
${chalk.green('wundr computer-setup doctor')} Diagnose setup issues
|
|
68
80
|
${chalk.green('wundr computer-setup validate')} Validate current setup
|
|
69
|
-
`)
|
|
81
|
+
`),
|
|
70
82
|
);
|
|
71
83
|
|
|
72
84
|
// Main setup command
|
|
@@ -75,14 +87,14 @@ Examples:
|
|
|
75
87
|
.description('Run computer setup for new developer machine')
|
|
76
88
|
.option(
|
|
77
89
|
'-p, --profile <profile>',
|
|
78
|
-
'Use specific profile (frontend, backend, fullstack, devops)'
|
|
90
|
+
'Use specific profile (frontend, backend, fullstack, devops)',
|
|
79
91
|
)
|
|
80
92
|
.option('-t, --team <team>', 'Apply team-specific configurations')
|
|
81
93
|
.option('-m, --mode <mode>', 'Setup mode', 'interactive')
|
|
82
94
|
.option('--os <os>', 'Target OS (auto-detected by default)')
|
|
83
95
|
.option(
|
|
84
96
|
'--dry-run',
|
|
85
|
-
'Show what would be installed without making changes'
|
|
97
|
+
'Show what would be installed without making changes',
|
|
86
98
|
)
|
|
87
99
|
.option('--skip-existing', 'Skip tools that are already installed')
|
|
88
100
|
.option('--parallel', 'Install tools in parallel where possible')
|
|
@@ -165,6 +177,41 @@ Examples:
|
|
|
165
177
|
.action(async (tool, options) => {
|
|
166
178
|
await this.installTool(tool, options);
|
|
167
179
|
});
|
|
180
|
+
|
|
181
|
+
// Claude Code configuration commands
|
|
182
|
+
computerSetup
|
|
183
|
+
.command('claude-config')
|
|
184
|
+
.description('Install Claude Code configuration')
|
|
185
|
+
.option('--dry-run', 'Show what would be installed')
|
|
186
|
+
.option('--skip-backup', 'Skip backup creation')
|
|
187
|
+
.option('--overwrite', 'Overwrite existing configurations')
|
|
188
|
+
.option('--verbose', 'Show detailed output')
|
|
189
|
+
.action(async options => {
|
|
190
|
+
await this.installClaudeConfig(options);
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
// Backup management commands
|
|
194
|
+
computerSetup
|
|
195
|
+
.command('backup')
|
|
196
|
+
.description('Manage configuration backups')
|
|
197
|
+
.option('-l, --list', 'List all backups')
|
|
198
|
+
.option('-c, --create', 'Create new backup')
|
|
199
|
+
.option('-v, --verify <id>', 'Verify backup integrity')
|
|
200
|
+
.option('--cleanup', 'Clean up old backups')
|
|
201
|
+
.action(async options => {
|
|
202
|
+
await this.manageBackups(options);
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
// Rollback command
|
|
206
|
+
computerSetup
|
|
207
|
+
.command('rollback')
|
|
208
|
+
.description('Restore from backup')
|
|
209
|
+
.option('--backup <id>', 'Specific backup to restore')
|
|
210
|
+
.option('--dry-run', 'Show what would be restored')
|
|
211
|
+
.option('--verbose', 'Show detailed output')
|
|
212
|
+
.action(async options => {
|
|
213
|
+
await this.rollbackConfiguration(options);
|
|
214
|
+
});
|
|
168
215
|
}
|
|
169
216
|
|
|
170
217
|
private async runSetup(options: any): Promise<void> {
|
|
@@ -202,24 +249,24 @@ Examples:
|
|
|
202
249
|
// Validate profile
|
|
203
250
|
const availableProfiles = this.orchestrator.getAvailableProfiles();
|
|
204
251
|
const profile = availableProfiles.find(p =>
|
|
205
|
-
p.name.toLowerCase().includes(profileName.toLowerCase())
|
|
252
|
+
p.name.toLowerCase().includes(profileName.toLowerCase()),
|
|
206
253
|
);
|
|
207
254
|
|
|
208
255
|
if (!profile) {
|
|
209
256
|
console.error(chalk.red(`ā Unknown profile: ${profileName}`));
|
|
210
257
|
console.log(chalk.cyan('\nAvailable profiles:'));
|
|
211
258
|
availableProfiles.forEach(p =>
|
|
212
|
-
console.log(` ⢠${p.name}: ${p.description}`)
|
|
259
|
+
console.log(` ⢠${p.name}: ${p.description}`),
|
|
213
260
|
);
|
|
214
261
|
return;
|
|
215
262
|
}
|
|
216
263
|
|
|
217
264
|
console.log(
|
|
218
|
-
chalk.cyan(`\nš Selected Profile: ${chalk.white(profile.name)}`)
|
|
265
|
+
chalk.cyan(`\nš Selected Profile: ${chalk.white(profile.name)}`),
|
|
219
266
|
);
|
|
220
267
|
console.log(chalk.gray(`${profile.description}`));
|
|
221
268
|
console.log(
|
|
222
|
-
chalk.gray(`Estimated time: ${profile.estimatedTimeMinutes} minutes\n`)
|
|
269
|
+
chalk.gray(`Estimated time: ${profile.estimatedTimeMinutes} minutes\n`),
|
|
223
270
|
);
|
|
224
271
|
|
|
225
272
|
// Show what will be installed
|
|
@@ -259,7 +306,7 @@ Examples:
|
|
|
259
306
|
process.stdout.clearLine(0);
|
|
260
307
|
process.stdout.cursorTo(0);
|
|
261
308
|
process.stdout.write(
|
|
262
|
-
`${chalk.cyan('[')}${progress.percentage.toFixed(1)}%${chalk.cyan(']')} ${progress.currentStep}
|
|
309
|
+
`${chalk.cyan('[')}${progress.percentage.toFixed(1)}%${chalk.cyan(']')} ${progress.currentStep}`,
|
|
263
310
|
);
|
|
264
311
|
};
|
|
265
312
|
|
|
@@ -273,7 +320,7 @@ Examples:
|
|
|
273
320
|
parallel: options.parallel,
|
|
274
321
|
generateReport: options.report,
|
|
275
322
|
},
|
|
276
|
-
progressCallback
|
|
323
|
+
progressCallback,
|
|
277
324
|
);
|
|
278
325
|
|
|
279
326
|
console.log('\n'); // New line after progress
|
|
@@ -282,13 +329,13 @@ Examples:
|
|
|
282
329
|
console.log(chalk.green('ā
Computer setup completed successfully!'));
|
|
283
330
|
console.log(
|
|
284
331
|
chalk.gray(
|
|
285
|
-
`Setup took ${Math.round(result.duration / 1000)} seconds\n
|
|
286
|
-
)
|
|
332
|
+
`Setup took ${Math.round(result.duration / 1000)} seconds\n`,
|
|
333
|
+
),
|
|
287
334
|
);
|
|
288
335
|
|
|
289
336
|
if (result.completedSteps.length > 0) {
|
|
290
337
|
console.log(
|
|
291
|
-
chalk.cyan(`šÆ Completed steps (${result.completedSteps.length}):`)
|
|
338
|
+
chalk.cyan(`šÆ Completed steps (${result.completedSteps.length}):`),
|
|
292
339
|
);
|
|
293
340
|
result.completedSteps
|
|
294
341
|
.slice(0, 5)
|
|
@@ -300,7 +347,7 @@ Examples:
|
|
|
300
347
|
|
|
301
348
|
if (result.skippedSteps.length > 0) {
|
|
302
349
|
console.log(
|
|
303
|
-
chalk.yellow(`āļø Skipped steps (${result.skippedSteps.length}):`)
|
|
350
|
+
chalk.yellow(`āļø Skipped steps (${result.skippedSteps.length}):`),
|
|
304
351
|
);
|
|
305
352
|
result.skippedSteps.forEach(step => console.log(` āļø ${step}`));
|
|
306
353
|
}
|
|
@@ -311,7 +358,7 @@ Examples:
|
|
|
311
358
|
|
|
312
359
|
if (result.failedSteps.length > 0) {
|
|
313
360
|
console.log(
|
|
314
|
-
chalk.red(`Failed steps (${result.failedSteps.length}):`)
|
|
361
|
+
chalk.red(`Failed steps (${result.failedSteps.length}):`),
|
|
315
362
|
);
|
|
316
363
|
result.failedSteps.forEach(step => console.log(` ā ${step}`));
|
|
317
364
|
}
|
|
@@ -323,8 +370,8 @@ Examples:
|
|
|
323
370
|
|
|
324
371
|
console.log(
|
|
325
372
|
chalk.cyan(
|
|
326
|
-
'\nš” You can resume setup by running: wundr computer-setup resume'
|
|
327
|
-
)
|
|
373
|
+
'\nš” You can resume setup by running: wundr computer-setup resume',
|
|
374
|
+
),
|
|
328
375
|
);
|
|
329
376
|
process.exit(1);
|
|
330
377
|
}
|
|
@@ -332,8 +379,8 @@ Examples:
|
|
|
332
379
|
console.error(chalk.red('\nā Setup failed with error:'), error);
|
|
333
380
|
console.log(
|
|
334
381
|
chalk.cyan(
|
|
335
|
-
'\nš” You can resume setup by running: wundr computer-setup resume'
|
|
336
|
-
)
|
|
382
|
+
'\nš” You can resume setup by running: wundr computer-setup resume',
|
|
383
|
+
),
|
|
337
384
|
);
|
|
338
385
|
process.exit(1);
|
|
339
386
|
}
|
|
@@ -540,7 +587,7 @@ Examples:
|
|
|
540
587
|
process.stdout.clearLine(0);
|
|
541
588
|
process.stdout.cursorTo(0);
|
|
542
589
|
process.stdout.write(
|
|
543
|
-
`${chalk.cyan('[')}${progress.percentage.toFixed(1)}%${chalk.cyan(']')} ${progress.currentStep}
|
|
590
|
+
`${chalk.cyan('[')}${progress.percentage.toFixed(1)}%${chalk.cyan(']')} ${progress.currentStep}`,
|
|
544
591
|
);
|
|
545
592
|
};
|
|
546
593
|
|
|
@@ -550,7 +597,7 @@ Examples:
|
|
|
550
597
|
|
|
551
598
|
if (result.success) {
|
|
552
599
|
console.log(
|
|
553
|
-
chalk.green('ā
Setup resumed and completed successfully!')
|
|
600
|
+
chalk.green('ā
Setup resumed and completed successfully!'),
|
|
554
601
|
);
|
|
555
602
|
this.displayNextSteps();
|
|
556
603
|
} else {
|
|
@@ -575,20 +622,20 @@ Examples:
|
|
|
575
622
|
console.log(chalk.white(`š ${profile.name}`));
|
|
576
623
|
console.log(chalk.gray(` ${profile.description}`));
|
|
577
624
|
console.log(
|
|
578
|
-
chalk.gray(` Categories: ${profile.categories.join(', ')}`)
|
|
625
|
+
chalk.gray(` Categories: ${profile.categories.join(', ')}`),
|
|
579
626
|
);
|
|
580
627
|
console.log(chalk.gray(` Tools: ${profile.requiredTools.join(', ')}`));
|
|
581
628
|
console.log(
|
|
582
|
-
chalk.gray(` Estimated time: ${profile.estimatedTimeMinutes} minutes`)
|
|
629
|
+
chalk.gray(` Estimated time: ${profile.estimatedTimeMinutes} minutes`),
|
|
583
630
|
);
|
|
584
631
|
console.log();
|
|
585
632
|
});
|
|
586
633
|
|
|
587
634
|
console.log(
|
|
588
|
-
chalk.cyan('Usage: wundr computer-setup --profile <profile-name>')
|
|
635
|
+
chalk.cyan('Usage: wundr computer-setup --profile <profile-name>'),
|
|
589
636
|
);
|
|
590
637
|
console.log(
|
|
591
|
-
chalk.gray('Example: wundr computer-setup --profile frontend\n')
|
|
638
|
+
chalk.gray('Example: wundr computer-setup --profile frontend\n'),
|
|
592
639
|
);
|
|
593
640
|
}
|
|
594
641
|
|
|
@@ -706,4 +753,123 @@ Examples:
|
|
|
706
753
|
console.log(chalk.gray(` Fixing ${failure.name}...`));
|
|
707
754
|
}
|
|
708
755
|
}
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* Install Claude Code configuration
|
|
759
|
+
*/
|
|
760
|
+
private async installClaudeConfig(options: any): Promise<void> {
|
|
761
|
+
console.log(chalk.cyan('\nš§ Claude Code Configuration Installer\n'));
|
|
762
|
+
|
|
763
|
+
try {
|
|
764
|
+
// Initialize managers
|
|
765
|
+
await this.backupManager.initialize();
|
|
766
|
+
await this.claudeInstaller.initialize();
|
|
767
|
+
|
|
768
|
+
// Install configurations
|
|
769
|
+
const result = await this.claudeInstaller.install({
|
|
770
|
+
dryRun: options.dryRun,
|
|
771
|
+
skipBackup: options.skipBackup,
|
|
772
|
+
overwrite: options.overwrite,
|
|
773
|
+
verbose: options.verbose,
|
|
774
|
+
});
|
|
775
|
+
|
|
776
|
+
if (!result.success) {
|
|
777
|
+
process.exit(1);
|
|
778
|
+
}
|
|
779
|
+
} catch (error) {
|
|
780
|
+
console.error(chalk.red('ā Installation failed:'), error);
|
|
781
|
+
logger.error('Claude config installation failed', error);
|
|
782
|
+
process.exit(1);
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
/**
|
|
787
|
+
* Manage backups
|
|
788
|
+
*/
|
|
789
|
+
private async manageBackups(options: any): Promise<void> {
|
|
790
|
+
await this.backupManager.initialize();
|
|
791
|
+
|
|
792
|
+
if (options.list) {
|
|
793
|
+
const backups = await this.backupManager.listBackups();
|
|
794
|
+
|
|
795
|
+
if (backups.length === 0) {
|
|
796
|
+
console.log(chalk.yellow('No backups found'));
|
|
797
|
+
return;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
console.log(chalk.cyan('\nš¦ Available Backups\n'));
|
|
801
|
+
backups.forEach(backup => {
|
|
802
|
+
const date = new Date(backup.timestamp).toLocaleString();
|
|
803
|
+
const status = backup.success
|
|
804
|
+
? chalk.green('ā
Success')
|
|
805
|
+
: chalk.red('ā Failed');
|
|
806
|
+
|
|
807
|
+
console.log(chalk.white(`ID: ${backup.backupId}`));
|
|
808
|
+
console.log(chalk.gray(` Date: ${date}`));
|
|
809
|
+
console.log(chalk.gray(` Reason: ${backup.reason}`));
|
|
810
|
+
console.log(chalk.gray(` Status: ${status}`));
|
|
811
|
+
console.log(chalk.gray(` Files: ${backup.files.length}`));
|
|
812
|
+
console.log();
|
|
813
|
+
});
|
|
814
|
+
} else if (options.create) {
|
|
815
|
+
const { files } = await inquirer.prompt([
|
|
816
|
+
{
|
|
817
|
+
type: 'input',
|
|
818
|
+
name: 'files',
|
|
819
|
+
message: 'Enter file paths (comma-separated):',
|
|
820
|
+
validate: input => input.length > 0,
|
|
821
|
+
},
|
|
822
|
+
]);
|
|
823
|
+
|
|
824
|
+
const fileList = files.split(',').map((f: string) => f.trim());
|
|
825
|
+
const backup = await this.backupManager.createBackup(
|
|
826
|
+
fileList,
|
|
827
|
+
'Manual backup',
|
|
828
|
+
);
|
|
829
|
+
|
|
830
|
+
this.backupManager.displayBackupInfo(backup);
|
|
831
|
+
} else if (options.verify) {
|
|
832
|
+
const isValid = await this.backupManager.verifyBackup(options.verify);
|
|
833
|
+
|
|
834
|
+
if (isValid) {
|
|
835
|
+
console.log(chalk.green(`ā
Backup ${options.verify} is valid`));
|
|
836
|
+
} else {
|
|
837
|
+
console.log(chalk.red(`ā Backup ${options.verify} is invalid`));
|
|
838
|
+
process.exit(1);
|
|
839
|
+
}
|
|
840
|
+
} else if (options.cleanup) {
|
|
841
|
+
await this.backupManager.cleanupOldBackups();
|
|
842
|
+
console.log(chalk.green('ā
Old backups cleaned up'));
|
|
843
|
+
} else {
|
|
844
|
+
console.log(chalk.yellow('Please specify an option. Use --help for details.'));
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* Rollback configuration
|
|
850
|
+
*/
|
|
851
|
+
private async rollbackConfiguration(options: any): Promise<void> {
|
|
852
|
+
console.log(chalk.cyan('\nš Configuration Rollback\n'));
|
|
853
|
+
|
|
854
|
+
await this.backupManager.initialize();
|
|
855
|
+
|
|
856
|
+
const success = await this.backupManager.rollback({
|
|
857
|
+
backupId: options.backup,
|
|
858
|
+
dryRun: options.dryRun,
|
|
859
|
+
verbose: options.verbose,
|
|
860
|
+
});
|
|
861
|
+
|
|
862
|
+
if (!success) {
|
|
863
|
+
console.log(chalk.red('\nā Rollback failed'));
|
|
864
|
+
process.exit(1);
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
if (!options.dryRun) {
|
|
868
|
+
console.log(chalk.green('\nā
Rollback completed successfully'));
|
|
869
|
+
console.log(chalk.cyan('\nNext steps:'));
|
|
870
|
+
console.log(chalk.white(' 1. Verify restored configurations'));
|
|
871
|
+
console.log(chalk.white(' 2. Restart terminal if needed'));
|
|
872
|
+
console.log(chalk.white(' 3. Run validation script'));
|
|
873
|
+
}
|
|
874
|
+
}
|
|
709
875
|
}
|