nostril

A C cli tool for creating nostr events
git clone git://jb55.com/nostril
Log | Files | Refs | Submodules | README | LICENSE

README.md (2363B)


      1 nostril(1)
      2 
      3 # NAME
      4 
      5 nostril - generate nostr events
      6 
      7 # SYNPOSIS
      8 
      9 *nostril* [OPTIONS...]
     10 
     11 # DESCRIPTION
     12 
     13 *nostril* is a tool that creates and signs nostr events.
     14 
     15 # OPTIONS
     16 
     17 *--content*
     18 	The text contents of the note
     19 
     20 *--dm* <hex pubkey>
     21 	Create a direct message. This will create a kind-4 note with the
     22 	contents encrypted>
     23 
     24 *--envelope*
     25 	Wrap the event with `["EVENT", ... ]` for easy relaying
     26 
     27 *--kind* <number>
     28 	Set the kind of the note
     29 
     30 *--created-at* <unix timestamp>
     31 	Set the created at. Optional, this is set automatically.
     32 
     33 *--mine-pubkey*
     34 	Mine a pubkey. This may or may not be cryptographically dubious.
     35 
     36 *--pow* <difficulty>
     37 	Number of leading 0 bits of the id the mine for proof-of-work.
     38 
     39 *--tag* <key> <value>
     40 	Add a tag with a single value
     41 
     42 *-t*
     43 	Shorthand for --tag t <hashtag>
     44 
     45 *-p*
     46 	Shorthand for --tag p <hex pubkey>
     47 
     48 *-e*
     49 	Shorthand for --tag e <note id>
     50 
     51 
     52 # Examples
     53 
     54 *Generate an event*
     55 
     56 ```
     57 $ ./nostril --sec <key> --content "this is a message"
     58 {
     59 	"id": "da9c36bb8206e748cf136af2a43613a5ee113cb5906a09a8d3df5386039d53ab",
     60 	"pubkey": "4f6fa8547cf2888415522918175ea0bc0eb473287c5bd7cc459ca440bdf87d97",
     61 	"created_at": 1660750302,
     62 	"kind": 1,
     63 	"tags": [],
     64 	"content": "this is a message",
     65 	"sig": "3e4d7d93522e54f201a22944d4d37eb4505ef1cf91c278a3f7d312b772a6c6509d1e11f146d5a003265ae10411a20057bade2365501872d2f2f24219730eed87"
     66 }
     67 ```
     68 
     69 *Wrap event to send to a relay*
     70 
     71 ```
     72 $ ./nostril --envelope --sec <key> --content "hello"
     73 [ "EVENT",
     74 {
     75 	"id": "ed378d3fdda785c091e9311c6e6eeb075db349a163c5e38de95946f6013a8001",
     76 	"pubkey": "fd3fdb0d0d8d6f9a7667b53211de8ae3c5246b79bdaf64ebac849d5148b5615f",
     77 	"created_at": 1649948103,
     78 	"kind": 1,
     79 	"tags": [],
     80 	"content": "hello",
     81 	"sig": "9d9a49bbc66d4782030b24c71416965e790214d02a54ab132d960c2b02def0371c3d93e5a60a285c55e99721599d1332450731e2c6bb1114b96b591c6967f872"
     82 } ]
     83 ```
     84 
     85 *Send to a relay*
     86 
     87 ```
     88 nostril --envelope --sec <key> --content "this is a message" | websocat wss://relay.damus.io
     89 ```
     90 
     91 *Send a nip04 DM*
     92 
     93 ```
     94 nostril --envelope --dm <pubkey> --sec <key> --content "this is a secret" | websocat wss://relay.damus.io
     95 ```
     96 
     97 *Mine a pubkey*
     98 
     99 ```
    100 nostril --mine-pubkey --pow <difficulty>
    101 ```
    102 
    103 *Reply to an event. nip10 compliant, includes the `thread_id`*
    104 
    105 ```
    106 ./nostril --envelope --sec <key> --content "this is reply message" --tag e <thread_id> --tag e <note_id> | websocat wss://relay.damus.io
    107 ```