Home Docs API CLI GitHub Web App Star on GitHub
πŸŽ‰ v2.0.1 β€” Nostr + P2P 硱合γƒͺγƒͺγƒΌγ‚Ή

The social network
for your terminal.

A decentralized, terminal-native SNS built on ed25519 elliptic curve cryptography. Every post is signed, every identity is your key β€” zero passwords, zero gatekeepers.

kb β€” Koshi Board CLI
$ kb register alice
βœ” Registration successful!
$ kb post "Hello, koshi! 🌊"
βœ” Post created!
$ kb feed --limit=5
πŸ“‹ Koshi Board Feed (5 posts)
────────────────────────────
alice @alice
Hello, koshi! 🌊
$
2.0.1
Latest Version
22
CLI Commands
28
API Endpoints
3
Protocols (REST + WS + P2P)
Features

Why Koshi?

πŸ’»

Terminal-Native

No browser bloat. Everything from posting to DMing is handled natively within your command line. Perfect with tmux or Zellij.

πŸ”

Cryptographic Identity

Your identity is your ed25519 public key. Secure authentication without passwords β€” every action is cryptographically signed.

⚑

Real-Time Feed

WebSocket-powered live updates. Connect to the stream and see posts, DMs, and presence changes as they happen.

πŸ“

Signed Posts

Every post carries an ed25519 signature, ensuring authenticity. Verify authorship without trusting a central authority.

βœ‰οΈ

Direct Messages

Signed, authenticated DMs with real-time delivery via WebSocket. Every message is verifiable and tamper-proof.

πŸ’¬

Real-Time Chat

Interactive DM chat mode with live WebSocket messaging. Connect to any user and chat in real-time with cryptographic signatures.

✏️

Profile Editing

Update your display name, bio, and avatar URL directly from the CLI with the kb edit-profile command.

πŸ› οΈ

Admin Controls

Built-in admin system with user management, account deletion with cascade, and admin privilege grants via dedicated API endpoints.

πŸ”‘

Nostr Protocol

Full Nostr integration: generate/manage nsec/npub keys, push koshi posts to Nostr relays, pull events from the Nostr network. Cross-post seamlessly between koshi and Nostr.

πŸ–§

P2P Sync

Hypercore-powered peer-to-peer synchronization. Your posts and DMs are replicated across connected peers via hyperswarm DHT. No central server needed for data distribution.

πŸ‘₯

Multi-Account

Manage multiple identities from a single CLI. Switch between accounts with kb switch, register or import Nostr keys per account. All credentials stored securely in ~/.config/koshi/config.json.

Quick Start

Get started in seconds

# Install Koshi globally
$ npm install -g @ryopc/koshi
# Register a new account (generates ed25519 keypair)
$ kb register alice
βœ” Registration successful!
# Post to the koshi board
$ kb post "Hello, koshi! 🌊"
βœ” Post created!
# View your feed
$ kb feed --limit=10
πŸ“‹ Koshi Board Feed (3 posts)
# Connect to real-time stream
$ kb realtime
πŸ“‘ Connecting to realtime feed...
βœ“ Connected! Waiting for new posts...
Architecture

How Koshi works

πŸ”§

Stack

Runtime Node.js 20+
Framework Express.js
Database PostgreSQL 15
Auth ed25519 + JWT
Real-time WebSocket (ws)
CLI Chalk + Ora
πŸ“

Project Structure

koshi/
β”œβ”€β”€ bin/
β”œβ”€β”€ cli.js # CLI entry point
└── server.js # Express + WS server
β”œβ”€β”€ src/
β”œβ”€β”€ api/ auth.js, users.js, posts.js, dms.js
β”œβ”€β”€ auth/ ed25519.js, jwt.js, utils.js
β”œβ”€β”€ db/ schema.sql, migrate.js, pool.js
β”œβ”€β”€ ws/ index.js, handlers.js
└── middleware/ auth.js, rateLimit.js
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ render.yaml # Render Blueprint
└── package.json
CLI

All Commands

CommandDescriptionAuth
kb register <username>Create a new account with ed25519 keypairNo
kb login <username>Authenticate using existing keypairNo
kb whoamiShow your profile informationYes
kb post <message>Create a new post on the boardYes
kb feed [--limit=N]Display your post feedOpt
kb follow <username>Follow a userYes
kb unfollow <username>Unfollow a userYes
kb dm <user> <msg>Send a direct messageYes
kb dms [--unread]View your direct messagesYes
kb chat <username>Interactive real-time DM chatYes
kb edit-profile <flags>Update your display name, bio, avatarYes
kb profile [username]View a user's profileOpt
kb search <query>Search users by usernameOpt
kb realtimeConnect to the live event streamYes
kb admin <cmd>Admin: users, delete-user, grant, revokeAdmin