Terminal-based messaging client for Linux and macOS with Telegram, WhatsApp and Signal support
Terminal-based messaging client for Linux and macOS with Telegram, WhatsApp and Signal support
| Linux | Mac |
|---|---|
nchat is a terminal-based multi-protocol messaging client for Linux and macOS with support for Telegram, WhatsApp and Signal.
Usage:
nchat [OPTION]Command-line Options:
-d, --confdir <DIR> use a different directory than ~/.config/nchat
-e, --verbose enable verbose logging
-ee, --extra-verbose enable extra verbose logging
-h, --help display this help and exit
-k, --keydump key code dump mode
-m, --devmode developer mode
-r, --remove remove chat protocol account
-s, --setup set up chat protocol account
-v, --version output version information and exit
-x, --export <DIR> export message cache to specified dirInteractive Commands:
PageDn history next page
PageUp history previous page
Tab next chat
Sh-Tab previous chat
Ctrl-f jump to unread chat
Ctrl-g toggle show help bar
Ctrl-l toggle show contact list
Ctrl-n goto chat
Ctrl-p toggle show top bar
Ctrl-q quit
Ctrl-s insert emoji
Ctrl-t send file
Ctrl-x send message
Ctrl-y toggle show emojis
KeyUp select message
Alt-@ insert mention
Alt-a archive current chat
Alt-d delete/leave current chat
Alt-e external editor compose
Alt-i auto-compose reply
Alt-n search contacts
Alt-p pin/unpin current chat
Alt-t external telephone call
Alt-/ find in chat
Alt-? find next in chat
Alt-$ external spell check
Alt-, decrease contact list width
Alt-. increase contact list widthInteractive Commands for Selected Message:
Ctrl-d delete selected message
Ctrl-r download attached file
Ctrl-v open/view attached file
Ctrl-w open link
Ctrl-x send reply to selected message
Ctrl-z edit selected message
Alt-c copy selected message to clipboard
Alt-q jump to quoted/replied message
Alt-r forward selected message
Alt-s add/remove reaction on selected message
Alt-w external message viewerInteractive Commands for Text Input:
Ctrl-a move cursor to start of line
Ctrl-c clear input buffer
Ctrl-e move cursor to end of line
Ctrl-k delete from cursor to end of line
Ctrl-u delete from cursor to start of line
Alt-Left move cursor backward one word
Alt-Right move cursor forward one word
Alt-Backsp delete previous word
Alt-Delete delete next word
Alt-Tab insert tab (four spaces)
Alt-c copy input buffer to clipboard (if no message selected)
Alt-v paste into input buffer from clipboard
Alt-x cut input buffer to clipboardnchat is developed and tested on Linux and macOS. Current version has been tested on:
Build / Install Stable Release using Brew
brew tap d99kris/nchat
brew install nchatOptionally one can disable protocols using --without-whatsapp and
--without-telegram, for example:
brew install nchat --without-telegramBuild / Install Latest Git
yay -S nchat-gitBuild / Install Stable Release
yay -S nchatInstall Pre-built Binary
yay -S nchat-binExperimental support for Linux (glibc >= 2.28 or musl) x86_64 and arm64, as well as macOS arm64.
Install
curl -fsSL https://raw.githubusercontent.com/d99kris/nchat/master/utils/install.sh | bashUninstall
curl -fsSL https://raw.githubusercontent.com/d99kris/nchat/master/utils/uninstall.sh | bashInstall Location
Installs to ~/.local/{bin,share}. Override via the NCHAT_PREFIX environment
variable, e.g.:
export NCHAT_PREFIX=/usr/localnchat consists of a large code-base (mainly the Telegram library tdlib), so be prepared for a relatively long first build time.
Get Source
git clone https://github.com/d99kris/nchat && cd nchatIf using macOS, Alpine, Arch, Fedora, Gentoo, Raspbian, Ubuntu or Void, one
can use the make.sh script provided.
Dependencies
./make.sh depsBuild / Install
./make.sh build && ./make.sh installInstall Location
Installs to a system prefix such as /usr/local. Override via the
NCHAT_PREFIX environment variable (a user-writable prefix installs without
sudo/doas), e.g.:
export NCHAT_PREFIX=~/.localDependencies
macOS
brew install gperf cmake openssl ncurses ccache readline help2man sqlite libmagic goArch
sudo pacman -S ccache cmake file go gperf help2man ncurses openssl readline sqlite zlib base-develDebian-based (Ubuntu, Raspbian, etc)
sudo apt install ccache cmake build-essential gperf help2man libreadline-dev libssl-dev libncurses-dev libncursesw5-dev ncurses-doc zlib1g-dev libsqlite3-dev libmagic-dev golangFedora
sudo dnf install git cmake clang golang ccache file-devel file-libs gperf readline-devel openssl-devel ncurses-devel sqlite-devel zlib-develGentoo
sudo emerge -n dev-util/cmake dev-util/ccache dev-util/gperf sys-apps/help2man sys-libs/readline dev-libs/openssl sys-libs/ncurses sys-libs/zlib dev-db/sqlite sys-apps/file dev-lang/goVoid
sudo xbps-install base-devel go ccache cmake gperf help2man libmagick-devel readline-devel sqlite-devel file-devel openssl-develExtra Dependencies
For Wayland-based systems install wl-clipboard to enable clipboard
functionality.
To support pasting images directly from clipboard libpng-dev is needed. On
X11 systems libxcb1-dev and libx11-dev are needed as well.
Build
mkdir -p build && cd build && cmake .. && make -sInstall
sudo make installBy default nchat requires ~3.5GB RAM to build using G++ and ~1.5GB RAM with clang++, but it is possible to reduce the memory needed, see Building on Low Memory Systems.
When building from source, all features except Signal support are enabled by default. To enable Signal, see Signal; for other feature flags, see Feature Flags.
In order to configure / setup an account one needs to run nchat in setup mode:
nchat --setupThe setup mode prompts for phone number, which shall be entered with country code. Example:
$ nchat --setup
Protocols:
0. Dummy
1. Telegram
2. WhatsAppMd
3. Signal
4. Exit setup
Select protocol (4): 1
Enter phone number (ex. +6511111111): +6511111111
Open Telegram on your phone, go to Settings -> Devices
and click Link Desktop Device and scan the QR code.
...
Succesfully set up profile Telegram_+6511111111By default, nchat uses QR code authentication. The QR code should be scanned
using the official app on the primary device. To use authentication code
instead, set the USE_PAIRING_CODE environment variable (see FAQ below).
If unsure of what phone number to enter, open the official app on the phone
and look for the phone number under Settings or Profile section, and use
the number displayed there (omitting spaces, so for the below screenshot
the number to enter is +6511111111).
Once the setup process is completed, the main UI of nchat will be loaded.
In order to set up multiple protocols/profiles, exit nchat and perform the
setup step again. To remove a protocol account, use nchat --remove.
Refer to Debugging for details.
A Telegram group https://t.me/nchatusers is available for users to discuss nchat usage and related topics.
User data is stored locally in ~/.config/nchat. Default file permissions
only allow user access, but anyone who can gain access to a user's private
files can also access the user's personal nchat data. To protect against
the most simple attack vectors it may be suitable to use disk encryption and
to ensure ~/.config/nchat is not backed up unencrypted.
The following configuration files (listed with current default values) can be used to configure nchat.
This configuration file holds general application settings. Default content:
assert_abort=0
attachment_prefetch=1
attachment_send_type=1
cache_enabled=1
cache_read_only=0
clipboard_copy_command=
clipboard_has_image_command=
clipboard_paste_command=
clipboard_paste_image_command=
coredump_enabled=0
downloads_dir=
emoji_list_all=0
link_send_preview=1
logdump_enabled=0
mentions_quoted=1
message_delete=1
proxy_host=
proxy_pass=
proxy_port=
proxy_user=
timestamp_iso=0
use_pairing_code=0
use_qr_terminal=0
version_used=Specifies whether to abort execution (crash) if assertions fail. Primarily intended for debugging.
Specifies how attachments are sent:
0 = send all attachments as document type (typically preserves file content)
1 = detect file type (audio, video, image, document) and send as that type <- default
2 = like 1, but when sending just a file (no text or quote), webp files are
sent as stickers and mp4/m4v files as borderless auto-playing "GIFs"Specifies level of attachment prefetching:
0 = no prefetch (download upon open/save)
1 = selected (download upon message selection) <- default
2 = all (download when message is received)Specifies whether to enable cache functionality.
Specifies whether to access cache read-only. Primarily intended for debugging.
Specifies custom clipboard commands to be used instead of system clipboard. Refer to Clipboard for details.
Specifies whether to enable core dumps on application crash.
Specifies a custom downloads directory path to save attachments to. If not
specified, the default dir is ~/Downloads if exists, otherwise ~.
Specifies whether the emoji dialog should list all emojis, it is otherwise restricted to listing emojis that renders properly in common terminals.
Specifies whether to enable preview for links in messages sent (Telegram only).
Specifies whether to dump warning and error log messages to stdout upon exit.
Specifies whether to use bracket quoting for display-name mentions with spaces.
Specifies handling of message deletion by other users (WhatsApp a
No open issues yet, or sync has not completed.