nostril

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

nostril.1 (3257B)


      1 .\" Generated by scdoc 1.11.3
      2 .\" Complete documentation for this program is not available as a GNU info page
      3 .ie \n(.g .ds Aq \(aq
      4 .el       .ds Aq '
      5 .nh
      6 .ad l
      7 .\" Begin generated content:
      8 .TH "nostril" "1" "1980-01-01"
      9 .PP
     10 .SH NAME
     11 .PP
     12 nostril - generate nostr events
     13 .PP
     14 .SH SYNPOSIS
     15 .PP
     16 \fBnostril\fR [OPTIONS.\&.\&.\&]
     17 .PP
     18 .SH DESCRIPTION
     19 .PP
     20 \fBnostril\fR is a tool that creates and signs nostr events.\&
     21 .PP
     22 .SH OPTIONS
     23 .PP
     24 \fB--content\fR
     25 .RS 4
     26 The text contents of the note
     27 .PP
     28 .RE
     29 \fB--dm\fR <hex pubkey>
     30 .RS 4
     31 Create a direct message.\& This will create a kind-4 note with the
     32 contents encrypted>
     33 .PP
     34 .RE
     35 \fB--envelope\fR
     36 .RS 4
     37 Wrap the event with `["EVENT", .\&.\&.\& ]` for easy relaying
     38 .PP
     39 .RE
     40 \fB--giftwrap-to\fR <hex pubkey>
     41 .RS 4
     42 Wrap a note with a giftwrap to a specific pubkey
     43 .PP
     44 .RE
     45 \fB--kind\fR <number>
     46 .RS 4
     47 Set the kind of the note
     48 .PP
     49 .RE
     50 \fB--created-at\fR <unix timestamp>
     51 .RS 4
     52 Set the created at.\& Optional, this is set automatically.\&
     53 .PP
     54 .RE
     55 \fB--sec\fR <hex seckey>
     56 .RS 4
     57 Set the secret key for signing, otherwise one will be randomly generated.\&
     58 .PP
     59 .RE
     60 \fB--mine-pubkey\fR
     61 .RS 4
     62 Mine a pubkey.\& This may or may not be cryptographically dubious.\&
     63 .PP
     64 .RE
     65 \fB--pow\fR <difficulty>
     66 .RS 4
     67 Number of leading 0 bits of the id the mine for proof-of-work.\&
     68 .PP
     69 .RE
     70 \fB--tag\fR <key> <value>
     71 .RS 4
     72 Add a tag with a single value
     73 .PP
     74 .RE
     75 \fB--tagn\fR <N> <value * N .\&.\&.\&>
     76 .RS 4
     77 Add a tag with 0 or more elements
     78 .PP
     79 .RE
     80 \fB-t\fR
     81 .RS 4
     82 Shorthand for --tag t <hashtag>
     83 .PP
     84 .RE
     85 \fB-p\fR
     86 .RS 4
     87 Shorthand for --tag p <hex pubkey>
     88 .PP
     89 .RE
     90 \fB-e\fR
     91 .RS 4
     92 Shorthand for --tag e <note id>
     93 .PP
     94 .PP
     95 .RE
     96 .SH Examples
     97 .PP
     98 \fBGenerate an event\fR
     99 .PP
    100 .nf
    101 .RS 4
    102 $ \&./nostril --sec <key> --content "this is a message"
    103 {
    104 	"id": "da9c36bb8206e748cf136af2a43613a5ee113cb5906a09a8d3df5386039d53ab",
    105 	"pubkey": "4f6fa8547cf2888415522918175ea0bc0eb473287c5bd7cc459ca440bdf87d97",
    106 	"created_at": 1660750302,
    107 	"kind": 1,
    108 	"tags": [],
    109 	"content": "this is a message",
    110 	"sig": "3e4d7d93522e54f201a22944d4d37eb4505ef1cf91c278a3f7d312b772a6c6509d1e11f146d5a003265ae10411a20057bade2365501872d2f2f24219730eed87"
    111 }
    112 .fi
    113 .RE
    114 .PP
    115 \fBWrap event to send to a relay\fR
    116 .PP
    117 .nf
    118 .RS 4
    119 $ \&./nostril --envelope --sec <key> --content "hello"
    120 [ "EVENT",
    121 {
    122 	"id": "ed378d3fdda785c091e9311c6e6eeb075db349a163c5e38de95946f6013a8001",
    123 	"pubkey": "fd3fdb0d0d8d6f9a7667b53211de8ae3c5246b79bdaf64ebac849d5148b5615f",
    124 	"created_at": 1649948103,
    125 	"kind": 1,
    126 	"tags": [],
    127 	"content": "hello",
    128 	"sig": "9d9a49bbc66d4782030b24c71416965e790214d02a54ab132d960c2b02def0371c3d93e5a60a285c55e99721599d1332450731e2c6bb1114b96b591c6967f872"
    129 } ]
    130 .fi
    131 .RE
    132 .PP
    133 \fBSend to a relay\fR
    134 .PP
    135 .nf
    136 .RS 4
    137 nostril --envelope --sec <key> --content "this is a message" | websocat wss://relay\&.damus\&.io
    138 .fi
    139 .RE
    140 .PP
    141 \fBSend a nip04 DM\fR
    142 .PP
    143 .nf
    144 .RS 4
    145 nostril --envelope --dm <pubkey> --sec <key> --content "this is a secret" | websocat wss://relay\&.damus\&.io
    146 .fi
    147 .RE
    148 .PP
    149 \fBMine a pubkey\fR
    150 .PP
    151 .nf
    152 .RS 4
    153 nostril --mine-pubkey --pow <difficulty>
    154 .fi
    155 .RE
    156 .PP
    157 \fBReply to an event.\& nip10 compliant, includes the `thread_id`\fR
    158 .PP
    159 .nf
    160 .RS 4
    161 \&./nostril --envelope --sec <key> --content "this is reply message" --tag e <thread_id> --tag e <note_id> | websocat wss://relay\&.damus\&.io
    162 .fi
    163 .RE