Bash scripts to use nostr the Unix Way.
Relay and user subscription information is kept in a local config file:
cat ~/.config/nostr/cfg.json
- First install the nostr [cli](rubenvanstaden/nostr: Notes and Other Zettels Transmitted by Relays) written in Go.
{
"relays": [
"ws://localhost:8080"
],
}
- Install the script locally and set environment variables.
# Install path
export SCRIPT="$HOME/.local/bin"
# Relay to connect too.
export RELAY=ws://0.0.0.0:8080
make install
- First you need to add a relay to connect too.
nrelay --add 'ws://localhost:8080'
- First you have to follow a user via their public key (this includes yourself).
nfollow <npub>
- Request events from relay and pipe the JSON response to a more clean output.
nreq | nshow
- Publish text event to relay
nevent 'Hello friend'