Skip to content

psic4t/nospeak-cli

Repository files navigation

Nospeak

nospeak is a terminal-based Nostr chat client built with Go. Nospeak provides a secure, decentralized messaging experience through the Nostr protocol with both TUI and CLI interfaces.

Features

  • Terminal User Interface (TUI) - Interactive chat interface with contact list and message history
  • Command Line Interface (CLI) - Scriptable commands for sending/receiving messages
  • End-to-end encryption - Private messaging using NIP-44 v2 encryption protocol
  • Sealed direct messages - NIP-59 gift wraps provide metadata protection and sender verification
  • Outbox Model - Uses NIP-65 Inbox/Outbox relays for contacts
  • Message caching - SQLite caching for message persistence
  • Real-time relay monitoring - Live connection status and health monitoring for all configured relays

Installation

From Source

make install

Using Go

go install github.com/psic4t/nospeak@latest

Quick Start

  1. Initialize configuration and create a new keypair:

    nospeak
    # Edit ~/.config/nospeak/config.toml to add existing keys
  2. Set username and mailbox relays from config if needed

    nospeak set-name <your desired username>
    nospeak messaging-relays [relay_url:r,relay_url:w,...]
  3. Start the TUI interface:

    nospeak
  4. Add some npubs in Settings (F1)

Usage

TUI Mode (Default)

Launch the interactive terminal interface:

nospeak

TUI Keyboard Shortcuts:

  • Ctrl+c / Ctrl+q - Quit application
  • Ctrl+r - Refresh all profiles and relays (bypasses cache TTL)
  • Tab - Switch between contact list and input
  • Enter - Send message (when in input field)
  • PgUp / PgDn - Scroll message pane up/down
  • Ctrl+k / Ctrl+j - Switch between contacts (k=up, j=down)
  • Ctrl+p - Show profile information for current contact
  • F1 - Show settings
  • F2 - Show relay connections (view connection status, health metrics, and relay statistics)
  • F3 - Toggle contacts pane
  • / - Navigate contact list

Automatic Profile Refresh:

  • Profiles and relay lists are automatically refreshed 10 seconds after application startup to ensure fresh data
  • Manual refresh is still available via Ctrl+r at any time

CLI Commands

Send a message:

nospeak send <npub> "Your message here"

Listen for messages:

nospeak receive

Set your profile name:

nospeak set-name "Your Name"

Manage messaging relays:

# View current messaging relays
nospeak messaging-relays

# Set messaging relays (optional :r for read-only, :w for write-only)
nospeak messaging-relays wss://relay1.com,wss://relay2.com:r,wss://relay3.com:w

Generate new Nostr identity:

nospeak new-identity

Development

Building

# Development build
make dev

# Production build with SQLite support
make release

# Static build without SQLite
make release-static

# Install to system
make install

Message Flow

  1. Message Creation: Content is encrypted using NIP-44 v2 with a conversation key derived from sender and recipient keys
  2. Gift Wrapping: The encrypted message (kind 14) is sealed in a NIP-59 gift wrap (kind 1059/62)
  3. Transport: Gift wrapped messages are published to configured relays
  4. Reception: Clients subscribe to gift wrap events, unwrap them to reveal the inner rumor, then decrypt the content

About

Questions? Ideas? File bugs and TODOs through the issue tracker!

About

nospeak is a terminal-based Nostr chat client

Resources

License

Stars

Watchers

Forks

Packages

No packages published