raqeb-cli 1.3.0 → 1.3.1
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 +2 -2
- package/lib/interactive.js +16 -27
- package/package.json +1 -1
package/bin/raqeb.js
CHANGED
|
@@ -325,11 +325,11 @@ Examples:
|
|
|
325
325
|
$ raqeb -i
|
|
326
326
|
$ raqeb shell
|
|
327
327
|
`)
|
|
328
|
-
.action(() => {
|
|
328
|
+
.action(async () => {
|
|
329
329
|
const InteractiveShell = require('../lib/interactive');
|
|
330
330
|
const client = getClient();
|
|
331
331
|
const shell = new InteractiveShell(client);
|
|
332
|
-
shell.start();
|
|
332
|
+
await shell.start();
|
|
333
333
|
});
|
|
334
334
|
|
|
335
335
|
// Completion command
|
package/lib/interactive.js
CHANGED
|
@@ -84,29 +84,20 @@ class InteractiveShell {
|
|
|
84
84
|
showWelcome() {
|
|
85
85
|
console.clear();
|
|
86
86
|
|
|
87
|
-
//
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
██████╔╝███████║██║ ██║█████╗ ██████╔╝
|
|
92
|
-
██╔══██╗██╔══██║██║▄▄ ██║██╔══╝ ██╔══██╗
|
|
93
|
-
██║ ██║██║ ██║╚██████╔╝███████╗██████╔╝
|
|
94
|
-
╚═╝ ╚═╝╚═╝ ╚═╝ ╚══▀▀═╝ ╚══════╝╚═════╝
|
|
95
|
-
`));
|
|
87
|
+
// Header box with user info (like Claude CLI)
|
|
88
|
+
const userEmail = this.userInfo?.email || 'Not logged in';
|
|
89
|
+
const tenantName = this.userInfo?.tenant_name || this.userInfo?.tenant_id || 'Unknown';
|
|
90
|
+
const userRole = this.userInfo?.role || 'user';
|
|
96
91
|
|
|
97
|
-
console.log(chalk.
|
|
98
|
-
console.log(chalk.
|
|
99
|
-
console.log(chalk.
|
|
92
|
+
console.log(chalk.hex('#3B82F6')('╔════════════════════════════════════════════════════════════════════════════╗'));
|
|
93
|
+
console.log(chalk.hex('#3B82F6')('║') + chalk.bold.white(' 🌐 Raqeb CLI - Interactive Mode v1.3.1 ') + chalk.hex('#3B82F6')('║'));
|
|
94
|
+
console.log(chalk.hex('#3B82F6')('╠════════════════════════════════════════════════════════════════════════════╣'));
|
|
95
|
+
console.log(chalk.hex('#3B82F6')('║ ') + chalk.gray('User: ') + chalk.hex('#10B981')(userEmail.padEnd(64)) + chalk.hex('#3B82F6')(' ║'));
|
|
96
|
+
console.log(chalk.hex('#3B82F6')('║ ') + chalk.gray('Tenant: ') + chalk.hex('#10B981')(tenantName.padEnd(64)) + chalk.hex('#3B82F6')(' ║'));
|
|
97
|
+
console.log(chalk.hex('#3B82F6')('║ ') + chalk.gray('Role: ') + chalk.hex('#F59E0B')(userRole.padEnd(64)) + chalk.hex('#3B82F6')(' ║'));
|
|
98
|
+
console.log(chalk.hex('#3B82F6')('╚════════════════════════════════════════════════════════════════════════════╝'));
|
|
100
99
|
|
|
101
|
-
|
|
102
|
-
if (this.userInfo) {
|
|
103
|
-
console.log(chalk.gray('\n📊 Session Information:'));
|
|
104
|
-
console.log(chalk.white(` User: ${chalk.green(this.userInfo.email || 'Unknown')}`));
|
|
105
|
-
console.log(chalk.white(` Tenant: ${chalk.green(this.userInfo.tenant_name || this.userInfo.tenant_id || 'Unknown')}`));
|
|
106
|
-
console.log(chalk.white(` Role: ${chalk.yellow(this.userInfo.role || 'user')}`));
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
console.log(chalk.cyan('\n💡 Type / to see all commands, or /help for help\n'));
|
|
100
|
+
console.log(chalk.hex('#10B981')('\n💡 Type / to see all commands, or /help for help\n'));
|
|
110
101
|
}
|
|
111
102
|
|
|
112
103
|
async handleCommand(input) {
|
|
@@ -368,7 +359,7 @@ class InteractiveShell {
|
|
|
368
359
|
|
|
369
360
|
async listSecrets() {
|
|
370
361
|
try {
|
|
371
|
-
const response = await this.client.get('/
|
|
362
|
+
const response = await this.client.get('/secrets');
|
|
372
363
|
const secrets = response.data;
|
|
373
364
|
|
|
374
365
|
if (!secrets || secrets.length === 0) {
|
|
@@ -405,9 +396,7 @@ class InteractiveShell {
|
|
|
405
396
|
}
|
|
406
397
|
|
|
407
398
|
try {
|
|
408
|
-
const response = await this.client.
|
|
409
|
-
params: { secret_id: secretId }
|
|
410
|
-
});
|
|
399
|
+
const response = await this.client.get(`/secrets/${secretId}`);
|
|
411
400
|
const data = response.data;
|
|
412
401
|
|
|
413
402
|
console.log(chalk.cyan(`\n🔐 Secret: ${data.name}`));
|
|
@@ -442,7 +431,7 @@ class InteractiveShell {
|
|
|
442
431
|
}
|
|
443
432
|
]);
|
|
444
433
|
|
|
445
|
-
await this.client.post('/
|
|
434
|
+
await this.client.post('/secrets', {
|
|
446
435
|
name: answers.name,
|
|
447
436
|
value: answers.value,
|
|
448
437
|
description: answers.description || undefined
|
|
@@ -474,7 +463,7 @@ class InteractiveShell {
|
|
|
474
463
|
return;
|
|
475
464
|
}
|
|
476
465
|
|
|
477
|
-
await this.client.delete(`/
|
|
466
|
+
await this.client.delete(`/secrets/${secretName}`);
|
|
478
467
|
console.log(chalk.green(`\n✓ Secret '${secretName}' deleted successfully\n`));
|
|
479
468
|
} catch (error) {
|
|
480
469
|
throw new Error(error.response?.data?.detail || error.message);
|