nostr-bray 1.2.0 → 1.3.0
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/dist/cli.js +23 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -387,9 +387,31 @@ async function run(cmdArgs) {
|
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
389
|
// === Shell mode ===
|
|
390
|
+
const ALL_COMMANDS = [
|
|
391
|
+
'whoami', 'create', 'list', 'derive', 'persona', 'switch', 'prove', 'proof-publish',
|
|
392
|
+
'backup', 'restore', 'identity-backup', 'identity-restore', 'migrate',
|
|
393
|
+
'post', 'reply', 'react', 'profile', 'profile-set', 'dm', 'dm-read', 'feed', 'notifications',
|
|
394
|
+
'attest', 'trust-read', 'trust-verify', 'trust-revoke', 'trust-request', 'trust-request-list',
|
|
395
|
+
'ring-prove', 'ring-verify', 'spoken-challenge', 'spoken-verify',
|
|
396
|
+
'relay-list', 'relay-set', 'relay-add', 'relay-info',
|
|
397
|
+
'zap-send', 'zap-balance', 'zap-invoice', 'zap-lookup', 'zap-transactions', 'zap-receipts', 'zap-decode',
|
|
398
|
+
'safety-configure', 'safety-activate',
|
|
399
|
+
'help', 'exit',
|
|
400
|
+
];
|
|
390
401
|
async function shell() {
|
|
391
402
|
const { createInterface } = await import('node:readline');
|
|
392
|
-
const rl = createInterface({
|
|
403
|
+
const rl = createInterface({
|
|
404
|
+
input: process.stdin,
|
|
405
|
+
output: process.stdout,
|
|
406
|
+
completer: (line) => {
|
|
407
|
+
const parts = line.split(/\s+/);
|
|
408
|
+
if (parts.length <= 1) {
|
|
409
|
+
const hits = ALL_COMMANDS.filter(c => c.startsWith(line));
|
|
410
|
+
return [hits.length ? hits : ALL_COMMANDS, line];
|
|
411
|
+
}
|
|
412
|
+
return [[], line];
|
|
413
|
+
},
|
|
414
|
+
});
|
|
393
415
|
console.log(`nostr-bray shell — ${ctx.activeNpub}`);
|
|
394
416
|
console.log('Type a command, or "help" / "exit".\n');
|
|
395
417
|
const prompt = () => new Promise(resolve => {
|
package/package.json
CHANGED