All Projects → d99kris → nchat

d99kris / nchat

Licence: MIT License
Terminal-based Telegram client for Linux and macOS

Programming Languages

C++
36643 projects - #6 most used programming language
go
31211 projects - #10 most used programming language
c
50402 projects - #5 most used programming language
CMake
9771 projects
PHP
23972 projects - #3 most used programming language
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to nchat

Cfiles
A ncurses file manager written in C with vim like keybindings
Stars: ✭ 319 (+369.12%)
Mutual labels:  console, ncurses
tg crawler
Just a crawler based on tg-cli for Telegram. Deprecated by now, please use telegram-export.
Stars: ✭ 71 (+4.41%)
Mutual labels:  telegram, telegram-cli
Tqdm
A Fast, Extensible Progress Bar for Python and CLI
Stars: ✭ 20,632 (+30241.18%)
Mutual labels:  console, telegram
Vifm
Vifm is a file manager with curses interface, which provides Vim-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Stars: ✭ 1,822 (+2579.41%)
Mutual labels:  ncurses, terminal-based
xplr
A hackable, minimal, fast TUI file explorer
Stars: ✭ 2,271 (+3239.71%)
Mutual labels:  console, terminal-based
Nctelegram
A ncurse Telegram client developed in Python
Stars: ✭ 279 (+310.29%)
Mutual labels:  telegram, ncurses
Quicklogger
Library for logging on files, console, memory, email, rest, eventlog, syslog, slack, telegram, redis, logstash, elasticsearch, influxdb, graylog, Sentry, Twilio, ide debug messages and throw events for Delphi/Firemonkey/freepascal/.NET (Windows/Linux/OSX/IOS/Android).
Stars: ✭ 137 (+101.47%)
Mutual labels:  console, telegram
Tmatrix
Terminal based replica of the digital rain from The Matrix.
Stars: ✭ 227 (+233.82%)
Mutual labels:  ncurses, terminal-based
Sc Im
sc-im - Spreadsheet Calculator Improvised -- An ncurses spreadsheet program for terminal
Stars: ✭ 3,081 (+4430.88%)
Mutual labels:  console, ncurses
Mitype
Typing speed test in terminal
Stars: ✭ 241 (+254.41%)
Mutual labels:  console, terminal-based
Rubiks cube
rubik's cube that runs in your terminal!
Stars: ✭ 73 (+7.35%)
Mutual labels:  ncurses, terminal-based
telegram client
library for help you make userbot or bot telegram and support tdlib telegram database and only support nodejs dart and google-apps-script
Stars: ✭ 38 (-44.12%)
Mutual labels:  telegram-cli, telegram-client
Dte
A small, configurable console text editor (moved to https://gitlab.com/craigbarnes/dte)
Stars: ✭ 98 (+44.12%)
Mutual labels:  console, ncurses
Mandown
man-page inspired Markdown viewer
Stars: ✭ 173 (+154.41%)
Mutual labels:  console, ncurses
spotify-terminal
Terminal application to play/control Spotify.
Stars: ✭ 61 (-10.29%)
Mutual labels:  ncurses, terminal-based
croatoan
Common Lisp bindings for the ncurses terminal library.
Stars: ✭ 111 (+63.24%)
Mutual labels:  console, ncurses
winston-telegram
A Telegram transport for winston
Stars: ✭ 28 (-58.82%)
Mutual labels:  telegram
TG-FileStreamBot
Stream Telegram files to web
Stars: ✭ 193 (+183.82%)
Mutual labels:  telegram
Store-bot
Пример Telegram бота для продажи товаров.
Stars: ✭ 43 (-36.76%)
Mutual labels:  telegram
pump-and-dump-dataset
Additional material for paper: Pump and Dumps in the Bitcoin Era: Real Time Detection of Cryptocurrency Market Manipulations, ICCCN '20
Stars: ✭ 66 (-2.94%)
Mutual labels:  telegram

nchat - ncurses chat

Linux Mac
Linux macOS

nchat is a terminal-based chat client for Linux and macOS with support for Telegram.

screenshot nchat

Features

  • Message history cache (sqlite db backed)
  • View/save media files: documents, photos
  • Show user status (online, away, typing)
  • Message read receipt
  • List dialogs (with text filter) for selecting files, emojis, contacts
  • Reply / delete / send messages
  • Jump to unread chat
  • Toggle to view textized emojis vs. graphical (default)
  • Toggle to hide/show UI elements (top bar, status bar, help bar, contact list)
  • Receive / send markdown formatted messages
  • Customizable color schemes and key bindings

Usage

Usage:

nchat [OPTION]

Command-line Options:

-d, --confdir <DIR>    use a different directory than ~/.nchat
-e, --verbose          enable verbose logging
-ee, --extra-verbose   enable extra verbose logging
-h, --help             display this help and exit
-s, --setup            set up chat protocol account
-v, --version          output version information and exit
-x, --export <DIR>     export message cache to specified dir

Interactive Commands:

PageDn      history next page
PageUp      history previous page
Tab         next chat
Sh-Tab      previous chat
Ctrl-e      insert emoji
Ctrl-g      toggle show help bar
Ctrl-l      toggle show contact list
Ctrl-p      toggle show top bar
Ctrl-q      quit
Ctrl-s      search contacts
Ctrl-t      send file
Ctrl-u      jump to unread chat
Ctrl-x      send message
Ctrl-y      toggle show emojis
KeyUp       select message

Interactive Commands for Selected Message:

Ctrl-d      delete selected message
Ctrl-r      download attached file
Ctrl-v      open/view attached file
Ctrl-w      open link in sponsored message
Ctrl-x      reply to selected message

Supported Platforms

nchat is developed and tested on Linux and macOS. Current version has been tested on:

  • macOS Big Sur 11.5
  • Ubuntu 20.04 LTS

Build / Install

Nchat consists of a large code-base (mainly the Telegram client library), so be prepared for a relatively long first build time.

Linux / Ubuntu

Dependencies

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

Source

git clone https://github.com/d99kris/nchat && cd nchat

Build

mkdir -p build && cd build && cmake .. && make -s

Install

sudo make install

macOS

Dependencies

brew install gperf cmake openssl ncurses ccache readline help2man sqlite libmagic

Source

git clone https://github.com/d99kris/nchat && cd nchat

Build

mkdir -p build && cd build && cmake .. && make -s

Install

make install

Arch Linux

Source

git clone https://aur.archlinux.org/nchat-git.git && cd nchat-git

Build

makepkg -s

Install

makepkg -i

Low Memory / RAM Systems

The Telegram client library subcomponent requires relatively large amount of RAM to build by default (3.5GB using g++, and 1.5 GB for clang++). It is possible to adjust the Telegram client library source code so that it requires less RAM (but takes longer time). Doing so reduces the memory requirement to around 1GB under g++ and 0.5GB for clang++. Also, it is recommended to build nchat in release mode (which is default if downloading zip/tar release package - but with a git/svn clone it defaults to release with debug symbols), to minimize memory usage.

Steps to build nchat on a low memory system:

Extra Dependencies (Linux)

sudo apt install php-cli

Source

git clone https://github.com/d99kris/nchat && cd nchat

Build

mkdir -p build && cd build
CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --target prepare_cross_compiling
cd ../lib/tgchat/ext/td ; php SplitSource.php ; cd -
make -s

Install

sudo make install

Revert Source Code Split (Optional)

cd ../lib/tgchat/ext/td ; php SplitSource.php --undo ; cd -

Arch Linux

Source

git clone https://aur.archlinux.org/nchat-git.git && cd nchat-git

Prepare

Open PKGBUILD in your favourite editor.
Add `php` and `clang` on depends array.
Change the `_install_mode` to `slow`.

Build

makepkg -s

Install

makepkg -i

Getting Started

In order to configure / setup an account one needs to run nchat in setup mode:

nchat --setup

The setup mode prompts for phone number, which shall be entered with country code. Example:

$ nchat --setup
Protocols:
0. Telegram
1. Exit setup
Select protocol (1): 0
Enter phone number (ex. +6511111111): +6511111111
Enter authentication code: xxxxx
Succesfully set up profile Telegram_+6511111111

If you are not sure what phone number to enter, open Telegram on your phone and press the menu button and use the number displayed there (omitting spaces, so for the below screenshot the number to enter is +6511111111).

screenshot telegram phone

Once the setup process is completed nchat will exit, and can now be restarted in normal mode:

nchat

Troubleshooting

If any issues are observed, try running nchat with verbose logging

nchat --verbose

and provide a copy of ~/.nchat/main.log when reporting the issue. The preferred way of reporting issues and asking questions is by opening a Github issue.

Telegram Group

A Telegram group https://t.me/nchatusers is available for users to discuss nchat usage and related topics.

Bug reports, feature requests and usage questions directed at the nchat maintainer(s) should however be reported using Github issues to ensure they are properly tracked and get addressed.

Security

User data is stored locally in ~/.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 Telegram data. To protect against the most simple attack vectors it may be suitable to use disk encryption and to ensure ~/.nchat is not backed up unencrypted.

Configuration

The following configuration files (listed with current default values) can be used to configure nchat.

~/.nchat/app.conf

This configuration file holds general application settings. Default content:

experimental_cache_enabled=0

experimental_cache_enabled

Specifies whether to enable (experimental) cache functionality.

~/.nchat/ui.conf

This configuration file holds general user interface settings. Default content:

attachment_indicator=📎
attachment_prefetch=2
confirm_deletion=1
downloadable_indicator=+
emoji_enabled=1
failed_indicator=✗
help_enabled=1
home_fetch_all=0
list_enabled=1
muted_indicate_unread=1
muted_notify_unread=0
muted_position_by_timestamp=1
read_indicator=✓
syncing_indicator=⇄
terminal_bell=1
top_enabled=1

attachment_indicator

Specifies text to prefix attachment filenames in message view.

attachment_prefetch

Specifies level of attachment prefetching:

0 = no prefetch (download upon open/save)
1 = selected (download upon message selection)
2 = all (download when message is received) <- default

Non-default options are currently only supported for Telegram, not other protocols.

confirm_deletion

Specifies whether to prompt the user for confirmation when deleting a message.

downloadable_indicator

Specifies text to suffix attachment filenames in message view for attachments not yet downloaded. This is only shown for attachment_prefetch < 2.

emoji_enabled

Specifies whether to display emojis. Controlled by Ctrl-y in run-time.

failed_indicator

Specifies text to suffix attachment filenames in message view for failed downloads.

help_enabled

Specifies whether to display help bar. Controlled by Ctrl-g in run-time.

home_fetch_all

Specifies whether home button shall repeatedly fetch all chat history.

list_enabled

Specifies whether to display chat list. Controlled by Ctrl-l in run-time.

muted_indicate_unread

Specifies whether chat list should indicate unread status * for muted chats. This also determines whether the such chats are included in jump to unread.

muted_notify_unread

Specifies whether to notify (terminal bell) new unread messages in muted chats.

muted_position_by_timestamp

Specifies whether chat list position of muted chats should reflect the time of their last received/sent message. Otherwise muted chats are listed last.

read_indicator

Specifies text to indicate a message has been read by the receiver.

syncing_indicator

Specifies text to suffix attachment filenames in message view for downloads in progress.

terminal_bell

Specifies whether notifications shall trigger terminal bell.

top_enabled

Specifies whether to display top bar. Controlled by Ctrl-p in run-time.

~/.nchat/key.conf

This configuration file holds user interface key bindings. Default content:

backspace=KEY_BACKSPACE
cancel=KEY_CTRLC
delete=KEY_DC
delete_msg=KEY_CTRLD
down=KEY_DOWN
end=KEY_END
home=KEY_HOME
left=KEY_LEFT
next_chat=KEY_TAB
next_page=KEY_NPAGE
open=KEY_CTRLV
open_link=KEY_CTRLW
other_commands_help=KEY_CTRLO
prev_chat=KEY_BTAB
prev_page=KEY_PPAGE
quit=KEY_CTRLQ
return=KEY_RETURN
right=KEY_RIGHT
save=KEY_CTRLR
select_contact=KEY_CTRLS
select_emoji=KEY_CTRLE
send_msg=KEY_CTRLX
toggle_emoji=KEY_CTRLY
toggle_help=KEY_CTRLG
toggle_list=KEY_CTRLL
toggle_top=KEY_CTRLP
transfer=KEY_CTRLT
unread_chat=KEY_CTRLU
up=KEY_UP

Refer to function UiKeyConfig::GetKeyCode() in uikeyconfig.cpp for a list of supported key names to use in the config file. Alternatively key codes may be entered in hex format (e.g. 0x9).

~/.nchat/color.conf

This configuration file holds user interface color settings. Default content:

dialog_attr=
dialog_attr_selected=reverse
dialog_color_bg=
dialog_color_fg=
entry_attr=
entry_color_bg=
entry_color_fg=
help_attr=reverse
help_color_bg=black
help_color_fg=white
history_name_attr=bold
history_name_attr_selected=reverse
history_name_recv_color_bg=
history_name_recv_color_fg=
history_name_sent_color_bg=
history_name_sent_color_fg=gray
history_text_attr=
history_text_attr_selected=reverse
history_text_recv_color_bg=
history_text_recv_color_fg=
history_text_sent_color_bg=
history_text_sent_color_fg=gray
list_attr=
list_attr_selected=bold
list_color_bg=
list_color_fg=
listborder_attr=
listborder_color_bg=
listborder_color_fg=
status_attr=reverse
status_color_bg=
status_color_fg=
top_attr=reverse
top_color_bg=
top_color_fg=

Supported text attributes _attr (defaults to normal if not specified):

normal
underline
reverse
bold
italic

Supported text background _bg and foreground _fg colors:

black
red
green
yellow
blue
magenta
cyan
white
gray
bright_black (same as gray)
bright_red
bright_green
bright_yellow
bright_blue
bright_magenta
bright_cyan
bright_white

Custom colors may be specified using hex RGB code, for example 0xff8937.

General

Deleting a configuration entry line (while nchat is not running) and starting nchat will populate the configuration file with the default entry.

Technical Details

Third-party Libraries

nmail is primarily implemented in C++ with some parts in Go. Its source tree includes the source code of the following third-party libraries:

Code Formatting

Uncrustify is used to maintain consistent source code formatting, example:

./make.sh src

License

nchat is distributed under the MIT license. See LICENSE file.

Alternatives

Other terminal-based Telegram clients:

Keywords

command line, console-based, linux, macos, chat client, ncurses, telegram, terminal-based.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].