ndr
CLI for encrypted Nostr messaging using the double ratchet protocol.
Designed for humans, AI agents, and automation. Compatible with chat.iris.to.
Installation
Or build from source:
Quick Start
# Login with a private key (hex or nsec)
# Check identity
# Create an invite
# Join someone's invite
# Send a message
# Read messages
# Listen for new messages in real-time
JSON Mode
Use --json flag for machine-readable output (for scripts and AI agents):
Commands
Identity
Invites
Chats
Messages
Configuration
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:
Examples
Create an invite and wait for response
# Alice creates invite
# Output: invite URL
# Alice listens for responses
# Bob joins (on his machine)
# Alice sees session created, can now send messages
AI Agent Integration
# Agent receives message event from relay
event='{"kind":1060,"content":"...",...}'
# Decrypt and process
# Output: {"status":"ok","data":{"chat_id":"...","content":"Hello!"}}
# Reply