raqeb-cli 1.3.2 → 1.3.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/bin/raqeb.js +1 -1
- package/lib/interactive.js +42 -25
- package/package.json +1 -1
package/bin/raqeb.js
CHANGED
|
@@ -360,7 +360,7 @@ Installation:
|
|
|
360
360
|
program
|
|
361
361
|
.name('raqeb')
|
|
362
362
|
.description('Raqeb CLI - Database PAM and Secrets Management')
|
|
363
|
-
.version('1.3.
|
|
363
|
+
.version('1.3.3')
|
|
364
364
|
.option('-i, --interactive', 'Launch interactive mode')
|
|
365
365
|
.hook('preAction', async (thisCommand, actionCommand) => {
|
|
366
366
|
// Handle -i flag
|
package/lib/interactive.js
CHANGED
|
@@ -31,8 +31,15 @@ class InteractiveShell {
|
|
|
31
31
|
try {
|
|
32
32
|
const response = await this.client.get('/auth/me');
|
|
33
33
|
this.userInfo = response.data;
|
|
34
|
+
console.log('User info loaded:', this.userInfo); // Debug
|
|
34
35
|
} catch (error) {
|
|
35
|
-
|
|
36
|
+
console.error('Failed to load user info:', error.message); // Debug
|
|
37
|
+
this.userInfo = {
|
|
38
|
+
email: 'Not logged in',
|
|
39
|
+
tenant_name: 'Unknown',
|
|
40
|
+
tenant_id: 'Unknown',
|
|
41
|
+
role: 'user'
|
|
42
|
+
};
|
|
36
43
|
}
|
|
37
44
|
}
|
|
38
45
|
|
|
@@ -84,29 +91,25 @@ class InteractiveShell {
|
|
|
84
91
|
showWelcome() {
|
|
85
92
|
console.clear();
|
|
86
93
|
|
|
87
|
-
// Raqeb ASCII Logo
|
|
88
|
-
const blue = chalk.hex('#
|
|
89
|
-
const green = chalk.hex('#
|
|
90
|
-
const cyan = chalk.hex('#
|
|
94
|
+
// Raqeb ASCII Logo - Custom design from user
|
|
95
|
+
const blue = chalk.hex('#0066cc');
|
|
96
|
+
const green = chalk.hex('#00aa80');
|
|
97
|
+
const cyan = chalk.hex('#00ccaa');
|
|
91
98
|
|
|
92
99
|
console.log('');
|
|
93
|
-
console.log(blue('
|
|
94
|
-
console.log(blue('
|
|
95
|
-
console.log(blue('
|
|
96
|
-
console.log(blue('
|
|
97
|
-
console.log(blue('
|
|
98
|
-
console.log(blue('
|
|
99
|
-
console.log(blue('
|
|
100
|
-
console.log(blue('
|
|
101
|
-
console.log(
|
|
102
|
-
console.log(
|
|
103
|
-
console.log(
|
|
104
|
-
console.log(
|
|
105
|
-
console.log(
|
|
106
|
-
console.log(blue(' ╰──○'));
|
|
107
|
-
console.log(blue(' ╲'));
|
|
108
|
-
console.log(blue(' ╲'));
|
|
109
|
-
console.log(blue(' ●'));
|
|
100
|
+
console.log(' ' + blue('●'));
|
|
101
|
+
console.log(' ' + blue('╱'));
|
|
102
|
+
console.log(' ' + blue('╭──○'));
|
|
103
|
+
console.log(' ' + blue('╱') + ' ' + green('╱ ╲'));
|
|
104
|
+
console.log(' ' + blue('╱') + ' ' + green('╱') + cyan(' ● ') + green('╲'));
|
|
105
|
+
console.log(' ' + blue('│') + ' ' + green('│') + cyan('╱ ╲') + green('│'));
|
|
106
|
+
console.log(' ' + blue('│') + ' ' + chalk.bold.white('RAQEB') + green('│') + cyan(' ● ') + green('│'));
|
|
107
|
+
console.log(' ' + blue('│') + ' ' + green('│') + cyan('╲ ╱') + green('│'));
|
|
108
|
+
console.log(' ' + blue('╲') + ' ' + green('╲') + cyan(' ● ') + green('╱'));
|
|
109
|
+
console.log(' ' + blue('╲') + ' ' + green('╲ ╱'));
|
|
110
|
+
console.log(' ' + blue('╰──○'));
|
|
111
|
+
console.log(' ' + blue('╲'));
|
|
112
|
+
console.log(' ' + blue('●'));
|
|
110
113
|
console.log('');
|
|
111
114
|
|
|
112
115
|
// Header box with user info
|
|
@@ -115,7 +118,7 @@ class InteractiveShell {
|
|
|
115
118
|
const userRole = this.userInfo?.role || 'user';
|
|
116
119
|
|
|
117
120
|
console.log(blue('╔════════════════════════════════════════════════════════════════════════════╗'));
|
|
118
|
-
console.log(blue('║') + chalk.bold.white(' 🌐 Raqeb CLI - Interactive Mode v1.3.
|
|
121
|
+
console.log(blue('║') + chalk.bold.white(' 🌐 Raqeb CLI - Interactive Mode v1.3.3 ') + blue('║'));
|
|
119
122
|
console.log(blue('╠════════════════════════════════════════════════════════════════════════════╣'));
|
|
120
123
|
console.log(blue('║ ') + chalk.gray('User: ') + green(userEmail.padEnd(64)) + blue(' ║'));
|
|
121
124
|
console.log(blue('║ ') + chalk.gray('Tenant: ') + green(tenantName.padEnd(64)) + blue(' ║'));
|
|
@@ -172,8 +175,22 @@ class InteractiveShell {
|
|
|
172
175
|
pageSize: 10
|
|
173
176
|
}]);
|
|
174
177
|
|
|
175
|
-
|
|
176
|
-
|
|
178
|
+
// Just show the submenu, don't execute
|
|
179
|
+
if (answer.command === '/db') {
|
|
180
|
+
this.showDatabaseCommands();
|
|
181
|
+
} else if (answer.command === '/secrets') {
|
|
182
|
+
this.showSecretsCommands();
|
|
183
|
+
} else if (answer.command === '/keys') {
|
|
184
|
+
this.showKeysCommands();
|
|
185
|
+
} else if (answer.command === '/audit') {
|
|
186
|
+
this.showAuditCommands();
|
|
187
|
+
} else if (answer.command === '/help') {
|
|
188
|
+
this.showHelp();
|
|
189
|
+
} else if (answer.command === '/clear') {
|
|
190
|
+
console.clear();
|
|
191
|
+
this.showWelcome();
|
|
192
|
+
} else if (answer.command === '/exit') {
|
|
193
|
+
this.rl.close();
|
|
177
194
|
}
|
|
178
195
|
}
|
|
179
196
|
|