78 lines
2.5 KiB
Markdown
78 lines
2.5 KiB
Markdown
# telegram-tui
|
|
|
|
A minimal Telegram terminal client built with `ncurses` and TDLib.
|
|
|
|
## Features
|
|
|
|
- interactive login flow inside the TUI
|
|
- chat list in the left pane
|
|
- message view in the right pane
|
|
- send plain text messages
|
|
- scroll chats and message history with the keyboard
|
|
|
|
## Requirements
|
|
|
|
- CMake 3.21+
|
|
- a C++17 compiler
|
|
- `ncurses`
|
|
- TDLib build dependencies (`gperf`, `openssl`, `zlib`, `git`)
|
|
|
|
The project vendors TDLib automatically by default. If you already have TDLib installed with CMake package metadata, configure with `-DTELEGRAM_TUI_USE_SYSTEM_TDLIB=ON`.
|
|
|
|
## Build
|
|
|
|
```bash
|
|
cmake -S . -B build
|
|
cmake --build build -j
|
|
```
|
|
|
|
During configure, CMake also checks the app config at
|
|
`$XDG_DATA_HOME/telegram-tui/config.json` or `~/.local/share/telegram-tui/config.json`.
|
|
If that file contains `api_id` and `api_hash`, they are embedded into the build.
|
|
|
|
## Run
|
|
|
|
Create a Telegram application at <https://my.telegram.org/apps>, then either rely on the
|
|
embedded credentials from the app config above, or export credentials:
|
|
|
|
```bash
|
|
export TELEGRAM_API_ID=123456
|
|
export TELEGRAM_API_HASH=0123456789abcdef0123456789abcdef
|
|
./build/telegram-tui
|
|
```
|
|
|
|
Or start the app without env vars and enter them interactively when prompted.
|
|
When entered in the TUI, the app now stores `api_id` and `api_hash` in
|
|
`~/.local/share/telegram-tui/config.json` and reuses them on later launches.
|
|
|
|
To use Telegram test servers instead of production:
|
|
|
|
```bash
|
|
export TELEGRAM_USE_TEST_DC=1
|
|
./build/telegram-tui
|
|
```
|
|
|
|
The client stores TDLib state in `~/.local/share/telegram-tui/tdlib` for production and `~/.local/share/telegram-tui/test/tdlib` for test mode.
|
|
|
|
## Gitea Actions
|
|
|
|
The repository includes [`.gitea/workflows/build-tdlib.yaml`](.gitea/workflows/build-tdlib.yaml),
|
|
which builds the latest upstream TDLib tag on Gitea Actions and publishes a bundled TDLib
|
|
archive plus checksum to the Gitea Generic Package Registry under the `tdlib` package.
|
|
It also refreshes a `latest/tdlib-latest.json` manifest with the newest published version.
|
|
|
|
The repository also includes [`.gitea/workflows/release-app.yaml`](.gitea/workflows/release-app.yaml),
|
|
which builds a rolling `latest` release asset containing `usr/bin/shinoa` and the bundled
|
|
`usr/lib/libtdjson.so*`. The root `PKGBUILD` installs that prebuilt release as `shinoa-bin`.
|
|
|
|
## Keys
|
|
|
|
- `Up` / `Down`: move selection
|
|
- `Tab`: switch focus between chats and messages
|
|
- `Enter`: open the selected chat
|
|
- `i`: start composing a message
|
|
- `PgUp` / `PgDn`: scroll the current message view
|
|
- `r`: reload chats or history
|
|
- `Esc`: cancel current input
|
|
- `q`: quit
|