@wundr.io/cli 1.0.11 ā 1.0.12
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/bin/wundr.js +8 -4
- package/package.json +23 -23
- package/src/ai/ai-service.ts +16 -17
- package/src/ai/claude-client.ts +16 -16
- package/src/ai/conversation-manager.ts +29 -29
- package/src/cli.ts +4 -4
- package/src/commands/ai.ts +246 -78
- package/src/commands/alignment.ts +74 -74
- package/src/commands/analyze-optimized.ts +111 -78
- package/src/commands/analyze.ts +14 -14
- package/src/commands/batch.ts +179 -42
- package/src/commands/chat.ts +37 -30
- package/src/commands/claude-init.ts +41 -45
- package/src/commands/claude-setup.ts +204 -119
- package/src/commands/computer-setup.ts +85 -43
- package/src/commands/create-command.ts +4 -4
- package/src/commands/create.ts +27 -27
- package/src/commands/dashboard.ts +24 -24
- package/src/commands/govern.ts +25 -25
- package/src/commands/governance.ts +34 -34
- package/src/commands/guardian.ts +56 -56
- package/src/commands/init.ts +25 -22
- package/src/commands/orchestrator.ts +68 -41
- package/src/commands/performance-optimizer.ts +34 -35
- package/src/commands/plugins.ts +27 -27
- package/src/commands/project-update.ts +175 -72
- package/src/commands/rag.ts +185 -78
- package/src/commands/session.ts +35 -35
- package/src/commands/setup.ts +40 -344
- package/src/commands/test-init.ts +3 -3
- package/src/commands/test.ts +4 -4
- package/src/commands/watch.ts +28 -29
- package/src/commands/worktree.ts +49 -49
- package/src/context/context-manager.ts +10 -10
- package/src/context/session-manager.ts +41 -41
- package/src/framework/command-interface.ts +520 -0
- package/src/framework/command-registry.ts +942 -0
- package/src/framework/completion-exporter.ts +383 -0
- package/src/framework/debug-logger.ts +519 -0
- package/src/framework/error-handler.ts +867 -0
- package/src/framework/help-generator.ts +540 -0
- package/src/framework/index.ts +169 -0
- package/src/framework/interactive-repl.ts +703 -0
- package/src/framework/output-formatter.ts +834 -0
- package/src/framework/progress-manager.ts +539 -0
- package/src/index.ts +4 -4
- package/src/interactive/interactive-mode.ts +16 -16
- package/src/lib/conflict-resolution.ts +799 -9
- package/src/lib/merge-strategy.ts +529 -7
- package/src/lib/safety-mechanisms.ts +422 -18
- package/src/lib/state-detection.ts +1015 -13
- package/src/nlp/command-mapper.ts +29 -29
- package/src/nlp/command-parser.ts +17 -17
- package/src/nlp/intent-classifier.ts +7 -7
- package/src/nlp/intent-parser.ts +54 -52
- package/src/plugins/plugin-manager.ts +61 -39
- package/src/tests/computer-setup-integration.test.ts +46 -15
- package/src/types/modules.d.ts +424 -1
- package/src/utils/backup-rollback-manager.ts +11 -8
- package/src/utils/config-manager.ts +3 -3
- package/src/utils/error-handler.ts +2 -2
- package/src/utils/logger.ts +22 -22
- package/templates/batch/ci-cd.yaml +7 -7
- package/test-suites/api/health.spec.ts +20 -23
- package/test-suites/helpers/test-config.ts +14 -13
- package/test-suites/ui/accessibility.spec.ts +27 -22
- package/test-suites/ui/smoke.spec.ts +26 -21
- package/LICENSE +0 -21
- package/dist/ai/ai-service.d.ts +0 -152
- package/dist/ai/ai-service.d.ts.map +0 -1
- package/dist/ai/ai-service.js +0 -430
- package/dist/ai/ai-service.js.map +0 -1
- package/dist/ai/claude-client.d.ts +0 -130
- package/dist/ai/claude-client.d.ts.map +0 -1
- package/dist/ai/claude-client.js +0 -340
- package/dist/ai/claude-client.js.map +0 -1
- package/dist/ai/conversation-manager.d.ts +0 -164
- package/dist/ai/conversation-manager.d.ts.map +0 -1
- package/dist/ai/conversation-manager.js +0 -614
- package/dist/ai/conversation-manager.js.map +0 -1
- package/dist/ai/index.d.ts +0 -5
- package/dist/ai/index.d.ts.map +0 -1
- package/dist/ai/index.js +0 -8
- package/dist/ai/index.js.map +0 -1
- package/dist/cli.d.ts +0 -36
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -192
- package/dist/cli.js.map +0 -1
- package/dist/commands/ai.d.ts +0 -89
- package/dist/commands/ai.d.ts.map +0 -1
- package/dist/commands/ai.js +0 -799
- package/dist/commands/ai.js.map +0 -1
- package/dist/commands/alignment.d.ts +0 -78
- package/dist/commands/alignment.d.ts.map +0 -1
- package/dist/commands/alignment.js +0 -817
- package/dist/commands/alignment.js.map +0 -1
- package/dist/commands/analyze-optimized.d.ts +0 -14
- package/dist/commands/analyze-optimized.d.ts.map +0 -1
- package/dist/commands/analyze-optimized.js +0 -600
- package/dist/commands/analyze-optimized.js.map +0 -1
- package/dist/commands/analyze.d.ts +0 -65
- package/dist/commands/analyze.d.ts.map +0 -1
- package/dist/commands/analyze.js +0 -435
- package/dist/commands/analyze.js.map +0 -1
- package/dist/commands/batch.d.ts +0 -71
- package/dist/commands/batch.d.ts.map +0 -1
- package/dist/commands/batch.js +0 -738
- package/dist/commands/batch.js.map +0 -1
- package/dist/commands/chat.d.ts +0 -71
- package/dist/commands/chat.d.ts.map +0 -1
- package/dist/commands/chat.js +0 -674
- package/dist/commands/chat.js.map +0 -1
- package/dist/commands/claude-init.d.ts +0 -28
- package/dist/commands/claude-init.d.ts.map +0 -1
- package/dist/commands/claude-init.js +0 -591
- package/dist/commands/claude-init.js.map +0 -1
- package/dist/commands/claude-setup.d.ts +0 -119
- package/dist/commands/claude-setup.d.ts.map +0 -1
- package/dist/commands/claude-setup.js +0 -1073
- package/dist/commands/claude-setup.js.map +0 -1
- package/dist/commands/computer-setup-commands.d.ts +0 -53
- package/dist/commands/computer-setup-commands.d.ts.map +0 -1
- package/dist/commands/computer-setup-commands.js +0 -705
- package/dist/commands/computer-setup-commands.js.map +0 -1
- package/dist/commands/computer-setup.d.ts +0 -7
- package/dist/commands/computer-setup.d.ts.map +0 -1
- package/dist/commands/computer-setup.js +0 -849
- package/dist/commands/computer-setup.js.map +0 -1
- package/dist/commands/create-command.d.ts +0 -7
- package/dist/commands/create-command.d.ts.map +0 -1
- package/dist/commands/create-command.js +0 -158
- package/dist/commands/create-command.js.map +0 -1
- package/dist/commands/create.d.ts +0 -74
- package/dist/commands/create.d.ts.map +0 -1
- package/dist/commands/create.js +0 -556
- package/dist/commands/create.js.map +0 -1
- package/dist/commands/dashboard.d.ts +0 -91
- package/dist/commands/dashboard.d.ts.map +0 -1
- package/dist/commands/dashboard.js +0 -538
- package/dist/commands/dashboard.js.map +0 -1
- package/dist/commands/govern.d.ts +0 -70
- package/dist/commands/govern.d.ts.map +0 -1
- package/dist/commands/govern.js +0 -481
- package/dist/commands/govern.js.map +0 -1
- package/dist/commands/governance.d.ts +0 -17
- package/dist/commands/governance.d.ts.map +0 -1
- package/dist/commands/governance.js +0 -703
- package/dist/commands/governance.js.map +0 -1
- package/dist/commands/guardian.d.ts +0 -20
- package/dist/commands/guardian.d.ts.map +0 -1
- package/dist/commands/guardian.js +0 -597
- package/dist/commands/guardian.js.map +0 -1
- package/dist/commands/init.d.ts +0 -59
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -650
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/orchestrator.d.ts +0 -7
- package/dist/commands/orchestrator.d.ts.map +0 -1
- package/dist/commands/orchestrator.js +0 -571
- package/dist/commands/orchestrator.js.map +0 -1
- package/dist/commands/performance-optimizer.d.ts +0 -30
- package/dist/commands/performance-optimizer.d.ts.map +0 -1
- package/dist/commands/performance-optimizer.js +0 -650
- package/dist/commands/performance-optimizer.js.map +0 -1
- package/dist/commands/plugins.d.ts +0 -87
- package/dist/commands/plugins.d.ts.map +0 -1
- package/dist/commands/plugins.js +0 -685
- package/dist/commands/plugins.js.map +0 -1
- package/dist/commands/rag.d.ts +0 -7
- package/dist/commands/rag.d.ts.map +0 -1
- package/dist/commands/rag.js +0 -748
- package/dist/commands/rag.js.map +0 -1
- package/dist/commands/session.d.ts +0 -41
- package/dist/commands/session.d.ts.map +0 -1
- package/dist/commands/session.js +0 -441
- package/dist/commands/session.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -29
- package/dist/commands/setup.d.ts.map +0 -1
- package/dist/commands/setup.js +0 -397
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/test-init.d.ts +0 -9
- package/dist/commands/test-init.d.ts.map +0 -1
- package/dist/commands/test-init.js +0 -222
- package/dist/commands/test-init.js.map +0 -1
- package/dist/commands/test.d.ts +0 -25
- package/dist/commands/test.d.ts.map +0 -1
- package/dist/commands/test.js +0 -217
- package/dist/commands/test.js.map +0 -1
- package/dist/commands/vp.d.ts +0 -7
- package/dist/commands/vp.d.ts.map +0 -1
- package/dist/commands/vp.js +0 -571
- package/dist/commands/vp.js.map +0 -1
- package/dist/commands/watch.d.ts +0 -76
- package/dist/commands/watch.d.ts.map +0 -1
- package/dist/commands/watch.js +0 -613
- package/dist/commands/watch.js.map +0 -1
- package/dist/commands/worktree.d.ts +0 -63
- package/dist/commands/worktree.d.ts.map +0 -1
- package/dist/commands/worktree.js +0 -774
- package/dist/commands/worktree.js.map +0 -1
- package/dist/context/context-manager.d.ts +0 -155
- package/dist/context/context-manager.d.ts.map +0 -1
- package/dist/context/context-manager.js +0 -383
- package/dist/context/context-manager.js.map +0 -1
- package/dist/context/index.d.ts +0 -3
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js +0 -6
- package/dist/context/index.js.map +0 -1
- package/dist/context/session-manager.d.ts +0 -207
- package/dist/context/session-manager.d.ts.map +0 -1
- package/dist/context/session-manager.js +0 -686
- package/dist/context/session-manager.js.map +0 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -51
- package/dist/index.js.map +0 -1
- package/dist/interactive/interactive-mode.d.ts +0 -76
- package/dist/interactive/interactive-mode.d.ts.map +0 -1
- package/dist/interactive/interactive-mode.js +0 -732
- package/dist/interactive/interactive-mode.js.map +0 -1
- package/dist/nlp/command-mapper.d.ts +0 -174
- package/dist/nlp/command-mapper.d.ts.map +0 -1
- package/dist/nlp/command-mapper.js +0 -624
- package/dist/nlp/command-mapper.js.map +0 -1
- package/dist/nlp/command-parser.d.ts +0 -106
- package/dist/nlp/command-parser.d.ts.map +0 -1
- package/dist/nlp/command-parser.js +0 -417
- package/dist/nlp/command-parser.js.map +0 -1
- package/dist/nlp/index.d.ts +0 -5
- package/dist/nlp/index.d.ts.map +0 -1
- package/dist/nlp/index.js +0 -8
- package/dist/nlp/index.js.map +0 -1
- package/dist/nlp/intent-classifier.d.ts +0 -59
- package/dist/nlp/intent-classifier.d.ts.map +0 -1
- package/dist/nlp/intent-classifier.js +0 -384
- package/dist/nlp/intent-classifier.js.map +0 -1
- package/dist/nlp/intent-parser.d.ts +0 -152
- package/dist/nlp/intent-parser.d.ts.map +0 -1
- package/dist/nlp/intent-parser.js +0 -744
- package/dist/nlp/intent-parser.js.map +0 -1
- package/dist/plugins/plugin-manager.d.ts +0 -120
- package/dist/plugins/plugin-manager.d.ts.map +0 -1
- package/dist/plugins/plugin-manager.js +0 -595
- package/dist/plugins/plugin-manager.js.map +0 -1
- package/dist/types/index.d.ts +0 -224
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -3
- package/dist/types/index.js.map +0 -1
- package/dist/utils/backup-rollback-manager.d.ts +0 -72
- package/dist/utils/backup-rollback-manager.d.ts.map +0 -1
- package/dist/utils/backup-rollback-manager.js +0 -289
- package/dist/utils/backup-rollback-manager.js.map +0 -1
- package/dist/utils/claude-config-installer.d.ts +0 -98
- package/dist/utils/claude-config-installer.d.ts.map +0 -1
- package/dist/utils/claude-config-installer.js +0 -678
- package/dist/utils/claude-config-installer.js.map +0 -1
- package/dist/utils/config-manager.d.ts +0 -73
- package/dist/utils/config-manager.d.ts.map +0 -1
- package/dist/utils/config-manager.js +0 -339
- package/dist/utils/config-manager.js.map +0 -1
- package/dist/utils/error-handler.d.ts +0 -46
- package/dist/utils/error-handler.d.ts.map +0 -1
- package/dist/utils/error-handler.js +0 -169
- package/dist/utils/error-handler.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -25
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -105
- package/dist/utils/logger.js.map +0 -1
- package/src/commands/computer-setup-commands.ts +0 -872
|
@@ -1,705 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Computer Setup Commands
|
|
4
|
-
* Integrates real setup orchestrator for provisioning developer machines
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ComputerSetupCommands = void 0;
|
|
8
|
-
const tslib_1 = require("tslib");
|
|
9
|
-
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
10
|
-
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
11
|
-
const ora_1 = tslib_1.__importDefault(require("ora"));
|
|
12
|
-
const computer_setup_1 = require("@wundr.io/computer-setup");
|
|
13
|
-
const backup_rollback_manager_1 = require("../utils/backup-rollback-manager");
|
|
14
|
-
const claude_config_installer_1 = require("../utils/claude-config-installer");
|
|
15
|
-
const logger_1 = require("../utils/logger");
|
|
16
|
-
class ComputerSetupCommands {
|
|
17
|
-
program;
|
|
18
|
-
configManager;
|
|
19
|
-
pluginManager;
|
|
20
|
-
orchestrator;
|
|
21
|
-
platform;
|
|
22
|
-
backupManager;
|
|
23
|
-
claudeInstaller;
|
|
24
|
-
constructor(program, configManager, pluginManager) {
|
|
25
|
-
this.program = program;
|
|
26
|
-
this.configManager = configManager;
|
|
27
|
-
this.pluginManager = pluginManager;
|
|
28
|
-
this.platform = this.detectPlatform();
|
|
29
|
-
this.orchestrator = new computer_setup_1.RealSetupOrchestrator(this.platform);
|
|
30
|
-
this.backupManager = new backup_rollback_manager_1.BackupRollbackManager();
|
|
31
|
-
this.claudeInstaller = new claude_config_installer_1.ClaudeConfigInstaller();
|
|
32
|
-
this.registerCommands();
|
|
33
|
-
}
|
|
34
|
-
registerCommands() {
|
|
35
|
-
const computerSetup = this.program
|
|
36
|
-
.command('computer-setup')
|
|
37
|
-
.alias('setup-machine')
|
|
38
|
-
.alias('provision')
|
|
39
|
-
.description('Set up a new developer machine with all required tools and configurations')
|
|
40
|
-
.addHelpText('after', chalk_1.default.gray(`
|
|
41
|
-
Examples:
|
|
42
|
-
${chalk_1.default.green('wundr computer-setup')} Interactive setup for new machine
|
|
43
|
-
${chalk_1.default.green('wundr computer-setup --profile frontend')} Use frontend developer profile
|
|
44
|
-
${chalk_1.default.green('wundr computer-setup --team platform')} Apply platform team configuration
|
|
45
|
-
${chalk_1.default.green('wundr computer-setup doctor')} Diagnose setup issues
|
|
46
|
-
${chalk_1.default.green('wundr computer-setup validate')} Validate current setup
|
|
47
|
-
`));
|
|
48
|
-
// Main setup command
|
|
49
|
-
computerSetup
|
|
50
|
-
.command('run', { isDefault: true })
|
|
51
|
-
.description('Run computer setup for new developer machine')
|
|
52
|
-
.option('-p, --profile <profile>', 'Use specific profile (frontend, backend, fullstack, devops)')
|
|
53
|
-
.option('-t, --team <team>', 'Apply team-specific configurations')
|
|
54
|
-
.option('-m, --mode <mode>', 'Setup mode', 'interactive')
|
|
55
|
-
.option('--os <os>', 'Target OS (auto-detected by default)')
|
|
56
|
-
.option('--dry-run', 'Show what would be installed without making changes')
|
|
57
|
-
.option('--skip-existing', 'Skip tools that are already installed')
|
|
58
|
-
.option('--parallel', 'Install tools in parallel where possible')
|
|
59
|
-
.option('--report', 'Generate detailed setup report')
|
|
60
|
-
.action(async (options) => {
|
|
61
|
-
await this.runSetup(options);
|
|
62
|
-
});
|
|
63
|
-
// Resume command
|
|
64
|
-
computerSetup
|
|
65
|
-
.command('resume')
|
|
66
|
-
.description('Resume failed setup from saved state')
|
|
67
|
-
.action(async () => {
|
|
68
|
-
await this.resumeSetup();
|
|
69
|
-
});
|
|
70
|
-
// List profiles command
|
|
71
|
-
computerSetup
|
|
72
|
-
.command('list-profiles')
|
|
73
|
-
.description('List available developer profiles')
|
|
74
|
-
.action(async () => {
|
|
75
|
-
await this.listAvailableProfiles();
|
|
76
|
-
});
|
|
77
|
-
// Profile management
|
|
78
|
-
computerSetup
|
|
79
|
-
.command('profile')
|
|
80
|
-
.description('Manage developer profiles')
|
|
81
|
-
.option('-l, --list', 'List available profiles')
|
|
82
|
-
.option('-c, --create', 'Create new profile')
|
|
83
|
-
.option('-e, --edit <name>', 'Edit existing profile')
|
|
84
|
-
.option('-d, --delete <name>', 'Delete profile')
|
|
85
|
-
.option('--export <path>', 'Export profiles')
|
|
86
|
-
.option('--import <path>', 'Import profiles')
|
|
87
|
-
.action(async (options) => {
|
|
88
|
-
await this.manageProfiles(options);
|
|
89
|
-
});
|
|
90
|
-
// Team configuration
|
|
91
|
-
computerSetup
|
|
92
|
-
.command('team')
|
|
93
|
-
.description('Manage team configurations')
|
|
94
|
-
.argument('[team]', 'Team identifier')
|
|
95
|
-
.option('--download', 'Download team configuration')
|
|
96
|
-
.option('--apply', 'Apply team configuration')
|
|
97
|
-
.option('--sync', 'Sync with team repository')
|
|
98
|
-
.action(async (team, options) => {
|
|
99
|
-
await this.manageTeamConfig(team, options);
|
|
100
|
-
});
|
|
101
|
-
// Validation
|
|
102
|
-
computerSetup
|
|
103
|
-
.command('validate')
|
|
104
|
-
.description('Validate current machine setup')
|
|
105
|
-
.option('--profile <profile>', 'Validate against specific profile')
|
|
106
|
-
.option('--fix', 'Attempt to fix issues')
|
|
107
|
-
.option('--report', 'Generate validation report')
|
|
108
|
-
.action(async (options) => {
|
|
109
|
-
await this.validateSetup(options);
|
|
110
|
-
});
|
|
111
|
-
// Doctor - diagnose issues
|
|
112
|
-
computerSetup
|
|
113
|
-
.command('doctor')
|
|
114
|
-
.description('Diagnose and fix common setup issues')
|
|
115
|
-
.option('--check <tool>', 'Check specific tool')
|
|
116
|
-
.option('--fix', 'Attempt automatic fixes')
|
|
117
|
-
.option('--verbose', 'Show detailed diagnostics')
|
|
118
|
-
.action(async (options) => {
|
|
119
|
-
await this.runDoctor(options);
|
|
120
|
-
});
|
|
121
|
-
// Tool-specific setup commands
|
|
122
|
-
computerSetup
|
|
123
|
-
.command('install')
|
|
124
|
-
.description('Install specific tools')
|
|
125
|
-
.argument('<tool>', 'Tool to install (node, python, docker, etc.)')
|
|
126
|
-
.option('--version <version>', 'Specific version to install')
|
|
127
|
-
.option('--global', 'Install globally')
|
|
128
|
-
.action(async (tool, options) => {
|
|
129
|
-
await this.installTool(tool, options);
|
|
130
|
-
});
|
|
131
|
-
// Claude Code configuration commands
|
|
132
|
-
computerSetup
|
|
133
|
-
.command('claude-config')
|
|
134
|
-
.description('Install Claude Code configuration')
|
|
135
|
-
.option('--dry-run', 'Show what would be installed')
|
|
136
|
-
.option('--skip-backup', 'Skip backup creation')
|
|
137
|
-
.option('--overwrite', 'Overwrite existing configurations')
|
|
138
|
-
.option('--verbose', 'Show detailed output')
|
|
139
|
-
.action(async (options) => {
|
|
140
|
-
await this.installClaudeConfig(options);
|
|
141
|
-
});
|
|
142
|
-
// Backup management commands
|
|
143
|
-
computerSetup
|
|
144
|
-
.command('backup')
|
|
145
|
-
.description('Manage configuration backups')
|
|
146
|
-
.option('-l, --list', 'List all backups')
|
|
147
|
-
.option('-c, --create', 'Create new backup')
|
|
148
|
-
.option('-v, --verify <id>', 'Verify backup integrity')
|
|
149
|
-
.option('--cleanup', 'Clean up old backups')
|
|
150
|
-
.action(async (options) => {
|
|
151
|
-
await this.manageBackups(options);
|
|
152
|
-
});
|
|
153
|
-
// Rollback command
|
|
154
|
-
computerSetup
|
|
155
|
-
.command('rollback')
|
|
156
|
-
.description('Restore from backup')
|
|
157
|
-
.option('--backup <id>', 'Specific backup to restore')
|
|
158
|
-
.option('--dry-run', 'Show what would be restored')
|
|
159
|
-
.option('--verbose', 'Show detailed output')
|
|
160
|
-
.action(async (options) => {
|
|
161
|
-
await this.rollbackConfiguration(options);
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
async runSetup(options) {
|
|
165
|
-
console.log(chalk_1.default.cyan('\nš„ļø Wundr Computer Setup'));
|
|
166
|
-
console.log(chalk_1.default.gray('Setting up your development machine...\n'));
|
|
167
|
-
try {
|
|
168
|
-
// Check for resumable setup
|
|
169
|
-
const canResume = await this.orchestrator.canResume();
|
|
170
|
-
if (canResume) {
|
|
171
|
-
const { resume } = await inquirer_1.default.prompt([
|
|
172
|
-
{
|
|
173
|
-
type: 'confirm',
|
|
174
|
-
name: 'resume',
|
|
175
|
-
message: 'Found incomplete setup. Resume from where you left off?',
|
|
176
|
-
default: true,
|
|
177
|
-
},
|
|
178
|
-
]);
|
|
179
|
-
if (resume) {
|
|
180
|
-
return await this.resumeSetup();
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
// Get profile
|
|
184
|
-
let profileName = options.profile;
|
|
185
|
-
if (!profileName) {
|
|
186
|
-
if (options.mode === 'interactive') {
|
|
187
|
-
profileName = await this.selectProfile();
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
profileName = 'fullstack'; // Default
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
// Validate profile
|
|
194
|
-
const availableProfiles = this.orchestrator.getAvailableProfiles();
|
|
195
|
-
const profile = availableProfiles.find(p => p.name.toLowerCase().includes(profileName.toLowerCase()));
|
|
196
|
-
if (!profile) {
|
|
197
|
-
console.error(chalk_1.default.red(`ā Unknown profile: ${profileName}`));
|
|
198
|
-
console.log(chalk_1.default.cyan('\nAvailable profiles:'));
|
|
199
|
-
availableProfiles.forEach(p => console.log(` ⢠${p.name}: ${p.description}`));
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
console.log(chalk_1.default.cyan(`\nš Selected Profile: ${chalk_1.default.white(profile.name)}`));
|
|
203
|
-
console.log(chalk_1.default.gray(`${profile.description}`));
|
|
204
|
-
console.log(chalk_1.default.gray(`Estimated time: ${profile.estimatedTimeMinutes} minutes\n`));
|
|
205
|
-
// Show what will be installed
|
|
206
|
-
console.log(chalk_1.default.cyan('š ļø Tools to install:'));
|
|
207
|
-
profile.requiredTools.forEach(tool => console.log(` ⢠${tool}`));
|
|
208
|
-
if (profile.optionalTools.length > 0) {
|
|
209
|
-
console.log(chalk_1.default.cyan('\nš§ Optional tools:'));
|
|
210
|
-
profile.optionalTools.forEach(tool => console.log(` ⢠${tool}`));
|
|
211
|
-
}
|
|
212
|
-
if (options.dryRun) {
|
|
213
|
-
console.log(chalk_1.default.yellow('\nā ļø DRY RUN - No changes will be made'));
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
// Confirm before proceeding
|
|
217
|
-
if (options.mode === 'interactive') {
|
|
218
|
-
const { proceed } = await inquirer_1.default.prompt([
|
|
219
|
-
{
|
|
220
|
-
type: 'confirm',
|
|
221
|
-
name: 'proceed',
|
|
222
|
-
message: 'Proceed with setup?',
|
|
223
|
-
default: true,
|
|
224
|
-
},
|
|
225
|
-
]);
|
|
226
|
-
if (!proceed) {
|
|
227
|
-
console.log(chalk_1.default.yellow('Setup cancelled'));
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
// Run the orchestrator with progress tracking
|
|
232
|
-
const progressCallback = (progress) => {
|
|
233
|
-
// Update progress display
|
|
234
|
-
process.stdout.clearLine(0);
|
|
235
|
-
process.stdout.cursorTo(0);
|
|
236
|
-
process.stdout.write(`${chalk_1.default.cyan('[')}${progress.percentage.toFixed(1)}%${chalk_1.default.cyan(']')} ${progress.currentStep}`);
|
|
237
|
-
};
|
|
238
|
-
console.log(chalk_1.default.cyan('\nš Starting setup...\n'));
|
|
239
|
-
const result = await this.orchestrator.orchestrate(profileName, {
|
|
240
|
-
dryRun: options.dryRun,
|
|
241
|
-
skipExisting: options.skipExisting,
|
|
242
|
-
parallel: options.parallel,
|
|
243
|
-
generateReport: options.report,
|
|
244
|
-
}, progressCallback);
|
|
245
|
-
console.log('\n'); // New line after progress
|
|
246
|
-
if (result.success) {
|
|
247
|
-
console.log(chalk_1.default.green('ā
Computer setup completed successfully!'));
|
|
248
|
-
console.log(chalk_1.default.gray(`Setup took ${Math.round(result.duration / 1000)} seconds\n`));
|
|
249
|
-
if (result.completedSteps.length > 0) {
|
|
250
|
-
console.log(chalk_1.default.cyan(`šÆ Completed steps (${result.completedSteps.length}):`));
|
|
251
|
-
result.completedSteps
|
|
252
|
-
.slice(0, 5)
|
|
253
|
-
.forEach(step => console.log(` ā
${step}`));
|
|
254
|
-
if (result.completedSteps.length > 5) {
|
|
255
|
-
console.log(` ... and ${result.completedSteps.length - 5} more`);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
if (result.skippedSteps.length > 0) {
|
|
259
|
-
console.log(chalk_1.default.yellow(`āļø Skipped steps (${result.skippedSteps.length}):`));
|
|
260
|
-
result.skippedSteps.forEach(step => console.log(` āļø ${step}`));
|
|
261
|
-
}
|
|
262
|
-
this.displayNextSteps();
|
|
263
|
-
}
|
|
264
|
-
else {
|
|
265
|
-
console.log(chalk_1.default.red('ā Setup failed!'));
|
|
266
|
-
if (result.failedSteps.length > 0) {
|
|
267
|
-
console.log(chalk_1.default.red(`Failed steps (${result.failedSteps.length}):`));
|
|
268
|
-
result.failedSteps.forEach(step => console.log(` ā ${step}`));
|
|
269
|
-
}
|
|
270
|
-
if (result.errors.length > 0) {
|
|
271
|
-
console.log(chalk_1.default.red('\nErrors:'));
|
|
272
|
-
result.errors.forEach(error => console.log(` ⢠${error.message}`));
|
|
273
|
-
}
|
|
274
|
-
console.log(chalk_1.default.cyan('\nš” You can resume setup by running: wundr computer-setup resume'));
|
|
275
|
-
process.exit(1);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
catch (error) {
|
|
279
|
-
console.error(chalk_1.default.red('\nā Setup failed with error:'), error);
|
|
280
|
-
console.log(chalk_1.default.cyan('\nš” You can resume setup by running: wundr computer-setup resume'));
|
|
281
|
-
process.exit(1);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
async manageProfiles(options) {
|
|
285
|
-
if (options.list) {
|
|
286
|
-
const profiles = await this.listProfiles();
|
|
287
|
-
console.log(chalk_1.default.cyan('\nš Available Profiles:\n'));
|
|
288
|
-
profiles.forEach(p => {
|
|
289
|
-
console.log(chalk_1.default.white(` ⢠${p.name} (${p.role})`));
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
else if (options.create) {
|
|
293
|
-
await this.createInteractiveProfile();
|
|
294
|
-
}
|
|
295
|
-
else if (options.edit) {
|
|
296
|
-
await this.editProfile(options.edit);
|
|
297
|
-
}
|
|
298
|
-
else if (options.delete) {
|
|
299
|
-
await this.deleteProfile(options.delete);
|
|
300
|
-
}
|
|
301
|
-
else if (options.export) {
|
|
302
|
-
await this.exportProfiles(options.export);
|
|
303
|
-
}
|
|
304
|
-
else if (options.import) {
|
|
305
|
-
await this.importProfiles(options.import);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
async validateSetup(options) {
|
|
309
|
-
const spinner = (0, ora_1.default)('Validating setup...').start();
|
|
310
|
-
const checks = [
|
|
311
|
-
{ name: 'Node.js', cmd: 'node --version', required: true },
|
|
312
|
-
{ name: 'Git', cmd: 'git --version', required: true },
|
|
313
|
-
{ name: 'Docker', cmd: 'docker --version', required: false },
|
|
314
|
-
{ name: 'Claude Code', cmd: 'claude --version', required: false },
|
|
315
|
-
];
|
|
316
|
-
const results = [];
|
|
317
|
-
for (const check of checks) {
|
|
318
|
-
try {
|
|
319
|
-
// Would execute command and check
|
|
320
|
-
results.push({ ...check, status: 'passed' });
|
|
321
|
-
}
|
|
322
|
-
catch (error) {
|
|
323
|
-
results.push({ ...check, status: 'failed' });
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
spinner.stop();
|
|
327
|
-
console.log(chalk_1.default.cyan('\nš Validation Results:\n'));
|
|
328
|
-
results.forEach(r => {
|
|
329
|
-
const icon = r.status === 'passed' ? 'ā
' : 'ā';
|
|
330
|
-
const color = r.status === 'passed' ? chalk_1.default.green : chalk_1.default.red;
|
|
331
|
-
console.log(color(` ${icon} ${r.name}`));
|
|
332
|
-
});
|
|
333
|
-
if (options.fix) {
|
|
334
|
-
await this.attemptFixes(results.filter(r => r.status === 'failed'));
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
async runDoctor(options) {
|
|
338
|
-
console.log(chalk_1.default.cyan('\nš„ Computer Setup Doctor\n'));
|
|
339
|
-
const diagnostics = [
|
|
340
|
-
'Checking system requirements...',
|
|
341
|
-
'Verifying network connectivity...',
|
|
342
|
-
'Checking disk space...',
|
|
343
|
-
'Validating permissions...',
|
|
344
|
-
'Checking installed tools...',
|
|
345
|
-
'Verifying configurations...',
|
|
346
|
-
];
|
|
347
|
-
for (const diagnostic of diagnostics) {
|
|
348
|
-
const spinner = (0, ora_1.default)(diagnostic).start();
|
|
349
|
-
await new Promise(resolve => setTimeout(resolve, 500));
|
|
350
|
-
spinner.succeed();
|
|
351
|
-
}
|
|
352
|
-
console.log(chalk_1.default.green('\nā
All checks passed!'));
|
|
353
|
-
console.log(chalk_1.default.cyan('\nš Recommendations:'));
|
|
354
|
-
console.log(' 1. Keep your tools updated');
|
|
355
|
-
console.log(' 2. Regular security updates');
|
|
356
|
-
console.log(' 3. Backup your configurations');
|
|
357
|
-
}
|
|
358
|
-
async createInteractiveProfile() {
|
|
359
|
-
console.log(chalk_1.default.cyan('\nš¤ Create Developer Profile\n'));
|
|
360
|
-
const answers = await inquirer_1.default.prompt([
|
|
361
|
-
{
|
|
362
|
-
type: 'input',
|
|
363
|
-
name: 'name',
|
|
364
|
-
message: 'Your name:',
|
|
365
|
-
validate: input => input.length > 0,
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
type: 'input',
|
|
369
|
-
name: 'email',
|
|
370
|
-
message: 'Your email:',
|
|
371
|
-
validate: input => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(input),
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
type: 'list',
|
|
375
|
-
name: 'role',
|
|
376
|
-
message: 'Your role:',
|
|
377
|
-
choices: [
|
|
378
|
-
'Frontend Developer',
|
|
379
|
-
'Backend Developer',
|
|
380
|
-
'Full Stack Developer',
|
|
381
|
-
'DevOps Engineer',
|
|
382
|
-
'Machine Learning Engineer',
|
|
383
|
-
'Mobile Developer',
|
|
384
|
-
],
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
type: 'checkbox',
|
|
388
|
-
name: 'tools',
|
|
389
|
-
message: 'Select tools to install:',
|
|
390
|
-
choices: [
|
|
391
|
-
{ name: 'Node.js', checked: true },
|
|
392
|
-
{ name: 'Python' },
|
|
393
|
-
{ name: 'Docker', checked: true },
|
|
394
|
-
{ name: 'Kubernetes' },
|
|
395
|
-
{ name: 'AWS CLI' },
|
|
396
|
-
{ name: 'Claude Code', checked: true },
|
|
397
|
-
{ name: 'GitHub CLI', checked: true },
|
|
398
|
-
],
|
|
399
|
-
},
|
|
400
|
-
]);
|
|
401
|
-
console.log(chalk_1.default.green('\nā
Profile created successfully!'));
|
|
402
|
-
// Map answers to DeveloperProfile structure
|
|
403
|
-
const profile = {
|
|
404
|
-
name: 'custom',
|
|
405
|
-
role: answers.role,
|
|
406
|
-
languages: {
|
|
407
|
-
javascript: answers.tools.includes('Node.js'),
|
|
408
|
-
typescript: answers.tools.includes('TypeScript'),
|
|
409
|
-
python: answers.tools.includes('Python'),
|
|
410
|
-
},
|
|
411
|
-
frameworks: {},
|
|
412
|
-
tools: {
|
|
413
|
-
packageManagers: {
|
|
414
|
-
npm: answers.tools.includes('Node.js'),
|
|
415
|
-
yarn: answers.tools.includes('Yarn'),
|
|
416
|
-
pnpm: answers.tools.includes('pnpm'),
|
|
417
|
-
},
|
|
418
|
-
containers: {
|
|
419
|
-
docker: answers.tools.includes('Docker'),
|
|
420
|
-
dockerCompose: answers.tools.includes('Docker'),
|
|
421
|
-
kubernetes: answers.tools.includes('Kubernetes'),
|
|
422
|
-
},
|
|
423
|
-
editors: {
|
|
424
|
-
vscode: answers.tools.includes('VS Code'),
|
|
425
|
-
vim: answers.tools.includes('Vim'),
|
|
426
|
-
claude: answers.tools.includes('Claude Code'),
|
|
427
|
-
},
|
|
428
|
-
databases: {
|
|
429
|
-
postgresql: answers.tools.includes('PostgreSQL'),
|
|
430
|
-
mysql: answers.tools.includes('MySQL'),
|
|
431
|
-
mongodb: answers.tools.includes('MongoDB'),
|
|
432
|
-
redis: answers.tools.includes('Redis'),
|
|
433
|
-
},
|
|
434
|
-
},
|
|
435
|
-
};
|
|
436
|
-
return profile;
|
|
437
|
-
}
|
|
438
|
-
detectPlatform(os) {
|
|
439
|
-
return {
|
|
440
|
-
os: (os || process.platform),
|
|
441
|
-
arch: process.arch,
|
|
442
|
-
version: process.version,
|
|
443
|
-
node: process.version,
|
|
444
|
-
shell: process.env.SHELL,
|
|
445
|
-
};
|
|
446
|
-
}
|
|
447
|
-
async selectProfile() {
|
|
448
|
-
const profiles = this.orchestrator.getAvailableProfiles();
|
|
449
|
-
const { selectedProfile } = await inquirer_1.default.prompt([
|
|
450
|
-
{
|
|
451
|
-
type: 'list',
|
|
452
|
-
name: 'selectedProfile',
|
|
453
|
-
message: 'Select a developer profile:',
|
|
454
|
-
choices: profiles.map(p => ({
|
|
455
|
-
name: `${p.name} - ${p.description}`,
|
|
456
|
-
value: p.name.toLowerCase().replace(' ', ''),
|
|
457
|
-
short: p.name,
|
|
458
|
-
})),
|
|
459
|
-
},
|
|
460
|
-
]);
|
|
461
|
-
return selectedProfile;
|
|
462
|
-
}
|
|
463
|
-
async resumeSetup() {
|
|
464
|
-
console.log(chalk_1.default.cyan('\nš Resuming setup from saved state...\n'));
|
|
465
|
-
const progressCallback = (progress) => {
|
|
466
|
-
process.stdout.clearLine(0);
|
|
467
|
-
process.stdout.cursorTo(0);
|
|
468
|
-
process.stdout.write(`${chalk_1.default.cyan('[')}${progress.percentage.toFixed(1)}%${chalk_1.default.cyan(']')} ${progress.currentStep}`);
|
|
469
|
-
};
|
|
470
|
-
try {
|
|
471
|
-
const result = await this.orchestrator.resume(progressCallback);
|
|
472
|
-
console.log('\n'); // New line after progress
|
|
473
|
-
if (result.success) {
|
|
474
|
-
console.log(chalk_1.default.green('ā
Setup resumed and completed successfully!'));
|
|
475
|
-
this.displayNextSteps();
|
|
476
|
-
}
|
|
477
|
-
else {
|
|
478
|
-
console.log(chalk_1.default.red('ā Resume failed!'));
|
|
479
|
-
if (result.errors.length > 0) {
|
|
480
|
-
console.log(chalk_1.default.red('Errors:'));
|
|
481
|
-
result.errors.forEach(error => console.log(` ⢠${error.message}`));
|
|
482
|
-
}
|
|
483
|
-
process.exit(1);
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
catch (error) {
|
|
487
|
-
console.error(chalk_1.default.red('ā Resume failed:'), error);
|
|
488
|
-
process.exit(1);
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
async listAvailableProfiles() {
|
|
492
|
-
console.log(chalk_1.default.cyan('\nš¤ Available Developer Profiles:\n'));
|
|
493
|
-
const profiles = this.orchestrator.getAvailableProfiles();
|
|
494
|
-
profiles.forEach(profile => {
|
|
495
|
-
console.log(chalk_1.default.white(`š ${profile.name}`));
|
|
496
|
-
console.log(chalk_1.default.gray(` ${profile.description}`));
|
|
497
|
-
console.log(chalk_1.default.gray(` Categories: ${profile.categories.join(', ')}`));
|
|
498
|
-
console.log(chalk_1.default.gray(` Tools: ${profile.requiredTools.join(', ')}`));
|
|
499
|
-
console.log(chalk_1.default.gray(` Estimated time: ${profile.estimatedTimeMinutes} minutes`));
|
|
500
|
-
console.log();
|
|
501
|
-
});
|
|
502
|
-
console.log(chalk_1.default.cyan('Usage: wundr computer-setup --profile <profile-name>'));
|
|
503
|
-
console.log(chalk_1.default.gray('Example: wundr computer-setup --profile frontend\n'));
|
|
504
|
-
}
|
|
505
|
-
generateSetupSteps(profile, platform) {
|
|
506
|
-
const steps = [];
|
|
507
|
-
// Platform-specific setup
|
|
508
|
-
if (platform.os === 'darwin') {
|
|
509
|
-
steps.push({ name: 'Install Homebrew', required: true });
|
|
510
|
-
steps.push({ name: 'Install Xcode Command Line Tools', required: true });
|
|
511
|
-
}
|
|
512
|
-
// Common tools
|
|
513
|
-
steps.push({ name: 'Configure Git', required: true });
|
|
514
|
-
steps.push({ name: 'Generate SSH keys', required: true });
|
|
515
|
-
// Profile-specific tools
|
|
516
|
-
if (profile.tools?.includes('Node.js')) {
|
|
517
|
-
steps.push({ name: 'Install Node.js via nvm', required: true });
|
|
518
|
-
steps.push({ name: 'Install pnpm', required: true });
|
|
519
|
-
}
|
|
520
|
-
if (profile.tools?.includes('Docker')) {
|
|
521
|
-
steps.push({ name: 'Install Docker Desktop', required: false });
|
|
522
|
-
}
|
|
523
|
-
if (profile.tools?.includes('Claude Code')) {
|
|
524
|
-
steps.push({ name: 'Install Claude Code', required: false });
|
|
525
|
-
steps.push({ name: 'Configure Claude Flow', required: false });
|
|
526
|
-
}
|
|
527
|
-
// Final steps
|
|
528
|
-
steps.push({ name: 'Configure shell environment', required: true });
|
|
529
|
-
steps.push({ name: 'Install VS Code extensions', required: false });
|
|
530
|
-
return steps;
|
|
531
|
-
}
|
|
532
|
-
async executeSetupStep(step, options) {
|
|
533
|
-
// Simulate execution
|
|
534
|
-
await new Promise(resolve => setTimeout(resolve, 500));
|
|
535
|
-
if (Math.random() > 0.95 && !step.required) {
|
|
536
|
-
throw new Error('Simulated error');
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
displayNextSteps() {
|
|
540
|
-
console.log(chalk_1.default.cyan('\nš Next Steps:\n'));
|
|
541
|
-
const steps = [
|
|
542
|
-
'Restart your terminal to apply changes',
|
|
543
|
-
'Run "wundr computer-setup validate" to verify',
|
|
544
|
-
'Sign in to your team tools (Slack, GitHub, etc.)',
|
|
545
|
-
'Clone your team repositories',
|
|
546
|
-
'Review team documentation',
|
|
547
|
-
];
|
|
548
|
-
steps.forEach((step, i) => {
|
|
549
|
-
console.log(chalk_1.default.white(` ${i + 1}. ${step}`));
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
async loadProfile(name) {
|
|
553
|
-
// Load profile from config
|
|
554
|
-
return {
|
|
555
|
-
name: name,
|
|
556
|
-
role: 'fullstack',
|
|
557
|
-
tools: ['Node.js', 'Docker', 'Claude Code'],
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
|
-
async getDefaultProfile() {
|
|
561
|
-
return {
|
|
562
|
-
name: 'default',
|
|
563
|
-
role: 'fullstack',
|
|
564
|
-
tools: ['Node.js', 'Git'],
|
|
565
|
-
};
|
|
566
|
-
}
|
|
567
|
-
async listProfiles() {
|
|
568
|
-
return [
|
|
569
|
-
{ name: 'frontend', role: 'Frontend Developer' },
|
|
570
|
-
{ name: 'backend', role: 'Backend Developer' },
|
|
571
|
-
{ name: 'fullstack', role: 'Full Stack Developer' },
|
|
572
|
-
];
|
|
573
|
-
}
|
|
574
|
-
async editProfile(name) {
|
|
575
|
-
console.log(chalk_1.default.cyan(`Editing profile: ${name}`));
|
|
576
|
-
}
|
|
577
|
-
async deleteProfile(name) {
|
|
578
|
-
console.log(chalk_1.default.yellow(`Deleting profile: ${name}`));
|
|
579
|
-
}
|
|
580
|
-
async exportProfiles(path) {
|
|
581
|
-
console.log(chalk_1.default.green(`Profiles exported to: ${path}`));
|
|
582
|
-
}
|
|
583
|
-
async importProfiles(path) {
|
|
584
|
-
console.log(chalk_1.default.green(`Profiles imported from: ${path}`));
|
|
585
|
-
}
|
|
586
|
-
async manageTeamConfig(team, options) {
|
|
587
|
-
console.log(chalk_1.default.cyan(`Managing team configuration: ${team}`));
|
|
588
|
-
}
|
|
589
|
-
async installTool(tool, options) {
|
|
590
|
-
console.log(chalk_1.default.cyan(`Installing ${tool}...`));
|
|
591
|
-
}
|
|
592
|
-
async attemptFixes(failures) {
|
|
593
|
-
console.log(chalk_1.default.yellow('\nAttempting fixes...'));
|
|
594
|
-
for (const failure of failures) {
|
|
595
|
-
console.log(chalk_1.default.gray(` Fixing ${failure.name}...`));
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
/**
|
|
599
|
-
* Install Claude Code configuration
|
|
600
|
-
*/
|
|
601
|
-
async installClaudeConfig(options) {
|
|
602
|
-
console.log(chalk_1.default.cyan('\nš§ Claude Code Configuration Installer\n'));
|
|
603
|
-
try {
|
|
604
|
-
// Initialize managers
|
|
605
|
-
await this.backupManager.initialize();
|
|
606
|
-
await this.claudeInstaller.initialize();
|
|
607
|
-
// Install configurations
|
|
608
|
-
const result = await this.claudeInstaller.install({
|
|
609
|
-
dryRun: options.dryRun,
|
|
610
|
-
skipBackup: options.skipBackup,
|
|
611
|
-
overwrite: options.overwrite,
|
|
612
|
-
verbose: options.verbose,
|
|
613
|
-
});
|
|
614
|
-
if (!result.success) {
|
|
615
|
-
process.exit(1);
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
catch (error) {
|
|
619
|
-
console.error(chalk_1.default.red('ā Installation failed:'), error);
|
|
620
|
-
logger_1.logger.error('Claude config installation failed', error);
|
|
621
|
-
process.exit(1);
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
/**
|
|
625
|
-
* Manage backups
|
|
626
|
-
*/
|
|
627
|
-
async manageBackups(options) {
|
|
628
|
-
await this.backupManager.initialize();
|
|
629
|
-
if (options.list) {
|
|
630
|
-
const backups = await this.backupManager.listBackups();
|
|
631
|
-
if (backups.length === 0) {
|
|
632
|
-
console.log(chalk_1.default.yellow('No backups found'));
|
|
633
|
-
return;
|
|
634
|
-
}
|
|
635
|
-
console.log(chalk_1.default.cyan('\nš¦ Available Backups\n'));
|
|
636
|
-
backups.forEach(backup => {
|
|
637
|
-
const date = new Date(backup.timestamp).toLocaleString();
|
|
638
|
-
const status = backup.success
|
|
639
|
-
? chalk_1.default.green('ā
Success')
|
|
640
|
-
: chalk_1.default.red('ā Failed');
|
|
641
|
-
console.log(chalk_1.default.white(`ID: ${backup.backupId}`));
|
|
642
|
-
console.log(chalk_1.default.gray(` Date: ${date}`));
|
|
643
|
-
console.log(chalk_1.default.gray(` Reason: ${backup.reason}`));
|
|
644
|
-
console.log(chalk_1.default.gray(` Status: ${status}`));
|
|
645
|
-
console.log(chalk_1.default.gray(` Files: ${backup.files.length}`));
|
|
646
|
-
console.log();
|
|
647
|
-
});
|
|
648
|
-
}
|
|
649
|
-
else if (options.create) {
|
|
650
|
-
const { files } = await inquirer_1.default.prompt([
|
|
651
|
-
{
|
|
652
|
-
type: 'input',
|
|
653
|
-
name: 'files',
|
|
654
|
-
message: 'Enter file paths (comma-separated):',
|
|
655
|
-
validate: input => input.length > 0,
|
|
656
|
-
},
|
|
657
|
-
]);
|
|
658
|
-
const fileList = files.split(',').map((f) => f.trim());
|
|
659
|
-
const backup = await this.backupManager.createBackup(fileList, 'Manual backup');
|
|
660
|
-
this.backupManager.displayBackupInfo(backup);
|
|
661
|
-
}
|
|
662
|
-
else if (options.verify) {
|
|
663
|
-
const isValid = await this.backupManager.verifyBackup(options.verify);
|
|
664
|
-
if (isValid) {
|
|
665
|
-
console.log(chalk_1.default.green(`ā
Backup ${options.verify} is valid`));
|
|
666
|
-
}
|
|
667
|
-
else {
|
|
668
|
-
console.log(chalk_1.default.red(`ā Backup ${options.verify} is invalid`));
|
|
669
|
-
process.exit(1);
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
else if (options.cleanup) {
|
|
673
|
-
await this.backupManager.cleanupOldBackups();
|
|
674
|
-
console.log(chalk_1.default.green('ā
Old backups cleaned up'));
|
|
675
|
-
}
|
|
676
|
-
else {
|
|
677
|
-
console.log(chalk_1.default.yellow('Please specify an option. Use --help for details.'));
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
/**
|
|
681
|
-
* Rollback configuration
|
|
682
|
-
*/
|
|
683
|
-
async rollbackConfiguration(options) {
|
|
684
|
-
console.log(chalk_1.default.cyan('\nš Configuration Rollback\n'));
|
|
685
|
-
await this.backupManager.initialize();
|
|
686
|
-
const success = await this.backupManager.rollback({
|
|
687
|
-
backupId: options.backup,
|
|
688
|
-
dryRun: options.dryRun,
|
|
689
|
-
verbose: options.verbose,
|
|
690
|
-
});
|
|
691
|
-
if (!success) {
|
|
692
|
-
console.log(chalk_1.default.red('\nā Rollback failed'));
|
|
693
|
-
process.exit(1);
|
|
694
|
-
}
|
|
695
|
-
if (!options.dryRun) {
|
|
696
|
-
console.log(chalk_1.default.green('\nā
Rollback completed successfully'));
|
|
697
|
-
console.log(chalk_1.default.cyan('\nNext steps:'));
|
|
698
|
-
console.log(chalk_1.default.white(' 1. Verify restored configurations'));
|
|
699
|
-
console.log(chalk_1.default.white(' 2. Restart terminal if needed'));
|
|
700
|
-
console.log(chalk_1.default.white(' 3. Run validation script'));
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
exports.ComputerSetupCommands = ComputerSetupCommands;
|
|
705
|
-
//# sourceMappingURL=computer-setup-commands.js.map
|