cmdchat-cli
v0.1.0
Published
Omegle for programmers, over the terminal
Maintainers
Readme
cmdchat
Omegle for programmers, over the terminal. Fire it up, get randomly paired with a stranger, chat while you code. Text only, nothing persisted, no accounts.
How it works
server.js— a WebSocket server that holds a queue of waiting clients. As soon as 2 are waiting, it pairs them and relays messages between them.client.js— the CLI you actually run. Connects to the server, shows a prompt, prints incoming messages.
Run it locally
npm install
# terminal 1 — start the server
npm run server
# terminal 2 — connect as a client
npm start
# terminal 3 — connect as a second client, gets auto-matched with terminal 2
npm startCommands inside the client:
/skip— leave your current stranger, get requeued for a new match/quit— disconnect and exit
Tags and nicknames
Match with people who share an interest instead of pure random:
node client.js --tags rust,debugging --name sam
# short flags also work
node client.js -t rust,debugging -n samHow tag matching works:
- You're matched first against anyone waiting with an overlapping tag (best overlap wins)
- If nobody with a shared tag shows up within ~20 seconds, the search automatically widens to anyone waiting, so a niche tag never leaves you stuck forever
- No tags specified = you're in the general pool from the start, same as v1
Built-in safety (v2)
- Heartbeat — the server pings every connection every 30s; anyone who stops responding (closed laptop, dead wifi) gets dropped and their partner is automatically requeued instead of talking to a ghost
- Per-IP connection cap — max 5 concurrent connections per IP, so one person can't flood the queue
- Rate limiting — max 20 messages per 10 seconds per connection (unchanged from v1)
Deploying the server for free (Fly.io)
It's a plain Node process that speaks WebSocket on $PORT (defaults to 8080). Fly.io's free tier fits this well — it's built for long-lived processes, gives you wss:// (TLS) automatically, and doesn't sleep on idle like some free tiers do.
# from inside the cmdchat/ directory
curl -L https://fly.io/install.sh | sh # installs the flyctl CLI
fly auth signup # or fly auth login
fly launch # follow prompts, don't add a database
fly deployfly launch will generate a Dockerfile and fly.toml for you — accept the defaults (Node app, no Postgres/Redis needed). Once deployed you'll get a URL like your-app-name.fly.dev; point clients at it with wss://:
CMDCHAT_SERVER=wss://your-app-name.fly.dev node client.jsWhat's still NOT in here
- No accounts, no persistent history — matches Omegle's throwaway feel
- No voice/video — text only
- No
/reportmechanism or profanity/spam filter — worth adding before any real public traffic - No TLS built in — the server speaks plain
ws://; for a public deploy you needwss://, which most hosts (Fly.io included) give you automatically via their reverse proxy
Suggested next steps
- Deploy the server somewhere with a real domain +
wss://(TLS) — see deploy notes above - Publish
client.jsas an npm package so people can donpx cmdchatinstead of cloning the repo - Add
/skipcooldown so people can't instantly re-roll to dodge a bad match - Add a
/reportcommand that logs the offending message + both nicknames somewhere you can review
