| Crates.io | ndr |
| lib.rs | ndr |
| version | 0.0.43 |
| created_at | 2026-01-24 21:02:45.811616+00 |
| updated_at | 2026-01-25 12:04:10.449634+00 |
| description | CLI for encrypted Nostr messaging using double ratchet |
| homepage | |
| repository | https://files.iris.to/#/npub1xndmdgymsf4a34rzr7346vp8qcptxf75pjqweh8naa8rklgxpfqqmfjtce/nostr-double-ratchet |
| max_upload_size | |
| id | 2067491 |
| size | 180,791 |
CLI for encrypted Nostr messaging using the double ratchet protocol.
Designed for humans, AI agents, and automation. Compatible with chat.iris.to.
cargo install ndr
Or build from source:
cargo install --path .
# Login with a private key (hex or nsec)
ndr login <private_key>
# Check identity
ndr whoami
# Create an invite
ndr invite create
# Join someone's invite
ndr chat join <invite_url>
# Send a message
ndr send <chat_id> "Hello!"
# Read messages
ndr read <chat_id>
# Listen for new messages in real-time
ndr listen
Use --json flag for machine-readable output (for scripts and AI agents):
ndr --json whoami
ndr --json chat list
ndr --json send abc123 "Hello from automation"
ndr login <key> # Login with private key (hex or nsec)
ndr logout # Logout and clear data
ndr whoami # Show current identity
ndr invite create # Create new invite URL
ndr invite list # List pending invites
ndr invite delete <id> # Delete an invite
ndr invite listen # Listen for invite acceptances
ndr chat list # List all chats
ndr chat join <url> # Join via invite URL
ndr chat show <id> # Show chat details
ndr chat delete <id> # Delete a chat
ndr send <chat_id> <msg> # Send encrypted message
ndr read <chat_id> # Read message history
ndr listen # Listen for incoming messages
ndr listen --chat <id> # Listen on specific chat
ndr receive <event_json> # Decrypt a nostr event
Default data directory: ~/.local/share/ndr/ (Linux) or platform equivalent.
Override with --data-dir flag or NDR_DATA_DIR environment variable.
Create config.json in data directory to configure relays:
{
"relays": ["wss://relay.example.com"]
}
# Alice creates invite
ndr invite create
# Output: invite URL
# Alice listens for responses
ndr invite listen
# Bob joins (on his machine)
ndr chat join "https://..."
# Alice sees session created, can now send messages
ndr send <chat_id> "Hello Bob!"
# Agent receives message event from relay
event='{"kind":1060,"content":"...",...}'
# Decrypt and process
ndr --json receive "$event"
# Output: {"status":"ok","data":{"chat_id":"...","content":"Hello!"}}
# Reply
ndr --json send <chat_id> "I received your message"