- Notifications
You must be signed in to change notification settings - Fork84
Terminal-based Telegram / WhatsApp client for Linux and macOS
License
d99kris/nchat
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
| Linux | Mac |
|---|---|
nchat is a terminal-based chat client for Linux and macOS with support forTelegram and WhatsApp.
- Customizable color schemes and key bindings
- Jump to unread chat
- Message history cache with support for text export
- Message read receipt
- Receive / send markdown formatted messages
- Reply / delete / edit / forward / send messages
- List dialogs for selecting chats, contacts, emojis, files
- Show user status (online, away, typing)
- Toggle to view textized emojis vs. graphical
- View / save media files (documents, photos, videos)
- Send and display reactions
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 pagePageUp history previous pageTab next chatSh-Tab previous chatCtrl-f jump to unread chatCtrl-g toggle show help barCtrl-l toggle show contact listCtrl-n goto chatCtrl-p toggle show top barCtrl-q quitCtrl-s insert emojiCtrl-t send fileCtrl-x send messageCtrl-y toggle show emojisKeyUp select messageAlt-d delete/leave current chatAlt-e external editor composeAlt-i auto-compose replyAlt-n search contactsAlt-t external telephone callAlt-/ find in chatAlt-? find next in chatAlt-$ external spell checkAlt-, decrease contact list widthAlt-. increase contact list widthInteractive Commands for Selected Message:
Ctrl-d delete selected messageCtrl-r download attached fileCtrl-v open/view attached fileCtrl-w open linkCtrl-x send reply to selected messageCtrl-z edit selected messageAlt-c copy selected message to clipboardAlt-q jump to quoted/replied messageAlt-r forward selected messageAlt-s add/remove reaction on selected messageAlt-w external message viewerInteractive Commands for Text Input:
Ctrl-a move cursor to start of lineCtrl-c clear input bufferCtrl-e move cursor to end of lineCtrl-k delete from cursor to end of lineCtrl-u delete from cursor to start of lineAlt-Left move cursor backward one wordAlt-Right move cursor forward one wordAlt-Backsp delete previous wordAlt-Delete delete next wordAlt-c copy input buffer to clipboard (if no message selected)Alt-v paste into input buffer from clipboardAlt-x cut input buffer to clipboardnchat is developed and tested on Linux and macOS. Current version has beentested on:
- macOS Sequoia 15.5
- Ubuntu 24.04 LTS
Build / Install Stable Release using Brew
brew tap d99kris/nchatbrew 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 nchatnchat consists of a large code-base (mainly the Telegram library tdlib), so beprepared 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, onecan use themake.sh script provided.
Dependencies
./make.sh depsBuild / Install
./make.sh build && ./make.sh installDependencies
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-develBuild
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 withclang++, but it is possible to reduce the memory needed,seeBuilding on Low Memory Systems.
All nchat features are enabled by default, but it's possible to controlinclusion of some features using cmake flags, seeFeature 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 countrycode. Example:
$ nchat --setupProtocols:0. Dummy1. Telegram2. WhatsAppMd3. Exit setupSelect protocol (3): 1Enter phone number (ex. +6511111111): +6511111111Enter authentication code: xxxxxSuccesfully set up profile Telegram_+6511111111If unsure of what phone number to enter, open the Telegram app on the phoneand press the menu button 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 thesetup step again.
Refer toDebugging for details.
A Telegram grouphttps://t.me/nchatusers isavailable for users to discuss nchat usage and related topics.
User data is stored locally in~/.config/nchat. Default file permissionsonly allow user access, but anyone who can gain access to a user's privatefiles can also access the user's personal Telegram data. To protect againstthe most simple attack vectors it may be suitable to use disk encryption andto ensure~/.config/nchat is not backed up unencrypted.
The following configuration files (listed with current default values) can beused to configure nchat.
This configuration file holds general application settings. Default content:
assert_abort=0attachment_prefetch=1attachment_send_type=1cache_enabled=1cache_read_only=0clipboard_copy_command=clipboard_has_image_command=clipboard_paste_command=clipboard_paste_image_command=coredump_enabled=0downloads_dir=emoji_list_all=0link_send_preview=1logdump_enabled=0message_delete=1proxy_host=proxy_pass=proxy_port=proxy_user=timestamp_iso=0use_pairing_code=0use_qr_terminal=0version_used=Specifies whether to abort execution (crash) if assertions fail. Primarilyintended for debugging.
Specifies whether to detect file type (audio, video, image, document) and sendattachments as those types, instead of sending all attachments as documenttype (which typically leaves original file content intact).
Specifies level of attachment prefetching:
0 = no prefetch (download upon open/save)1 = selected (download upon message selection) <- default2 = 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 toClipboard for details.
Specifies whether to enable core dumps on application crash.
Specifies a custom downloads directory path to save attachments to. If notspecified, the default dir is~/Downloads if exists, otherwise~.
Specifies whether the emoji dialog should list all emojis, it is otherwiserestricted 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 handling of message deletion by other users (WhatsApp only):
1 = erase message <- default2 = replace message with [Deleted] text3 = prefix message with [Deleted] textSOCKS5 proxy server details. To enable proxy usage the parametershost andport are required, whileuser andpass are optional (depending on theSOCKS server). Note: In order to use a proxy while setting up nchat the firsttime, it is recommended to first run nchat without arguments (nchat) for itsconfig dir to be created, and then edit proxy settings in~/.config/nchat/app.conf as needed, before runningnchat -s to setup anaccount.
Specifies whether to use ISO-style timestamps (YYYY-MM-DD HH:MM) in the UIand at export of chat history. By default nchat uses a dynamic "human-friendly"format:
HH:MMfor timestamps on same date as today, e.g.19:00DAY HH:MMfor timestamps in the last week, e.g.Mon 19:00DD MMM HH:MMfor timestamps in the current year, e.g.14 Nov 19:00DD MMM YYYY HH:MMfor timestamps in non-current year, e.g.14 Nov 2022 19:00DD MMM YYYY HH:MMfor timestamps during export, e.g.14 Nov 2022 19:00
Stores the environment variable flagUSE_PAIRING_CODE if set during setup.It specifies whether to use pairing code instead of QR code (WhatsApp only).
Stores the environment variable flagUSE_QR_TERMINAL if set during setup.It specifies whether to display QR code in the terminal, disabling detectionof GUI capability for displaying images (WhatsApp only).
For internal use only. Stores version used for last successful execution. Maybe used for debugging startup crash / hang regressions.
This configuration file holds general user interface settings. Default content:
attachment_indicator=📎attachment_open_command=away_status_indication=0auto_compose_command=auto_compose_enabled=0auto_compose_history_count=25auto_select_chat_timeout_sec=1call_command=chat_picker_sorted_alphabetically=0confirm_deletion=1confirm_send_pasted_image=1desktop_notify_active_current=0desktop_notify_active_noncurrent=0desktop_notify_command=desktop_notify_connectivity=0desktop_notify_enabled=0desktop_notify_inactive=0downloadable_indicator=+emoji_enabled=1entry_height=4failed_indicator=✗file_picker_command=file_picker_persist_dir=1help_enabled=1home_fetch_all=0linefeed_on_enter=1link_open_command=list_enabled=1list_width=14listdialog_show_filter=1mark_read_any_chat=0mark_read_on_view=1mark_read_when_inactive=0message_edit_command=message_open_command=muted_indicate_unread=1muted_notify_unread=0muted_position_by_timestamp=1notify_every_unread=1online_status_share=1online_status_dynamic=1phone_number_indicator=proxy_indicator=🔒read_indicator=✓reactions_enabled=1spell_check_command=status_broadcast=1syncing_indicator=⇄terminal_bell_active=0terminal_bell_inactive=1terminal_title=top_enabled=1top_show_version=0transfer_send_caption=1typing_status_share=1unread_indicator=*Specifies text to prefix attachment filenames in message view.
Specifies a custom command to use for opening/viewing attachments. Thecommand shall include%1 which will be replaced by the filenameto open. If not specified, the following default commands are used:
Linux:xdg-open >/dev/null 2>&1 '%1' &
macOS:open '%1' &
Note: Omit the trailing& for commands taking over the terminal, forexamplew3m -o confirm_qq=false '%1' andsee '%1'.
Specifies whether to indicate away status in the top bar while sharing awaystatus with other users. I.e. the status will readAway instead ofOnlinewhen the terminal is inactive (assumingonline_status_share=1 andonline_status_dynamic=1).
Specifies a custom command to use to auto-compose message reply. Thecommand shall include%1 which will be replaced by the path of a temporarytext file with message history. If not specified, the following defaultcommand is used:
(prefix)/libexec/nchat/compose -c '%1'Refer toAuto-Compose for details.
Specifies whether to enable using auto-compose. The reason for not enablingit by default is that thecompose tool may use third-party services (if APIkey is set up in the shell environment) that can incur costs.
Specifies the maximum number of chat messages up to latest (or currentselected) to pass to the auto-compose tool.
Specifies a timeout after receiving previous history sync message (withtimestamp before the application went online) for automatically settingcurrent chat. If disabled (value 0) current chat will only be set uponany user input, or receiving a message with timestamp after applicationwent online (connected to server).
Specifies a custom command to use for starting a call using an externaltool. The command shall include%1 which will be replaced by the phonenumber of the contact. If not specified, the following default commandsare used:
Linux:xdg-open >/dev/null 2>&1 'tel://%1' &
macOS:open 'tel://%1' &
Specifies whether the chat selection dialog (used when forwarding message)should be sorted alphabetically. If not, its order follows the main chatlist order.
Specifies whether to prompt the user for confirmation when deleting a messageor a chat.
Specifies whether to prompt the user for confirmation when pasting an imageto a chat.
Specifies whether new message in current chat shall trigger desktopnotification when nchat terminal window is active.
Specifies whether new message in non-current chat shall trigger desktopnotification when nchat terminal window is active.
Specifies a custom command to use for desktop notifications. The command mayinclude%1 (will be replaced bysender name orgroup name - sender name)and%2 (will be replaced bymessage text) enclosed in single quotes (toprevent shell injection). Default command used, if not specified:
Linux:notify-send 'nchat' '%1: %2'
macOS:osascript -e 'display notification "%1: %2" with title "nchat"'
Specifies whether change of connectivity status (going offline or back online)shall trigger desktop notification.
Specifies whether desktop notifications are permitted. Simply enabling thisparameter will not display notifications, unless otherdesktop_notify_*parameters are enabled.
Specifies whether new message shall trigger desktop notification when nchatterminal window is inactive.
Specifies text to suffix attachment filenames in message view for attachmentsnot yet downloaded. This is only shown forattachment_prefetch < 2.
Specifies whether to display emojis. Controlled by Ctrl-y in run-time.
Specifies height of text entry area.
Specifies text to suffix attachment filenames in message view for faileddownloads.
Specifies a command to use for file selection, in place of the internal fileselection dialog used when sending files. The command shall include%1 (atemporary file path) which the command should write its result to. Examples:
nnn:nnn -p '%1'
ranger:ranger --choosefiles='%1'
Specifies whether the file selection dialog shall persist the directory oflast selected file.
Specifies whether to display help bar. Controlled by Ctrl-g in run-time.
Specifies whetherhome button shall repeatedly fetch all chat history.
Specifies if enter key press should be read as linefeed (LF\12).Otherwise read as carriage return (CR\15). This setting is onlyrelevant ifkey.conf uses numerical key value for enter (LF\12,CR\15). The key nameKEY_RETURN always maps to the one in use.
Specifies a custom command to use for opening/viewing links. Thecommand shall include%1 which will be replaced by the urlto open. If not specified, the following default commands are used:
Linux:xdg-open >/dev/null 2>&1 '%1' &
macOS:open '%1' &
Note: Omit the trailing& for commands taking over the terminal, forexamplew3m -o confirm_qq=false '%1' andsee '%1'.
Specifies whether to display chat list. Controlled by Ctrl-l in run-time.
Specifies width of chat list.
Specifies whether list dialogs should display the search filter input by user.
Specifies whether nchat may mark messages as read before current chat hasbeen set (either through user activity or time elapsed since last old syncmessage was received).
Specifies whether nchat should send message read receipts upon viewing. Iffalse nchat will only mark the messages read uponnext_page (page down),end (end) or upon sending a message/file in the chat.
Controls whether nchat marks messages in the current chat as read while theterminal is inactive.
Specifies a custom command to use for external editor compose. If notspecified, nchat will useEDITOR environment variable if set, orotherwise usenano.
Specifies a custom command to use for opening/viewing message text part. Ifnot specified, nchat will usePAGER environment variable if set, orotherwise useless.
Specifies whether chat list should indicate unread status* for muted chats.This also determines whether the such chats are included in jump to unread.
Specifies whether to notify (terminal bell) new unread messages in muted chats.
Specifies whether chat list position of muted chats should reflect the time oftheir last received/sent message. Otherwise muted chats are listed last.
Specifies whether to notify upon receiving more messages in an unread chat.
Share online status with other users.Note: Disabling this stops updates on other users online/typing status forWhatsApp.
Dynamically update online status based on terminal active state.Note: Enabling this stops updates on other users online/typing status forWhatsApp when the terminal is not active.
Specifies status bar text to indicate phone number of the current chat isavailable. This field may contain%1 which will be replaced with the actualphone number of the contact. Other examples:🎧
Specifies top bar text to indicate proxy is enabled.
Specifies text to indicate a message has been read by the receiver.
Specifies whether to display reactions.
Specifies a custom command to use for spell checking composed messages. If notspecified, nchat checks ifaspell orispell is available on the system (inthat order), and uses the first found.
Specifies (WhatsApp) Status Updates chat level of visibility:
0 = hidden1 = visible and muted <- default2 = visibleSpecifies text to suffix attachment filenames in message view for downloadsin progress.
Specifies whether new message shall trigger terminal bell when nchat terminalwindow is active.
Specifies whether new message shall trigger terminal bell when nchat terminalwindow is inactive.
Specifies custom terminal title, ex:terminal_title=nchat - telegram.
Specifies whether to display top bar. Controlled by Ctrl-p in run-time.
Specifies whether to display nchat version in top bar.
Specifies if entered text should be sent as caption when transferring a file.
Specifies whether to share typing status with other user(s) in theconversation.
Specifies the character to suffix chats with unread messages in the chat list.
This configuration file holds user interface key bindings. Default content:
auto_compose=\33\151backspace=KEY_BACKSPACEbackspace_alt=KEY_ALT_BACKSPACEbackward_kill_word=\33\177backward_word=begin_line=KEY_CTRLAcancel=KEY_CTRLCclear=KEY_CTRLCcopy=\33\143cut=\33\170decrease_list_width=\33\54delete=KEY_DCdelete_chat=\33\144delete_line_after_cursor=KEY_CTRLKdelete_line_before_cursor=KEY_CTRLUdelete_msg=KEY_CTRLDdown=KEY_DOWNedit_msg=KEY_CTRLZend=KEY_ENDend_line=KEY_CTRLEext_call=\33\164ext_edit=\33\145find=\33\57find_next=\33\77forward_msg=\33\162forward_word=goto_chat=KEY_CTRLNhome=KEY_HOMEincrease_list_width=\33\56jump_quoted=\33\161kill_word=left=KEY_LEFTlinebreak=KEY_RETURNnext_chat=KEY_TABnext_page=KEY_NPAGEok=KEY_RETURNopen=KEY_CTRLVopen_link=KEY_CTRLWopen_msg=\33\167other_commands_help=KEY_CTRLOpaste=\33\166prev_chat=KEY_BTABprev_page=KEY_PPAGEquit=KEY_CTRLQreact=\33\163right=KEY_RIGHTsave=KEY_CTRLRselect_contact=\33\156select_emoji=KEY_CTRLSsend_msg=KEY_CTRLXspell=\33\44terminal_focus_in=KEY_FOCUS_INterminal_focus_out=KEY_FOCUS_OUTterminal_resize=KEY_RESIZEtoggle_emoji=KEY_CTRLYtoggle_help=KEY_CTRLGtoggle_list=KEY_CTRLLtoggle_top=KEY_CTRLPtransfer=KEY_CTRLTunread_chat=KEY_CTRLFup=KEY_UPThe key bindings may be specified in the following formats:
- Ncurses macro (ex:
KEY_CTRLK) - Hex key code (ex:
0x22e) - Octal key code sequence (ex:
\033\177) - Plain-text single-char ASCII (ex:
r) - Disable key binding (
KEY_NONE)
To determine the key code sequence for a key, one can run nchat in key codedump modenchat -k which will output the octal code, and ncurses macro name(if present).
This configuration file holds user interface color settings. Default content:
default_color_bg=default_color_fg=dialog_attr=dialog_attr_selected=reversedialog_color_bg=dialog_color_fg=entry_attr=entry_color_bg=entry_color_fg=help_attr=reversehelp_color_bg=blackhelp_color_fg=whitehistory_name_attr=boldhistory_name_attr_selected=reversehistory_name_recv_color_bg=history_name_recv_color_fg=history_name_recv_group_color_bg=history_name_recv_group_color_fg=history_name_sent_color_bg=history_name_sent_color_fg=grayhistory_text_attachment_color_bg=history_text_attachment_color_fg=grayhistory_text_attr=history_text_attr_selected=reversehistory_text_quoted_color_bg=history_text_quoted_color_fg=grayhistory_text_reaction_color_bg=history_text_reaction_color_fg=grayhistory_text_recv_color_bg=history_text_recv_color_fg=history_text_recv_group_color_bg=history_text_recv_group_color_fg=history_text_sent_color_bg=history_text_sent_color_fg=graylist_attr=list_attr_selected=reverselist_color_bg=list_color_fg=list_color_unread_bg=list_color_unread_fg=listborder_attr=listborder_color_bg=listborder_color_fg=status_attr=reversestatus_color_bg=status_color_fg=top_attr=reversetop_color_bg=top_color_fg=Supported text attributes_attr (defaults tonormal if not specified):
normalunderlinereversebolditalicSupported text background_bg and foreground_fg colors:
blackredgreenyellowbluemagentacyanwhitegraybright_black (same as gray)bright_redbright_greenbright_yellowbright_bluebright_magentabright_cyanbright_whiteCustom colors may be specified using hex RGB code, for example0xff8937.
Thehistory_name_recv_group_color andhistory_text_recv_group_colorparameters also supports the special valueusercolor. When set, nchat willdetermine which color to use for a user, based on a hash of their user idused to pick a color from the list in~/.config/nchat/usercolor.conf.
Example color config files are provided in$(dirname $(which nchat))/../share/nchat/themesand can be used by copying to~/.config/nchat/.
cp $(dirname $(which nchat))/../share/nchat/themes/default/* ~/.config/nchat/cp $(dirname $(which nchat))/../share/nchat/themes/basic-color/* ~/.config/nchat/cp $(dirname $(which nchat))/../share/nchat/themes/dracula/* ~/.config/nchat/iTerm2 Color Schemes canbe used to generate themes for nchat. The following themes generated usingiTerm2 Color Schemes are available in$(dirname $(which nchat))/../share/nchat/themes:
- Catppuccin Mocha:
cp $(dirname $(which nchat))/../share/nchat/themes/catppuccin-mocha/* ~/.config/nchat/ - Espresso:
cp $(dirname $(which nchat))/../share/nchat/themes/espresso/* ~/.config/nchat/ - Gruvbox Dark:
cp $(dirname $(which nchat))/../share/nchat/themes/gruvbox-dark/* ~/.config/nchat/ - Solarized Dark Higher Contrast:
cp $(dirname $(which nchat))/../share/nchat/themes/solarized-dark-higher-contrast/* ~/.config/nchat/ - Tokyo Night:
cp $(dirname $(which nchat))/../share/nchat/themes/tokyo-night/* ~/.config/nchat/ - Tomorrow Night:
cp $(dirname $(which nchat))/../share/nchat/themes/tomorrow-night/* ~/.config/nchat/ - Zenbones Dark:
cp $(dirname $(which nchat))/../share/nchat/themes/zenbones-dark/* ~/.config/nchat/ - Zenburned:
cp $(dirname $(which nchat))/../share/nchat/themes/zenburned/* ~/.config/nchat/
To generate additional nchat themes and install for use withnchat, refer toGenerating nchat themes from iTerm2 Color Schemes.
Deleting a configuration entry line (while nchat is not running) and startingnchat will populate the configuration file with the default entry.
The following configuration files (listed with current default values) can beused to configure nchat.
This configuration file holds protocol-specific settings for Telegram. Defaultcontent:
local_key=markdown_enabled=1markdown_version=1profile_display_name=For internal use by nchat only.
Specifies whether to enable Markdown <-> text conversion for text messages(default enabled).
Specifies which Telegram Markdown version to use (default 1).
Specifies an optional short/display name in the status bar when using nchatwith multiple profiles. The default profile name isTelegram orTelegram_+nnnnn (when more than one Telegram profile is set up) if thissetting is not specified.
This configuration file holds protocol-specific settings for WhatsApp. Defaultcontent:
profile_display_name=Specifies an optional short/display name in the status bar when using nchatwith multiple profiles. The default profile name isWhatsAppMd orWhatsAppMd_+nnnnn (when more than one WhatsAppMd profile is set up) if thissetting is not specified.
For Linux please ensure the terminal is configured withmeta to send escape.For macOS Terminal ensure that the Terminal profile keyboard setting"Use Option as Meta key" is enabled.
If issues are still encountered, please usenchat -k (keydump mode) todetermine the key codes and modify~/.config/nchat/key.conf accordingly.
To simply send on enter key press and skip message compose with linebreaks,one can just setsend_msg=KEY_RETURN in~/.config/nchat/key.conf.
To also be able to compose messages with linebreaks using Alt/Opt-Enter, edit~/.config/nchat/ui.conf and setlinefeed_on_enter=0. And in~/.config/nchat/key.conf setlinebreak=\33\15.
Please try to run nchat with a TERM supporting custom colors, e.g:
TERM=xterm-256color nchatFor terminals with eight colors (or more) the default color theme displayssent messages in gray (shaded). Some terminals may wrongly report supportingmore colors than two, or the terminal may be set up with gray mapped to black.In this case sent / own messages may appear invisible. To avoid nchat usinggray one can edit~/.config/nchat/color.conf and remove occurances ofgray.
Therecommended method is to set up nchat with one config directory perprotocol/phone number, and run each instance in separate terminal windows/tabs.To simplify such usage one can set up aliases, for example:
alias telegram='nchat -d ~/.config/nchat-telegram'alias whatsapp='nchat -d ~/.config/nchat-whatsapp'Then use regular setup for them (separately), for example:
telegram -swhatsapp -sThealternative method is to set up multiple protocol accounts in a singlenchat config directory. For each protocol/phone nubmer, run setup mode and exitafter initial sync:
nchat -sBy default setting up a WhatsApp account will display a QR code to be scannedusing the WhatsApp mobile application on the primary device. As an alternativeone can set an environment flag to have nchat display a pairing code, to beentered in WhatsApp on the primary device:
USE_PAIRING_CODE=1 nchat -sBy default nchat will attempt to detect if the system is capable of viewingimages using a GUI image viewer, and if detected (indicated by "has gui" inthe log) it displays the QR code using default image viewer. If that for somereason fails, one can use pairing code (see above), or force nchat to displaythe QR code in the terminal:
USE_QR_TERMINAL=1 nchat -sThis often means that OOM killer has terminated the compilation due to thesystem running out of free RAM.
If the system hasless than 4 GB RAM, please refer toBuilding on Low Memory Systems.
If the system has4 GB RAM or more, the problem can occur if parallelismis set too high, which is likely to be encountered when installing from theArch Linux AUR package. A workaround for the AUR package is to manuallyrestrict max number of parallel jobs toavailable RAM in GB divided by 4.For example a system with 8 GB would then need to use max 8 / 4 = 2 jobs:
CMAKE_BUILD_PARALLEL_LEVEL=2 yay -S nchatAlternatively one canBuild from Source using themake.sh script, which sets parallel job count based on the systemcapabilities.
If on Linux, try removing any custom default background set up, i.e. setdefault_color_bg= in~/.config/nchat/color.conf.
There are no plans to support the following features:
- Facebook Messenger
- Signal
- Telegram secret chats
- Voice / video calls
Additionally, WhatsApp is only supported on macOS and glibc-based Linuxsystems. Thus, it is not supported on musl-based operating systems, suchas Alpine Linux. Seeissue #204for technical details on this limitation.
There is currently no concrete roadmap for further feature development ofnchat. It is not intended to be a full-featured client on par with officialTelegram / WhatsApp clients, but rather a light-weight client providingessential functionality suitable for the terminal. However, feel free tosubmit feature requests if there's something missing, or help upvoteexisting feature requests,if it's useful and low effort it will be considered.
Please refer toContributing Guidelines andDesign Notes.
Terminal-based Telegram clients:
Terminal-based WhatsApp clients:
nchat uses its own Telegram API id and hash by default. To use custom id/hash,obtained fromhttps://my.telegram.org/ one may setenvironment variablesTG_APIID andTG_APIHASH when setting up a new Telegramaccount. Example (below values must be changed to valid api id/hash):
TG_APIID="123456" TG_APIHASH="aaeaeab342aaa23423" nchat -snchat is primarily implemented in C++ with some parts in Go. Its source treeincludes the source code of the following third-party libraries:
apathy -Copyright 2013 Dan Lecocq -MIT License
cereal -Copyright 2013 Randolph Voorhies, Shane Grant -BSD-3 License
clip -Copyright 2015 David Capello -MIT License
sqlite_modern_cpp -Copyright 2017 aminroosta -MIT License
tdlib -Copyright 2014 Aliaksei Levin, Arseny Smirnov -Boost License
whatsmeow -Copyright 2022 Tulir Asokan -MPL License
Thetdlib andwhatsmeow libraries are activelydeveloped and need to be updated and integrated into nchat on a regularbasis by nchat maintainer(s). To facilitate this there are scripts availableto update to latest (or a specific) version of these libraries. Example usages:
./utils/tdlib-update 8517026./utils/whatsmeow-update 7aedaa1Uncrustify is used to maintain consistent source code formatting, example:
./make.sh srcnchat is distributed under the MIT license. See LICENSE file.
command line, console-based, linux, macos, chat client, ncurses, telegram,terminal-based.
About
Terminal-based Telegram / WhatsApp client for Linux and macOS
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.



