A human and bot-friendly command-line interface for the Nostr protocol. Post notes, send encrypted DMs, manage accounts — all from your terminal.
Switch between identities like git branches. Each account has its own keys, relays, and aliases.
Use aliases and NIP-05 usernames instead of raw npubs. nostr dm xavier just works.
Pipes, scripts, cron jobs. echo "hello" | nostr — compose with any tool.
NIP-17 gift-wrapped DMs with typing indicators. NIP-04 legacy supported. Interactive chat with Shift+Enter multiline.
nostr profile user -n 10 — view profiles with past events, filter by kind, live-stream with --watch.
Live feed, posting, and slash commands. Multiline with Shift+Enter. Like a tiny Nostr client in your terminal.
nostr nip 01 fetches and renders any NIP specification right in your terminal.
Publish NIP-23 articles from markdown files with YAML frontmatter. nostr post -f article.md
--jsonl for streaming, --json for inspection, NIP-05 identities, and bot: true (NIP-24). Built for bots.
| Social | |
| nostr post [message] | Post a text note (kind 1). Reads from stdin if piped. |
| nostr post -f article.md | Publish long-form content (NIP-23, kind 30023) |
| nostr reply <eventId> [msg] | Reply with NIP-10 threading |
| nostr dm [user] [message] | Send NIP-17 gift-wrapped DM, interactive chat, or stream with --watch |
| nostr events --kinds <n> | Query events from relays (filter by kind, time, author) |
| nostr event new --kind <n> | Create and publish a raw event of any kind |
| nostr follow [user] | Follow a user (--alias, --json) |
| nostr profile [user] -n 10 | View profile and past events (--kinds, --watch) |
| nostr [user] | View a user's profile and latest notes |
| nostr [user] --watch | Live-stream a user's new notes |
| nostr --watch | Stream notes from all followed accounts |
| Account | |
| nostr login | Create a new account or import an existing nsec |
| nostr switch [account] | Switch between accounts |
| nostr profile | Show your current profile (kind 0 metadata) |
| nostr profile update | Interactively update your profile metadata |
| nostr accounts | List all local accounts |
| Infrastructure | |
| nostr relays | Manage relays (add, remove, check status) |
| nostr sync | Sync local events with relays |
| nostr alias [name] [npub|nip05] | Create an alias for quick access |
| nostr generate nip05 | Generate a NIP-05 nostr.json file (setup guide) |
| Reference | |
| nostr nip [number] | View a NIP specification in the terminal |
| nostr version | Print version info |
| nostr update | Check for updates and self-update |
A <user> can be an alias, npub, or NIP-05 address (e.g. user@domain.com).
Most commands support --json, --jsonl, and --raw for machine-readable output.
Colors are auto-disabled when stdout is piped.
nostr-cli is designed for bots and AI agents. Colors are auto-disabled when piped.
Use --jsonl for streaming, --json for inspection, and --raw for wire-format events.
Query events with flexible filters, stream DMs, and create raw events of any kind.
An AGENTS.md is included at the repo root for tools that auto-load it (Codex, Cursor, Augment, Gemini). See also: llms.txt · skill/SKILL.md