akiomik/nostui

A TUI client for Nostr

★ 71Forks 7RustGitHub ↗Compare
nostrratatuisocial-media-apptui

README

nostui

crates.io CI codecov

A TUI client for Nostr

screenshot

Current Features

  • Timeline
  • Mention timeline
  • Post, reply, react and repost
  • Open per-user timelines as tabs
  • Broadcast the currently playing track as a music status (NIP-38)

Getting Started

Dowonload binaries from the release page.

Or, install manually via crates.io:

cargo install nostui

On NetBSD, a package is available from the official repositories. To install it, simply run:

pkgin install nostui

Setup

Note

Other extensions supported are .json5, .yaml, .toml and .ini.

  1. Create a config.json to the following path:
  • Linux: ~/.config/nostui/config.json
  • Windows: %LOCALAPPDATA%\0m1\nostui\config\config.json
  • macOS: ~/Library/Application Support/io.0m1.nostui/config.json
  1. Add your key to the config.json:
{
    "key": "nsec1...",
    "relays": ["wss://nos.lol"]
}

key takes an npub... instead for read-only mode, and relays is optional — without it nostui uses its own list.

"nip-38": { "enabled": true } is another key you can add. It broadcasts whatever you are playing as a NIP-38 status, to the relays above, where anyone can read it. It is off unless you write it.

Every example here is JSON, and each is one object: keys from more than one go together inside a single pair of braces rather than one block after another. Comments belong to config.json5, which is read as JSON5 — config.json is read as JSON, which has none.

Usage

Commands

nostui

Options:
  -h, --help     Print help
  -V, --version  Print version

Default Keybindings

Keybinding Description
k up Scroll up
j down Scroll down (load more at bottom)
home g Scroll to top
end Shift-g Scroll to bottom
esc Unselect
n New text note
Ctrl-p Submit text note
r Reply to the selected note
f Send reaction
t Repost
i Open the author's timeline as a tab
m Open the mention timeline as a tab
h left Switch to the previous tab
l right Switch to the next tab
Ctrl-w Close the current tab
q Ctrl-c Ctrl-d Quit

Customizing Keybindings

You can override or add keybindings in your config file under keybindings.Home. Your settings are merged on top of the defaults, so you only need to list the keys you want to change.

{
    "keybindings": {
        "Home": {
            "<Ctrl-r>": "Repost",
            "<t>": "ScrollToTop"
        }
    }
}

The first of those binds another key to an action; the second rebinds one the defaults already use.

Each key is written between < and >. Modifiers are joined with - (e.g. <Ctrl-p>, <Shift-g>, <Alt-Enter>). Special keys such as up, down, home, end, esc, enter, tab and space are also supported.

Note

Because your settings are merged on top of the defaults, default keybindings cannot be removed. You can only add new keys or rebind a key to a different action.

The following actions are available:

Action Description
ScrollUp Scroll up
ScrollDown Scroll down (load more at bottom)
ScrollToTop Scroll to top
ScrollToBottom Scroll to bottom
Unselect Unselect the selected note
NewTextNote Show the text note input form
ReplyTextNote Reply to the selected note
SubmitTextNote Submit the text note on input form
React Send a reaction to the selected note
Repost Repost the selected note
OpenAuthorTimeline Open the author's timeline as a tab
OpenMentionTab Open the mention timeline as a tab
CloseCurrentTab Close the current tab
PrevTab Switch to the previous tab
NextTab Switch to the next tab
Quit Quit the application

Architecture

For how the codebase is organised — the layers, their dependency direction, and the contracts between them — see docs/architecture.md.

Contributing

Conventions the tooling does not check — commit messages, how tests are named and what they have to prove, the local checks before pushing — are in CONTRIBUTING.md.

Contributors

akiomikdependabot[bot]Hakkadaikon0323pin

Issues