Home Docs API CLI GitHub Web App Star on GitHub
🎉 v3.0.0 — Serverless P2P Mesh

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! 🌊
$
3.0.0
Latest Version
24
CLI Commands
32
API Endpoints
4
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...
# Start local server (Web UI + P2P mesh + WebSocket)
$ kb serve
🖥️ koshi server — serverless P2P node
Web UI: http://127.0.0.1:3000
Architecture

How Koshi works

🔧

Stack

Runtime Node.js 20+
Framework Express.js
Database SQLite (default) / PostgreSQL
Auth ed25519 + JWT
Real-time WebSocket (ws)
CLI Chalk + Ora
📁

Project Structure

koshi/
├── bin/
├── cli.js # CLI entry point (kb command)
└── server.js # Express + WS server (PostgreSQL mode)
├── src/
├── local/ db.js, api.js, server.js, p2p-bridge.js # Serverless SQLite+P2P
├── 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
├── p2p/ hypercore + hyperswarm mesh
├── nostr/ nsec/npub, relay push/pull
└── middleware/ auth.js, rateLimit.js
├── client/ # React Web UI (Vite)
├── web/ # Built static files for serving
├── 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 serve [--port=N] [--daemon]Start local serverless node (SQLite+P2P+Web UI)No
kb connect <url>Connect to a remote server / --reset for local modeNo
kb admin <cmd>Admin: users, delete-user, grant, revokeAdmin
kb p2p <cmd>P2P node: status, sync, peersNo
kb nostr <cmd>Nostr: key, relay, push, pullYes