A lightweight local area network chat application that enables real-time communication between WiFi-connected devices.
Sending a quick message from your phone to your laptop or to a colleague’s device is surprisingly frustrating. Most solutions require WhatsApp, Telegram, or cloud apps, which is overkill for a single text. LanText solves this by providing direct, local, real-time messaging with minimal setup.
- Beautiful Terminal UI: Claude Code-inspired interface with rich colors, animated spinners, and an interactive select menu.
- Auto-discovery: Automatically finds the chat server on the network
- Multiple clients: Support for multiple simultaneous connections
- Hotspot mode: WiFi hotspot devices can both host and participate in chat
- Real-time messaging: Instant message delivery across the network
- Global CLI: Install once, run anywhere with
lantextcommand
npm install -g lantextnpm install lantextSimply run lantext and choose your mode:
lantextThe CLI will ask you whether you want to be a WiFi client (connect to existing network) or hotspot (create server).
You can also specify the mode directly:
# Connect as WiFi client
lantext client
# or
lantext wifi
# Start as hotspot server
lantext hotspot
# or
lantext serverLanText supports sending multiple lines of text as a single message. To send a multi-line message:
- Type your first line and press Enter
- Continue typing additional lines, pressing Enter after each line
- When done, press Enter again on an empty line to send the entire message
Example:
❯ Line 1 of my message
❯ Line 2 of my message
❯ Line 3 of my message
✓ Sent 12:34:56
│ Line 1 of my message
│ Line 2 of my message
│ Line 3 of my message
❯
DEBUG=true lantext clientSERVER=192.168.1.5 lantext clientLanText is built on a peer-to-peer discovery model using UDP for finding servers and TCP for reliable messaging.
- Client (
src/client.js): Discovers and connects to a server on the network. Implements a multi-line input buffer for seamless typing. - Hotspot (
src/hotspot.js): Runs both a TCP server and a discovery responder. It broadcasts messages to all connected clients. - Main (
src/main.js): CLI entry point that handles interactive mode and argument parsing. - UI (
src/ui.js): Shared module for consistent terminal styling, banners, and message formatting.
For a deep dive into the technical implementation, see ARCHITECTURE.md.
Environment variables:
DEBUG=true- Enable debug loggingSERVER=<ip>- Specify server IP address (skips discovery)
MIT
