v1.0.2 Now Available

Secure Chat directly from your Terminal

An elegant, terminal-based messaging tool powered by SSH cryptographic handshakes and libp2p NAT traversal. Connect securely with friends across firewalls—no setup required.

alice@chatssh:~
$ go run .\cmd\chatssh --mode server --user alice
Identity created successfully. Host key fingerprint: key:99e9d188b2ab
P2P Host listening on port 4001. Public key verification screen loaded.
[09:17:31] alice Welcome to OpenChat! Secure P2P communication channel active.
[09:17:45] ★ system bob joined the room
[09:18:02] bob Hey Alice! The terminal UI looks incredible. Let's test the encrypted history.
Local Encrypted Storage key:99e9d188b2ab listen:172.29.160.1:2222 peers:1

Decentralized & Encrypted by Default

OpenChat stands on three core technical pillars designed to provide modern communication without corporate logging servers.

SSH Cryptographic Security

Uses golang.org/x/crypto/ssh for credential verification. Complete with visual host-key fingerprint checks (emoji and randomart) to prevent Man-in-the-Middle (MITM) attacks.

libp2p NAT hole punching

Leverages go-libp2p transport. AutoNAT and DCUtR protocols attempt direct hole punching behind home routers, falling back to secure Circuit Relays if direct access fails.

Bubble Tea TUI

A reactive, modern split-screen terminal interface built with charmbracelet/bubbletea and styled dynamically with lipgloss, offering standard cursor controls and layout scaling.

Flexible Storage Configurations

Choose how your data is handled every time you launch the application.

PERSISTENT

Local Encrypted Storage

Persists chat messages inside an encrypted SQLite database using AES-GCM (passphrase-derived key). Perfect for retaining history securely across machine reboots.

  • SQLite local backend
  • Key derived via PBKDF2
  • Decrypt history on launch
EPHEMERAL

Ghost Mode

For high-privacy environments. Holds all messages strictly in volatile memory (RAM). When you exit, the memory is thoroughly scrubbed, leaving no trace on disk.

  • RAM-only cache
  • Auto-scrubbing on exit
  • Zero disk writes

How to Connect

Get started in seconds. One person hosts the room, and the other connects directly.

1. Start a Room (Host)

Binds to all interfaces and starts listening for client handshakes:

go run .\cmd\chatssh --mode server --addr :2222 --user alice
Check your status bar at the bottom for your local IP address!

2. Connect (Client)

Dial the server using the host's IP address (e.g. 172.29.160.1):

go run .\cmd\chatssh --connect "172.29.160.1:2222" --user bob
Windows users: always keep the address wrapped in quotes!

Open Source & Open to Contributions

OpenChat is completely open source under active development. Read the full CLI configurations in our documentation, build binaries for custom CPU architectures, or submit pull requests on GitHub.