nostr-bray 1.18.1 → 1.18.2
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 +13 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -218,6 +218,14 @@ if (command === 'help' || command === '--help' || command === '-h') {
|
|
|
218
218
|
console.log(HELP);
|
|
219
219
|
process.exit(0);
|
|
220
220
|
}
|
|
221
|
+
// Commands that work purely offline — no relay connection needed
|
|
222
|
+
const OFFLINE_COMMANDS = new Set([
|
|
223
|
+
'whoami', 'create', 'list', 'derive', 'persona', 'switch', 'prove',
|
|
224
|
+
'backup', 'restore', 'spoken-challenge', 'spoken-verify', 'trust-verify',
|
|
225
|
+
'ring-verify', 'zap-decode', 'safety-configure', 'safety-activate',
|
|
226
|
+
'decode', 'encode-npub', 'encode-note', 'encode-nprofile', 'encode-nevent', 'encode-nsec',
|
|
227
|
+
'key-public', 'key-encrypt', 'key-decrypt', 'filter', 'verify', 'encrypt', 'decrypt',
|
|
228
|
+
]);
|
|
221
229
|
// All other commands need config
|
|
222
230
|
const config = loadConfig();
|
|
223
231
|
const pool = new RelayPool({
|
|
@@ -238,8 +246,11 @@ else {
|
|
|
238
246
|
const nwcUri = config.nwcUri;
|
|
239
247
|
config.secretKey = '';
|
|
240
248
|
config.nwcUri = undefined;
|
|
241
|
-
|
|
242
|
-
|
|
249
|
+
// Only fetch NIP-65 relay list for commands that need network access
|
|
250
|
+
if (!OFFLINE_COMMANDS.has(command)) {
|
|
251
|
+
const masterRelays = await nip65.loadForIdentity(ctx.activeNpub);
|
|
252
|
+
pool.reconfigure(ctx.activeNpub, masterRelays);
|
|
253
|
+
}
|
|
243
254
|
// Default output mode from env (CLI-level --json/--human handled per-command)
|
|
244
255
|
const envDefault = process.env.NOSTR_BRAY_OUTPUT === 'json' ? 'json' : 'human';
|
|
245
256
|
/** Resolve output mode for a given set of args */
|
package/package.json
CHANGED