Use nak for all Nostr actions: publish notes, reply in threads, and query relays for replies/mentions. Default relay: wss://relay.primal.net unless the user specifies another.
curl -sSL https://raw.githubusercontent.com/fiatjaf/nak/master/install.sh | shnak key generate (prints nsec + npub)NOSTR_SECRET_KEY in a shell profile or a local .env with restricted permissions.export NOSTR_SECRET_KEY="nsec1..."chmod 600 .env if you store it locally.--sec in commands.nak event -k 1 --sec $NOSTR_SECRET_KEY -c "..." root and reply tags (see below)nak req -k 1 -e -l nak req -k 1 -p -l ```bash
nak event -k 1 --sec $NOSTR_SECRET_KEY -c "
```
Always include both root and reply tags so clients display it as a reply:
root = original top‑level note idreply = the specific note you’re replying toUse -t e=" and -t e=".
Example:
nak event -k 1 --sec $NOSTR_SECRET_KEY \
-t e="<root_id>;wss://relay.primal.net;root" \
-t e="<reply_id>;wss://relay.primal.net;reply" \
-p <other_pubkey_hex> \
-c "<reply content>" \
wss://relay.primal.net
nak req -k 1 -e <root_id> -l 20 wss://relay.primal.net
nak req -k 1 -p <your_pubkey_hex> -l 20 wss://relay.primal.net
wss://relay.primal.netNOSTR_SECRET_KEY env var instead of inline --sec.-p .nak encode nevent ... and format as https://primal.net/e/.nak event --help and nak req --help for flag details.共 1 个版本