@@ -20,6 +20,8 @@ import { handleDuressConfigure, handleDuressActivate } from './safety/handlers.j
2020import { handleZapSend , handleZapBalance , handleZapMakeInvoice , handleZapLookupInvoice , handleZapListTransactions , handleZapReceipts , handleZapDecode } from './zap/handlers.js'
2121import { handleDecode , handleEncodeNpub , handleEncodeNote , handleEncodeNprofile , handleEncodeNevent , handleVerify , handleEncrypt , handleDecrypt , handleCount , handleFetch , handleKeyPublic , handleEncodeNsec , handleFilter , handleNipList , handleNipShow } from './util/handlers.js'
2222
23+ import { getCommandHelp } from './help.js'
24+
2325const args = process . argv . slice ( 2 )
2426const command = args [ 0 ]
2527
@@ -29,6 +31,12 @@ if (!command || command === 'serve') {
2931 process . exit ( 0 )
3032}
3133
34+ // Per-command help: `nostr-bray post --help`
35+ if ( args . includes ( '--help' ) && command && command !== 'help' && command !== '--help' && command !== '-h' ) {
36+ const help = getCommandHelp ( command )
37+ if ( help ) { console . log ( help ) ; process . exit ( 0 ) }
38+ }
39+
3240const HELP = `nostr-bray — Sovereign Nostr identities for AI agents
3341
3442Usage: nostr-bray [command] [args]
@@ -130,7 +138,23 @@ Environment:
130138 NOSTR_SECRET_KEY_FILE Path to secret key file
131139 NOSTR_RELAYS Comma-separated relay URLs
132140 NWC_URI / NWC_URI_FILE Nostr Wallet Connect URI
133- TOR_PROXY SOCKS5h proxy URL`
141+ TOR_PROXY SOCKS5h proxy URL
142+
143+ Quick examples:
144+ nostr-bray whoami # show your npub
145+ nostr-bray post "gm nostr" # publish a note
146+ nostr-bray persona work # derive work identity
147+ nostr-bray dm abc123... "secret message" # send encrypted DM
148+ nostr-bray decode npub1... # decode any nip19 entity
149+ nostr-bray nips # browse official NIPs
150+ nostr-bray shell # interactive mode
151+
152+ Use 'nostr-bray <command> --help' for detailed help on any command.
153+
154+ Learn more:
155+ Guide: https://github.com/forgesworn/bray/blob/main/docs/guide.md
156+ Examples: https://github.com/forgesworn/bray/tree/main/examples
157+ npm: https://www.npmjs.com/package/nostr-bray`
134158
135159if ( command === 'help' || command === '--help' || command === '-h' ) {
136160 console . log ( HELP )
0 commit comments