README.md (2197B)
1 2 # nostril 3 4 A cli util for creating nostr events 5 6 ## Dependenices 7 8 `libsecp256k1` is the only dependency 9 10 ## Usage 11 12 usage: nostril [OPTIONS] --content <content> 13 14 OPTIONS 15 16 --dm <hex pubkey> make an encrypted dm to said pubkey. sets kind and tags. 17 --envelope wrap in ["EVENT",...] for easy relaying 18 --kind <number> set kind 19 --created-at <unix timestamp> set a specific created-at time 20 --sec <hex seckey> set the secret key for signing, otherwise one will be randomly generated 21 --pow <difficulty> number of leading 0 bits of the id to mine 22 --tag <key> <value> add a tag 23 -e <event_id> shorthand for --tag e <event_id> 24 -p <pubkey> shorthand for --tag p <pubkey> 25 26 ## Examples 27 28 Generate an event: 29 30 $ ./nostril --sec <key> "this is a message" 31 { 32 "id": "b5c18a4aa21231a77b09748a5e623d9c2f853aed09653934b80a10b66a7225fa", 33 "pubkey": "fd3fdb0d0d8d6f9a7667b53211de8ae3c5246b79bdaf64ebac849d5148b5615f", 34 "created_at": 1649948031, 35 "kind": 1, 36 "tags": [], 37 "content": "testing something again", 38 "sig": "5122b2fc0d9a1f1ca134e4ab6fc1c9e5795e2d558cf24e3c7d8c4a35f889130eebcbd604602092a89c8a48469e88753e08dabb472610ac628ec9db3aa6c24672" 39 } 40 41 Wrap event to send to a relay: 42 43 $ ./nostril --envelope --sec <key> "hello" 44 [ 45 "EVENT", 46 { 47 "id": "ed378d3fdda785c091e9311c6e6eeb075db349a163c5e38de95946f6013a8001", 48 "pubkey": "fd3fdb0d0d8d6f9a7667b53211de8ae3c5246b79bdaf64ebac849d5148b5615f", 49 "created_at": 1649948103, 50 "kind": 1, 51 "tags": [], 52 "content": "hello", 53 "sig": "9d9a49bbc66d4782030b24c71416965e790214d02a54ab132d960c2b02def0371c3d93e5a60a285c55e99721599d1332450731e2c6bb1114b96b591c6967f872" 54 } 55 ] 56 57 Send to a relay: 58 59 $ ./nostril --envelope --sec <key> "this is a message" | websocat wss://nostr-pub.wellorder.net 60 61 Send a nip04 DM: 62 63 $ ./nostril --envelope --dm <pubkey> --sec <key> "this is a secret" | websocat wss://nostr-pub.wellorder.net 64