go-chat is a gRPC based chat CLI written in golang for command line lovers

go-chat

go-chat is a gRPC based chat CLI written in golang for command line lovers. This CLI allows you to chat with your friends without leaving the command line.

Installation

This CLI was built with go 1.17.

go install github.com/piyushjajoo/go-chat@latest

If you have an older version of go, go install might not work. Try following command -

export GO111MODULE=on
go get github.com/piyushjajoo/go-chat@latest
go install github.com/piyushjajoo/go-chat
export PATH=$PATH:$GOPATH/bin

Go chat help

$ go-chat 
go-chat is an interactive gRPC based command line chat application. This application
allows you to chat with anyone in the world securely through command line, so you never have to leave
your terminal.

NOTE: this doesn't persist any messages, so feel free to be anonymous.'

Usage:
  go-chat [command]

Available Commands:
  completion  generate the autocompletion script for the specified shell
  help        Help about any command
  server      server starts the chat server for you
  with        with sub-command let's you specify who you want to chat with

Flags:
      --config string   config file (default is $HOME/.go-chat.yaml)
  -h, --help            help for go-chat

Use "go-chat [command] --help" for more information about a command.

Start the server

go-chat server --port 8080

Go chat server sub-command help

$ go-chat server --help
server allows you to start your own chat server and that way you can allow others to chat with you.
The server doesn't store any messages so never worry while using this in your terminal'

Usage:
  go-chat server [flags]

Flags:
  -h, --help          help for server
  -p, --port string   Port on which you want to start the server, default 8080 (default "8080")

Global Flags:
      --config string   config file (default is $HOME/.go-chat.yaml)

Connect clients and chat

go-chat with --remove-server-host localhost:8080 --name Piyush --chatting-with Jon,Jim

Go chat with sub-command help

$ go-chat with --help
with sub-command let's you specify who you chat with

Usage:
  go-chat with [flags]

Flags:
  -c, --chatting-with string        comma separated list of users names on the remote host you want to chat with e.g. A,B,C, default is you can chat with all (default "all")
  -h, --help                        help for with
  -n, --name string                 your display name you want users to see e.g. Piyush
  -s, --remove-server-host string   Remote server host where you want to join chat e.g 10.11.12.13:8080, default is localhost (default "localhost:8080")

Global Flags:
      --config string   config file (default is $HOME/.go-chat.yaml)

How it works

  • server sub-command starts the grpc server on the provided port and accepts connections from everywhere.
  • with sub-command starts the grpc stub/client and tries to connect to the provided remote host.
  • once the client establishes the connection with remote server, client will be able to broadcast messages to all (by default) or selected users.
  • server makes sure that only those users receive/send the messages who are allowed by client while connecting.

Further improvements

  1. Allow secure communication between client and server.
  2. Provide an option to back up chat messages.
  3. Improve command line user experience.
  4. Allow multiple users with same name.
Similar Resources

Simple grpc web and grpc transcoding with Envoy

Simple grpc web and grpc transcoding with Envoy

gRPC Web and gRPC Transcoding with Envoy This is a simple stand-alone set of con

Dec 25, 2021

GRPC - Creating a gRPC service from scratch

#Go gRPC services course Creating a gRPC service from scratch Command line colle

Jan 2, 2022

Totem - A Go library that can turn a single gRPC stream into bidirectional unary gRPC servers

Totem is a Go library that can turn a single gRPC stream into bidirectional unar

Jan 6, 2023

Grpc-gateway-map-null - gRPC Gateway test using nullable values in map

Demonstrate gRPC gateway behavior with nullable values in maps Using grpc-gatewa

Jan 6, 2022

Todo-app-grpc - Go/GRPC codebase containing RealWorld examples (CRUD, auth, advanced patterns, etc)

Go/GRPC codebase containing RealWorld examples (CRUD, auth, advanced patterns, e

Oct 12, 2022

GRPC - A client-server mockup, using gRPC to expose functionality.

gRPC This is a mockup application that I built to help me visualise and understand the basic concepts of gRPC. In this exchange, the client can use a

Jan 4, 2022

Raft-grpc-demo - Some example code for how to use Hashicorp's Raft implementation with gRPC

raft-grpc-example This is some example code for how to use Hashicorp's Raft impl

Jan 4, 2022

Benthos-input-grpc - gRPC custom benthos input

gRPC custom benthos input Create a custom benthos input that receives messages f

Sep 26, 2022

gChat - Simple Go + gRPC chat application

gChat - Simple Go + gRPC chat application

gChat Simple Go + gRPC chat application. My main goal was creating a simple chat application by using gRPC bidirectional stream. Therefore, some featu

Jan 21, 2022
Go based grpc - grpc gateway micro service example

go-grpc-gateway-server This repository provides an example for go based microservice. Go micro services developed based on gRPC protobuf's and also us

Dec 8, 2021
A gRPC and WS voice chat server written in Go.

VoGRPC Voice over gRPC A small WS and gRPC server, designed to support voice messaging. Progress so far: WS + Socket.io support Roadmap Database desig

Nov 4, 2021
Go-random-chat - Fast and scalable real-time random chat written in go
Go-random-chat - Fast and scalable real-time random chat written in go

Go Random Chat Fast and scalable real-time random chat written in go. Features:

Dec 21, 2022
Command-Line chat app in Go-Lang over TCP

gochat Simple chat communication app over TCP, wrriten in Golang. How does it work? Each client starts a TCP server, in a port that is defined by the

Jan 9, 2022
Go-grpc - This is grpc server for golang.

go-grpc This is grpc server for golang. protocのインストール brew install protoc Golang用のプラグインのインストール go install google.golang.org/protobuf/cmd/protoc-gen-go

Jan 2, 2022
Go-grpc-template - A small template for quickly bootstrapping a, developer platform independent gRPC golang application
Go-grpc-template - A small template for quickly bootstrapping a, developer platform independent gRPC golang application

go-grpc-template A small template for quickly bootstrapping a developer platform

Jan 20, 2022
Tcp chat go - Create tcp chat in golang

TCP chat in GO libs Go net package and goroutines and channels tcp tcp or transm

Feb 5, 2022
A suite of gRPC debugging tools. Like Fiddler/Charles but for gRPC.

grpc-tools A suite of tools for gRPC debugging and development. Like Fiddler/Charles but for gRPC! The main tool is grpc-dump which transparently inte

Dec 22, 2022
grpc-http1: A gRPC via HTTP/1 Enabling Library for Go

grpc-http1: A gRPC via HTTP/1 Enabling Library for Go This library enables using all the functionality of a gRPC server even if it is exposed behind a

Dec 17, 2022
Server and client implementation of the grpc go libraries to perform unary, client streaming, server streaming and full duplex RPCs from gRPC go introduction

Description This is an implementation of a gRPC client and server that provides route guidance from gRPC Basics: Go tutorial. It demonstrates how to u

Nov 24, 2021