OpenChat (ChatSSH)

OpenChat (originally ChatSSH) is a secure, terminal-based, decentralized chat application. It combines cryptographic SSH channels, Bubble Tea text user interface (TUI) aesthetics, and go-libp2p peer-to-peer transport with NAT hole punching.
Precompiled Downloads
Get the precompiled executable directly for your operating system:
Useful Reference Guides
Learn more about using and configuring OpenChat:
- π Quick Start Guide β Step-by-step instructions on starting your first server and connecting clients.
- βοΈ CLI Flags Reference β Complete configuration index for running custom settings via command-line arguments.
- π System Design Document β Architectural layout, wire frames, connection models, and cryptographic details.
- π§ Security & Debugging Audit β Historical overview of issues resolved during security hardening (UTF-8, goroutine leaks, handshake retry logic).
Core Features
- Interactive TUI Setup Wizard: Starts automatically if you launch the application without CLI arguments (e.g. when double-clicking the binary). Walk through step-by-step options (Username, Hosting vs. Connecting, Storage type) completely in the terminal.
- Premium Bubble Tea UI: Fully responsive terminal layout using Bubble Tea, rendering message feeds, colored timestamps, dynamic hashed username coloring, and a powerline-style status bar.
- SSH Encrypted Transport: Uses standard SSH protocols to execute encrypted end-to-end handshakes. Incorporates visual fingerprint checks (Randomart and Emojiart) for MitM verification.
- Decentralized NAT Traversal: Leverages P2P networking powered by
libp2p. Autodetects networks, performs NAT hole-punching (DCUtR), and falls back to Circuit Relays to connect nodes behind firewalls automatically.
- Flexible Storage Profiles:
- Local Encrypted Storage (Default): Saves chat history inside a local SQLite database encrypted with AES-256 (passphrase-derived key).
- Ghost Mode: Volatile RAM-only message caching. Wipes and scrubs all chats from memory upon application termination, writing zero bytes to the disk.
Build from Source
Prerequisites
- Go 1.22+ installed.
- GCC (Optional, for running tests).
Compile Binary
go build -o OpenChat ./cmd/chatssh
Quick Start
1. Launch Setup Wizard
Double-click the downloaded binary file or run the compiled executable without parameters to load the interactive setup wizard:
./OpenChat
2. Connect from Terminal (CLI Option)
If you prefer to bypass the setup wizard and launch directly using the command line:
Project Directory Layout
cmd/chatssh/ Application main entrypoint
internal/
app/ Application setup, CLI parsing, and interactive setup wizard
chat/ Event hub and subscriber mechanisms
crypto/ Key exchange and fingerprint utilities
keys/ Ed25519 secure key management
p2p/ libp2p network stacks and NAT routing
room/ Multiplexed room broadcasters
sshclient/ SSH client wrapper
sshserver/ SSH server implementation
storage/ AES-GCM SQLite database and Ghost storage handlers
tui/ Bubble Tea view and components
DesignSystem/ Original architecture design definitions
WebView/ Stunning 3D P2P landing page website assets
Contributing
We welcome contributions to OpenChat! To contribute:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/NewFeature).
- Commit your changes (
git commit -m "Add some NewFeature").
- Push to the branch (
git push origin feature/NewFeature).
- Open a Pull Request.