Skip to content
bercly0bPublic

About

RTG — a fast, vim-like Telegram client for the terminal (Telegram TUI/CLI), written in Rust on TDLib. Just chats and messages: no stories, no ads. Linux & macOS.

Topics

Resources

Contributing

Stars

22 stars

Watchers

1 watching

Forks

Repository files navigation

English | Русский

RTG — Telegram TUI client in Rust

Fast, vim-like terminal Telegram client (CLI/TUI), built on TDLib and ratatui.

Rust Built with ratatui Powered by TDLib License: MIT Release

RTG is a fast, keyboard-driven Telegram client for the terminal on Linux and macOS, written in Rust on top of TDLib. It strips Telegram down to its core — chats and messages. That's it. No stories. No ads. No notifications. Enjoy the silence.

RTG demo: browsing the Telegram chat list with vim-like keys, searching chats, reading and sending messages, reacting to a message and viewing chat info in the terminal

Features

  • Chat list with unread counters, search, folders and archive
  • Global search across chats, contacts and messages
  • Forum topics
  • Read, send, reply to, edit, delete and copy messages
  • Reactions
  • Voice messages, recorded with ffmpeg
  • Send files from a built-in file picker
  • Download and save files, with a size limit for auto-download
  • Open attachments and links in your own apps (mailcap-style handlers)
  • Chat and message info
  • Single-column layout for narrow windows: only the chat list or the open chat, switched on automatically or with a key
  • Vim-like keys, every one remappable
  • Built-in updater: rtg update

Installation

RTG runs on macOS and Linux.

Install script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/bercly0b/rtg/releases/latest/download/rtg-tui-installer.sh | sh

The script puts rtg into ~/.cargo/bin and adds it to your PATH. Archives for each platform and checksums are in the latest release.

Homebrew

brew install bercly0b/rtg/rtg

Cargo

cargo install --locked rtg-tui

This builds rtg from source and needs a Rust toolchain.

Linux requirements

rtg needs Ubuntu 24.04 or newer (glibc 2.39) and the libc++ runtime:

  • Ubuntu 24.04: sudo apt install libc++1 libc++abi1
  • Ubuntu 26.04 and newer: sudo apt install libc++1 libc++abi1 llvm-libunwind1

Building with Cargo also needs the libc++ headers: sudo apt install libc++-dev libc++abi-dev.

Getting started

  1. Run rtg.
  2. On the first run, enter your phone number and the code Telegram sends you, then your two-step verification password if you have one.
  3. Press ? to see the hotkeys.

rtg logout signs you out and removes the local session.

Hotkeys

Everywhere:

Key Action
? Show the hotkeys
L Switch between one and two columns
U Install the update
q Quit

In the chat list:

Key Action
j / k Next / previous chat
gg First chat
Enter / l Open the chat
/ Quick search: jump to a chat of the list by its title
s Global search across chats, contacts and messages
f Pick a folder or the archive
A Archive or unarchive the chat
r Mark the chat as read
I Chat info

In an open chat:

Key Action
j / k Next / previous message
G Last message
gd Jump to replied or forwarded message
h / Esc Back to the chat list
i Write a message
r Reply to the message
e Edit the message
dd Delete the message
y Copy the message
R React to the message
l Open the attachment
o Open a link from the message
A Attach a file
v Record a voice message
D Download the file
S Save the file to Downloads
m Message info

While writing a message, Enter sends it and Shift+Enter starts a new line.

Inside tmux, Shift+Enter works only with extended keys turned on in tmux.conf; without them it sends the message:

set -s extended-keys on
set -s extended-keys-format csi-u
set -as terminal-features 'xterm*:extkeys'

xterm* is matched against the TERM of the terminal tmux runs in. Reload the config, then detach and attach again.

The full list is in RTG itself: press ?.

Configuration

RTG reads its configuration from ~/.config/rtg/config.toml (or $XDG_CONFIG_HOME/rtg/config.toml if set). The file is optional.

[download]
max_auto_download_size = "10MB"

[open]
"audio/*" = "mpv {file_path}"
"image/*" = "imv {file_path}"

[attach]
dirs = ["~/Downloads", "~/Documents"]

[keys]
quit = "Q"
delete_message = "xx"
Section What it sets
[logging] Log level and how many log files to keep
[telegram] Your own Telegram API credentials
[voice] The command that records voice messages
[attach] Where the file picker looks for files
[download] The size limit for auto-download
[open] Apps that open attachments, by MIME type
[updates] The daily check for a newer release
[layout] One column or two
[keys] Hotkeys

See config.example.toml for the full reference.

Contributing

Contributions are welcome. Please read CONTRIBUTING.md before opening a pull request — it also covers building from source — and check the open issues for areas that need help.

If you like RTG, give it a star — it helps other people discover the project. Lists such as awesome-rust only accept projects with enough stars.

License

MIT

About

RTG — a fast, vim-like Telegram client for the terminal (Telegram TUI/CLI), written in Rust on TDLib. Just chats and messages: no stories, no ads. Linux & macOS.

Topics

Resources

Contributing

Stars

22 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages