Skip to content

A unique non-blocking command-line chat app. Supports markdown messages and voice calls.

Notifications You must be signed in to change notification settings

midnqp/chatnet-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is an experimental chat application that is designed to be non-blocking.

Meaning, while writing a message in stdin the app can continue receiving messages and continue printing to stdout simultaneously. At first, this may sound obvious. For command-line applications, however, this isn't the case. Since reading input from the terminal is a synchronous operation, receiving messages ought to run asynchronously or in the background. In that case, if the app prints a received message "Chatnet released yet?" when the user is typing a message to send "How's been everyth...", then the resulting garbled text would be "How's been everythChatnet released yet?ing?"

This project solves this problem.

What's Unique ✨

To solve the problem, this project follows the async multiplexing approach as developed by @antirez on his linenoise project. This allows for a minimal interface without hijacking the entire terminal screen as done by libraries like ncurses. This idea is a challenge to implement, which could be why there are exceptionally few terminal interfaces that take stdin input while printing to stdout at the exact same time.

This approach may serve as an inspiration to build more sophisticated terminal applications that are more engaging and delightful to work with as developers!

Usage

To install and get started, run:

$ npm i -g chatnet-cli
$ chatnet-cli

After that, you should already start seeing previous chat history and the realtime chat of global chatroom.

To start sending messages, choose a unique username with /name:

<username-not-set>: /name my-name
chatnet: a person just signed up: my-name
my-name: my first message!

To start a voice call, append the recepient's username after the /call command:

my-name: /call my-friend

How it works

Upcoming!

About

A unique non-blocking command-line chat app. Supports markdown messages and voice calls.

Topics

Resources

Stars

Watchers

Forks