@emaxe/tuigram 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,78 +1,337 @@
1
1
  # 🚀 TuiGram
2
2
 
3
+ **English** · [Русский](./README.ru.md)
4
+
3
5
  [![npm](https://img.shields.io/npm/v/@emaxe/tuigram)](https://www.npmjs.com/package/@emaxe/tuigram)
4
6
  [![node](https://img.shields.io/node/v/@emaxe/tuigram)](https://nodejs.org)
5
7
  [![license](https://img.shields.io/npm/l/@emaxe/tuigram)](./LICENSE)
8
+ [![downloads](https://img.shields.io/npm/dm/@emaxe/tuigram)](https://www.npmjs.com/package/@emaxe/tuigram)
9
+ [![platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey)](#-installation)
6
10
 
7
- Полнофункциональный терминальный клиент Telegram (TUI + CLI) на Node.js на базе протокола MTProto (`teleproto`).
11
+ A full-featured Telegram terminal client (TUI + CLI) for Node.js, built on the MTProto protocol (`teleproto`).
8
12
 
9
- Позволяет полноценно общаться в Telegram прямо из терминала: просматривать список чатов с разделением по категориям, читать переписку с сохранением форматирования (жирный, курсив, ссылки, подсветка кода), отправлять сообщения, ответы (Reply), редактировать, удалять, ставить реакции и отправлять файлы.
13
+ TuiGram lets you use Telegram entirely from the terminal: browse your dialog list split into categories, read conversations with formatting preserved (bold, italic, links, code highlighting), send messages, reply, edit, delete, react and send files.
10
14
 
11
15
  ```
12
16
  ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
13
- │ 🚀 TuiGram │ Maksim (@maksim) │ ● В сети
14
- │ 👥 Tech Chat [1420 уч.] ✍️ Alex печатает...
17
+ │ 🚀 TuiGram │ Alex Rivers (@alex_rivers) │ ● В сети
18
+ │ 👥 Tech Chat [1420 уч.] ✍️ Sam печатает...
15
19
  ├──────────────────────────────┬──────────────────────────────────────────────────────────────┤
16
- │ [1:Все] [2:ЛС] [3:Группы]...─────── Сегодня ───────
20
+ │ [1:Все] [2:ЛС] [3:Группы] ──────────────── Сегодня ────────────────
17
21
  │ [/] Поиск чатов... │ │
18
- │ 📌 👤 Pavel Durov · Let me… Alex [13:40]
22
+ │ 📌 👤 Sam Lee · Let me know Sam Lee [13:40]
19
23
  │ 👥 Tech Chat · Nice work! [3]│ Have you checked the latest release? │
20
- │ 🤖 BotFather · Done! 12:10 Вы [13:42] ✓✓
21
- │ 📢 News Channel · Дайд… [12] │ ┌─ Ответ на сообщение #1042
24
+ │ 🤖 Deploy Bot · Done! 12:10│
25
+ │ 📢 News Channel · Дайд… [12] │ Sam Lee [13:41]
26
+ │ 👤 Mia Novak · 📷 Фото 9:41 │ 📷 Фото · 1.8 MB │
27
+ │ 💾 Избранное · Ссылка вчр│ │
28
+ │ │ Вы [13:42] ✓✓ │
29
+ │ │ ┌─ Ответ на сообщение #1042 │
22
30
  │ │ Yes, testing it right now! │
23
31
  │ │ 👍 4 🔥 2 │
24
32
  │ ├──────────────────────────────────────────────────────────────┤
25
- │ │ ↩️ Ответ на [Alex]: "Have you checked..." [Esc: Отмена]
26
- │ │ Пишу ответ прямо здесь█
27
- │ │ │
33
+ │ │ ↩️ Ответ на [Sam Lee]: "Have you checked" [Esc]
34
+ │ │ Пишу ответ прямо здесь█
28
35
  ├──────────────────────────────┴──────────────────────────────────────────────────────────────┤
29
- │ [Tab] Панель │ [Enter] Отправить │ [1-6] Вкладки │ [F1] Помощь │ [Ctrl+A] Действия [Ctrl+Q]│
36
+ │ [Tab] Панель │ [Enter] Отправить │ [1-6] Вкладки │ [F1] Помощь │ [Ctrl+Q] Выход
30
37
  └─────────────────────────────────────────────────────────────────────────────────────────────┘
31
38
  ```
32
39
 
40
+ > **Note on localization.** The TUI and CLI interface strings are currently in Russian only.
41
+ > The client itself works with any language of chat content. Localization of the UI is planned —
42
+ > see [CHANGELOG.md](./CHANGELOG.md).
43
+
33
44
  ---
34
45
 
35
- ## Особенности и возможности
36
-
37
- - **Полноценный интерактивный TUI**:
38
- - Двухпанельный адаптивный интерфейс (список чатов слева + история и поле ввода справа);
39
- - Поддержка управления клавиатурой и мышью (клики, прокрутка колесом);
40
- - Категории чатов: Все, Личные (ЛС), Группы, Каналы, Боты, Непрочитанные;
41
- - Мгновенный поиск и фильтрация чатов по названию и `@username` (`/`);
42
- - Отображение статуса набора текста («Собеседник печатает...») в реальном времени;
43
- - Цветовое форматирование Telegram Entities (Bold, Italic, Monospace Code, URLs, Mentions, Spoilers);
44
- - Индикаторы медиа-вложений (фото, видео, документы, голосовые, стикеры, опросы);
45
- - Реакции на сообщения (👍, 🔥, ❤️);
46
- - Бесконечная пагинация истории сообщений вверх (`PageUp` / `Ctrl+U`);
47
- - Контекстные режимы быстрого ответа (Reply `Ctrl+R`) и редактирования (Edit `Ctrl+E`);
48
- - Модальные окна: Справка (`F1` / `?`), Сведения о чате (`Ctrl+P`), Меню действий (`Ctrl+A`), Отправка файла (`Ctrl+O`).
49
- - **Автономный CLI-режим**:
50
- - Быстрая отправка сообщений и файлов из командной строки;
51
- - Просмотр списка диалогов и истории в терминале;
52
- - Потоковый стриминг живых обновлений.
53
- - **Умная конфигурация**:
54
- - Ключи и сессия хранятся в пользовательских директориях ОС — пакет остаётся read-only и переживает обновления;
55
- - Безопасное хранение сессии и ключей (`chmod 0600`).
46
+ ## 📑 Table of contents
47
+
48
+ - [Features](#-features)
49
+ - [Screenshots](#-screenshots)
50
+ - [Installation](#-installation)
51
+ - [First run](#-first-run)
52
+ - [Where files are stored](#-where-files-are-stored)
53
+ - [Development](#-development)
54
+ - [Keyboard shortcuts](#️-keyboard-shortcuts)
55
+ - [Slash commands](#-slash-commands-in-the-input-box)
56
+ - [Sending files and images](#-sending-files-and-images)
57
+ - [Themes](#-themes)
58
+ - [Proxy configuration](#-proxy-configuration)
59
+ - [Command line usage (CLI)](#️-command-line-usage-cli)
60
+ - [Project structure](#-project-structure)
61
+ - [Security](#-security)
62
+ - [Changelog](#-changelog)
63
+ - [Contributing](#-contributing)
64
+ - [License](#-license)
56
65
 
57
66
  ---
58
67
 
59
- ## 📦 Установка
68
+ ## Features
69
+
70
+ - **A complete interactive TUI**:
71
+ - Two-pane adaptive layout (dialog list on the left, history and input box on the right);
72
+ - Keyboard and mouse control (clicks, wheel scrolling);
73
+ - Chat categories: All, Direct messages, Groups, Channels, Bots, Unread;
74
+ - Instant search and filtering of chats by title and `@username` (`/`);
75
+ - Live typing indicator ("… is typing");
76
+ - Colored rendering of Telegram entities (bold, italic, monospace code, URLs, mentions, spoilers);
77
+ - Media attachment indicators (photo, video, document, voice, sticker, poll);
78
+ - Message reactions (👍, 🔥, ❤️);
79
+ - Infinite upward pagination of message history (`PageUp` / `Ctrl+U`);
80
+ - Contextual quick-reply (`Ctrl+R`) and edit (`Ctrl+E`) modes;
81
+ - Modal windows: Help (`F1` / `?`), Chat info (`Ctrl+P`), Action menu (`Ctrl+A`), Send file (`Ctrl+O`).
82
+ - **Standalone CLI mode**:
83
+ - Send messages and files straight from the command line;
84
+ - List dialogs and print chat history in the terminal;
85
+ - Stream live updates.
86
+ - **Sensible configuration**:
87
+ - Credentials and session live in OS user directories — the package stays read-only and survives updates;
88
+ - Session and credentials are written with `0600` permissions.
89
+
90
+ ---
91
+
92
+ ## 🖼 Screenshots
93
+
94
+ TuiGram lives in the terminal, so instead of images here are exact text captures of its
95
+ screens. Labels, hints and output formats are taken from the interface code rather than
96
+ invented; the data in the examples is fictional.
97
+
98
+ Note that the interface strings are Russian — the screens below show the client as it
99
+ actually looks today.
60
100
 
61
- ### Вариант 1: глобальная установка из npm (рекомендуется)
101
+ The main window is shown at the top of this README. Below are the remaining screens.
102
+
103
+ ### Chat search and filtering
104
+
105
+ `/` starts an instant search by title and `@username`; the digits `1`–`6` switch categories
106
+ (All, Direct messages, Groups, Channels, Bots, Unread).
107
+
108
+ ```
109
+ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
110
+ │ 🚀 TuiGram │ Alex Rivers (@alex_rivers) │ ● В сети │
111
+ ├──────────────────────────────┬──────────────────────────────────────────────────────────────┤
112
+ │ [1:Все] [2:ЛС] [3:Группы] … │ ──────────────── Сегодня ──────────────── │
113
+ │ [/] tech█ │ │
114
+ │ 👥 Tech Chat · Nice work! [3]│ Sam Lee [11:02] │
115
+ │ 📢 Tech Digest · Выпуск… │ Let me know how it goes. │
116
+ │ 🤖 TechSupport Bot · Ок │ │
117
+ │ │ Вы [11:05] ✓✓ │
118
+ │ 3 из 214 чатов │ Will do 👍 │
119
+ │ ├──────────────────────────────────────────────────────────────┤
120
+ │ │ Введите сообщение…█ │
121
+ └──────────────────────────────┴──────────────────────────────────────────────────────────────┘
122
+ ```
123
+
124
+ <details>
125
+ <summary><b>Help — <code>F1</code> / <code>?</code></b></summary>
126
+
127
+ The full list of shortcuts and slash commands, right inside the client.
128
+
129
+ ```
130
+ ┌──────────────────────────────────────────────────────────────────────────┐
131
+ │ 🚀 TuiGram — Горячие клавиши и управление │
132
+ │ │
133
+ │ Навигация и фокус: │
134
+ │ [Tab] / [Shift+Tab] Фокус: Чаты → Сообщения → Ввод │
135
+ │ [↑] / [↓] Перемещение по списку чатов │
136
+ │ [Enter] Открыть чат / Загрузить историю │
137
+ │ [PageUp] / [Ctrl+U] Прокрутка вверх / старая история │
138
+ │ │
139
+ │ Вкладки фильтрации диалогов: │
140
+ │ [1] Все чаты [2] Личные (ЛС) [3] Группы │
141
+ │ [4] Каналы [5] Боты [6] Непрочитанные │
142
+ │ [/] Поиск чатов по названию/username │
143
+ │ │
144
+ │ Работа с сообщениями: │
145
+ │ [Enter] Отправить [Ctrl+R] Ответить (Reply) │
146
+ │ [Ctrl+J] Перенос строки [Ctrl+E] Редактировать сообщение │
147
+ │ [Ctrl+A] Меню действий [Ctrl+O] Отправить файл / фото │
148
+ │ [Ctrl+P] Инфо о чате [Esc] Закрыть окно / режим │
149
+ │ │
150
+ │ Слэш-команды в поле ввода: │
151
+ │ /help /info /sendfile /sendfile <путь> /clear /logout │
152
+ │ │
153
+ │ Выход: │
154
+ │ [Ctrl+Q] или [Ctrl+C] Безопасный выход из клиента │
155
+ │ │
156
+ │ [ Закрыть ] │
157
+ └──────────────────────────────────────────────────────────────────────────┘
158
+ ```
159
+
160
+ </details>
161
+
162
+ <details>
163
+ <summary><b>Message action menu — <code>Ctrl+A</code></b></summary>
164
+
165
+ Reply, edit, delete, reactions and attachment download. "Edit" and
166
+ "Download" appear only where they actually apply.
167
+
168
+ ```
169
+ ┌──────────────────────────────────────────────────────┐
170
+ │ ⚡ Действия с сообщением #1042 │
171
+ │ Sam Lee: Have you checked the latest release? │
172
+ ├──────────────────────────────────────────────────────┤
173
+ │ ↩️ Ответить (Reply) │
174
+ │ ✏️ Редактировать текст │
175
+ │ 🗑️ Удалить сообщение │
176
+ │ 👍 Поставить реакцию 👍 │
177
+ │ 🔥 Поставить реакцию 🔥 │
178
+ │ ❤️ Поставить реакцию ❤️ │
179
+ │ 📥 Скачать медиа-вложение │
180
+ │ 📋 Скопировать текст в ввод │
181
+ ├──────────────────────────────────────────────────────┤
182
+ │ [↑↓] Выбор [Enter] Выполнить [Esc] Отмена │
183
+ └──────────────────────────────────────────────────────┘
184
+ ```
185
+
186
+ </details>
187
+
188
+ <details>
189
+ <summary><b>Send file — <code>Ctrl+O</code></b></summary>
190
+
191
+ Several paths separated by `|` are sent as a single album. The line under the
192
+ checkbox states exactly what the file will become on Telegram's side.
193
+
194
+ ```
195
+ ┌────────────────────────────────────────────────────────────┐
196
+ │ 📤 Отправка файла или документа │
197
+ ├────────────────────────────────────────────────────────────┤
198
+ │ Путь к файлу (несколько — через |) [Ctrl+F] Обзор │
199
+ │ ┌────────────────────────────────────────────────────────┐ │
200
+ │ │ ~/Desktop/photo.png | ~/Desktop/chart.png█ │ │
201
+ │ └────────────────────────────────────────────────────────┘ │
202
+ │ Подпись (необязательно): │
203
+ │ ┌────────────────────────────────────────────────────────┐ │
204
+ │ │ Две картинки с релиза │ │
205
+ │ └────────────────────────────────────────────────────────┘ │
206
+ │ [ ] Как файл, без сжатия [Ctrl+D] │
207
+ │ ✓ photo.png · 2.4 MB · уйдёт как фото │
208
+ ├────────────────────────────────────────────────────────────┤
209
+ │ [ Отправить ] [ Отмена ] │
210
+ │ [Tab] Поля [Enter] Далее [Ctrl+F] Обзор [Esc] Выход │
211
+ └────────────────────────────────────────────────────────────┘
212
+ ```
213
+
214
+ </details>
215
+
216
+ <details>
217
+ <summary><b>File browser — <code>Ctrl+F</code></b></summary>
218
+
219
+ Navigate folders with the arrow keys; the size of the highlighted file is shown
220
+ at the bottom.
221
+
222
+ ```
223
+ ┌──────────────────────────────────────────────────────────┐
224
+ │ 📁 Выбор файла: /Users/alex/Desktop │
225
+ ├──────────────────────────────────────────────────────────┤
226
+ │ .. <папка> │
227
+ │ screenshots/ <папка> │
228
+ │ ▸ photo.png 2.4 MB │
229
+ │ chart.png 812 KB │
230
+ │ report.pdf 1.1 MB │
231
+ │ archive.zip 18.7 MB │
232
+ ├──────────────────────────────────────────────────────────┤
233
+ │ photo.png · 2.4 MB │
234
+ │ [↑↓] Навигация [Enter] Выбрать [Esc] Назад │
235
+ └──────────────────────────────────────────────────────────┘
236
+ ```
237
+
238
+ </details>
239
+
240
+ <details>
241
+ <summary><b>Chat info — <code>Ctrl+P</code></b></summary>
242
+
243
+ ID, type, username, member count and description.
244
+
245
+ ```
246
+ ┌──────────────────────────────────────────────────────┐
247
+ │ ℹ Информация о чате │
248
+ ├──────────────────────────────────────────────────────┤
249
+ │ Название: Tech Chat │
250
+ │ Тип: supergroup │
251
+ │ ID: -1001234567890 │
252
+ │ Username: @techchat │
253
+ │ Участников: 1420 │
254
+ │ Уведомления: Включены │
255
+ │ │
256
+ │ О чате / О себе: │
257
+ │ Чат про терминальные клиенты и MTProto. │
258
+ ├──────────────────────────────────────────────────────┤
259
+ │ [ Закрыть ] │
260
+ └──────────────────────────────────────────────────────┘
261
+ ```
262
+
263
+ </details>
264
+
265
+ ### Command line mode
266
+
267
+ <details>
268
+ <summary><b>CLI command output</b></summary>
269
+
270
+ **`tuigram dialogs --limit 8`**
271
+
272
+ ```
273
+ 📂 Загрузка диалогов (макс. 8)...
274
+
275
+ 📌 [user ] Sam Lee id=100200301
276
+ [supergroup] Tech Chat id=-1001234567890 (+3)
277
+ [bot ] Deploy Bot id=100200302
278
+ [channel ] News Channel id=-1009876543210 (+12)
279
+ [saved ] Избранное id=100200300
280
+ [user ] Mia Novak id=100200303 (+1)
281
+ [group ] Team Terminal id=-400112233
282
+ [user ] Nina Ivanova id=100200304
283
+
284
+ Всего получено: 8 диалогов
285
+ ```
286
+
287
+ **`tuigram history @sam_lee --limit 5`**
288
+
289
+ ```
290
+ 💬 Загрузка истории для @sam_lee (макс. 5 сообщений)...
291
+
292
+ [29.08.2026, 11:02:14] #1040 Sam Lee: Let me know how it goes.
293
+ [29.08.2026, 11:05:41] #1041 Вы: Will do 👍
294
+ [29.08.2026, 13:40:07] #1042 Sam Lee: Have you checked the latest release?
295
+ [29.08.2026, 13:41:22] #1043 Sam Lee: 📷 Фото
296
+ [29.08.2026, 13:42:55] #1044 Вы (в ответ на #1042): Yes, testing it right now! (изменено)
297
+
298
+ Всего отображено: 5 сообщений
299
+ ```
300
+
301
+ **`tuigram listen`**
302
+
303
+ ```
304
+ 🟢 Подключено как: Alex Rivers (@alex_rivers)
305
+ Слушаю обновления в реальном времени... Нажмите Ctrl+C для выхода.
306
+
307
+ [13:40:07] + НОВОЕ [-1001234567890] Sam Lee: Have you checked the latest release?
308
+ [13:41:19] ✍️ ПЕЧАТАЕТ чат: -1001234567890
309
+ [13:42:55] + НОВОЕ [-1001234567890] Вы: Yes, testing it right now!
310
+ [13:43:30] ~ ИЗМЕНЕНО [-1001234567890] #1044: Yes, testing it right now! 🚀
311
+ [13:44:02] - УДАЛЕНО [123456789] IDs: 1039, 1038
312
+ ```
313
+
314
+ </details>
315
+
316
+ ---
317
+
318
+ ## 📦 Installation
319
+
320
+ ### Option 1: global install from npm (recommended)
62
321
 
63
322
  ```bash
64
323
  npm install -g @emaxe/tuigram
65
324
  ```
66
325
 
67
- После этого команда `tuigram` доступна в любом каталоге.
326
+ The `tuigram` command is then available from any directory.
68
327
 
69
- ### Вариант 2: разовый запуск без установки
328
+ ### Option 2: one-off run without installing
70
329
 
71
330
  ```bash
72
331
  npx @emaxe/tuigram
73
332
  ```
74
333
 
75
- ### Вариант 3: из исходников (для разработки)
334
+ ### Option 3: from source (for development)
76
335
 
77
336
  ```bash
78
337
  git clone https://github.com/emaxe/tuigram.git
@@ -83,282 +342,351 @@ npm start
83
342
 
84
343
  ---
85
344
 
86
- ## ⚙️ Первый запуск
345
+ ## ⚙️ First run
87
346
 
88
- ### 1. Ключи Telegram API
347
+ ### 1. Telegram API credentials
89
348
 
90
- Получите `api_id` и `api_hash` на [https://my.telegram.org](https://my.telegram.org) (раздел *API development tools*), затем:
349
+ Get your `api_id` and `api_hash` at [https://my.telegram.org](https://my.telegram.org) (*API development tools*), then run:
91
350
 
92
351
  ```bash
93
352
  tuigram init
94
353
  ```
95
354
 
96
- Команда спросит оба ключа и сохранит их с правами `0600`. Для скриптов и CI есть неинтерактивный вариант:
355
+ The command asks for both keys and stores them with `0600` permissions. For scripts and CI there is a non-interactive form:
97
356
 
98
357
  ```bash
99
358
  tuigram init --api-id 1234567 --api-hash 0123456789abcdef0123456789abcdef
100
359
  ```
101
360
 
102
- Альтернатива переменные окружения `TELEGRAM_API_ID` и `TELEGRAM_API_HASH`: они имеют приоритет над файлом настроек.
361
+ Alternatively, use the `TELEGRAM_API_ID` and `TELEGRAM_API_HASH` environment variables they take precedence over the settings file.
103
362
 
104
- ### 2. Авторизация и запуск
363
+ ### 2. Authorization and launch
105
364
 
106
365
  ```bash
107
366
  tuigram
108
367
  ```
109
368
 
110
- При первом запуске TuiGram предложит ввести номер телефона, код подтверждения из Telegram и пароль 2FA (если включён). После этого сессия сохранится, и последующие запуски будут происходить мгновенно.
369
+ On first launch TuiGram asks for your phone number, the confirmation code from Telegram and your 2FA password (if enabled). The session is then saved and subsequent launches are instant.
111
370
 
112
- Отдельно авторизоваться можно командой `tuigram login`.
371
+ You can also authorize separately with `tuigram login`.
113
372
 
114
- > **В неинтерактивной среде** (CI, пайп, `< /dev/null`) вход по телефону невозможен:
115
- > `tuigram login` сразу завершится с понятной ошибкой вместо зависания. Если сессия
116
- > уже есть команда просто сообщит, под кем вы авторизованы, и вернёт код `0`.
117
- > Для автоматизации положите готовый `session.txt` в директорию данных
118
- > (путь подскажет `tuigram paths`).
373
+ > **In a non-interactive environment** (CI, a pipe, `< /dev/null`) phone login is impossible:
374
+ > `tuigram login` exits immediately with a clear error instead of hanging. If a session
375
+ > already exists, the command simply reports who you are signed in as and returns exit
376
+ > code `0`. For automation, drop a ready `session.txt` into the data directory
377
+ > (`tuigram paths` prints the location).
119
378
 
120
379
  ---
121
380
 
122
- ## 📂 Где хранятся файлы
381
+ ## 📂 Where files are stored
123
382
 
124
- Ничего не пишется внутрь самого пакетаэто важно при глобальной установке, где каталог `node_modules` обычно недоступен на запись и стирается при обновлении.
383
+ Nothing is written inside the package itself this matters for global installs, where `node_modules` is usually not writable and is wiped on update.
125
384
 
126
- | Что | macOS / Linux | Windows |
385
+ | What | macOS / Linux | Windows |
127
386
  |---|---|---|
128
- | Настройки (`.env`) | `~/.config/tuigram/.env` | `%APPDATA%\tuigram\.env` |
129
- | Сессия | `~/.local/share/tuigram/session.txt` | `%LOCALAPPDATA%\tuigram\session.txt` |
130
- | Загрузки из чатов | `~/.local/share/tuigram/downloads/` | `%LOCALAPPDATA%\tuigram\downloads\` |
387
+ | Settings (`.env`) | `~/.config/tuigram/.env` | `%APPDATA%\tuigram\.env` |
388
+ | Session | `~/.local/share/tuigram/session.txt` | `%LOCALAPPDATA%\tuigram\session.txt` |
389
+ | Downloads from chats | `~/.local/share/tuigram/downloads/` | `%LOCALAPPDATA%\tuigram\downloads\` |
131
390
 
132
- Посмотреть актуальные пути и состояние конфигурации:
391
+ To inspect the actual paths and configuration state:
133
392
 
134
393
  ```bash
135
394
  tuigram paths
136
395
  ```
137
396
 
138
- Переопределить расположение можно переменными `TUIGRAM_CONFIG_DIR` и `TUIGRAM_DATA_DIR` (учитываются также `XDG_CONFIG_HOME` / `XDG_DATA_HOME`).
397
+ Locations can be overridden with `TUIGRAM_CONFIG_DIR` and `TUIGRAM_DATA_DIR` (`XDG_CONFIG_HOME` / `XDG_DATA_HOME` are honored too).
139
398
 
140
- **Приоритет настроек** (сверху вниз, первое найденное выигрывает):
141
- 1. переменные окружения процесса;
142
- 2. `.env` в корне проектатолько при запуске из клона репозитория;
143
- 3. `~/.config/tuigram/.env` — основной файл установленного CLI.
399
+ **Settings precedence** (top to bottom, first match wins):
400
+ 1. process environment variables;
401
+ 2. `.env` in the project root only when running from a repository clone;
402
+ 3. `~/.config/tuigram/.env` — the main file for an installed CLI.
144
403
 
145
- Сессия из старых установок (`<проект>/data/session.txt`) переносится в новое расположение автоматически при первом запускеповторно логиниться не нужно.
404
+ A session from an older installation (`<project>/data/session.txt`) is migrated to the new location automatically on first run no need to log in again.
146
405
 
147
406
  ---
148
407
 
149
- ## 🛠 Разработка
408
+ ## 🛠 Development
150
409
 
151
- При запуске из клона репозитория работает интерактивное меню-диспетчер:
410
+ When running from a repository clone, an interactive launcher menu is available:
152
411
 
153
412
  ```bash
154
- ./run.sh # или npm run menu
413
+ ./run.sh # or npm run menu
155
414
  ```
156
415
 
157
- Оно даёт удобный выбор режима (TUI, логин, диалоги, отправка, тесты, очистка).
416
+ It offers a convenient choice of mode (TUI, login, dialogs, send, tests, cleanup).
158
417
 
159
- Тесты и проверка содержимого будущего npm-пакета:
418
+ Tests and a check of the future npm package contents:
160
419
 
161
420
  ```bash
162
- npm test # юнит-тесты
163
- node scripts/check-package.js # проверка, что в пакет не утекают .env и сессия
421
+ npm test # unit tests
422
+ node scripts/check-package.js # verifies that .env and the session do not leak into the package
164
423
  ```
165
424
 
166
425
  ---
167
426
 
168
- ## ⌨️ Горячие клавиши
427
+ ## ⌨️ Keyboard shortcuts
169
428
 
170
- | Сочетание клавиш | Область | Действие |
429
+ | Shortcut | Scope | Action |
171
430
  |---|---|---|
172
- | `Tab` / `Shift+Tab` | Глобально | Фокус по кругу: Список диалогов Лента сообщенийПоле ввода |
173
- | `↑` / `↓` | Список диалогов | Выбор чата |
174
- | `Enter` | Список диалогов | Открыть выбранный чат и загрузить историю |
175
- | `1` .. `6` | Список диалогов | Переключение категорий: `1:Все`, `2:ЛС`, `3:Группы`, `4:Каналы`, `5:Боты`, `6:Непроч` |
176
- | `/` | Список диалогов | Поиск / фильтрация чатов |
177
- | `Enter` | Поле ввода | Отправить набранное сообщение |
178
- | `Ctrl+J` | Поле ввода | Перенос строки без отправки |
179
- | `Ctrl+R` | Чат / Ввод | Ответить (Reply) на последнее сообщение |
180
- | `Ctrl+E` | Чат / Ввод | Редактировать своё последнее сообщение |
181
- | `Ctrl+A` | Сообщения | Контекстное меню действий (Реакции, Удаление, Скачивание, Ответ) |
182
- | `Ctrl+O` | Глобально | Отправить файл / фото / документ |
183
- | `Ctrl+F` | Окно отправки | Обзор файлов (навигация по папкам) |
184
- | `Ctrl+D` | Окно отправки | Отправить без сжатия, документом |
185
- | `Ctrl+P` | Глобально | Информация о текущем чате (ID, участники, ссылки) |
186
- | `PageUp` / `Ctrl+U`| История | Прокрутка вверх / подгрузка старой истории |
187
- | `PageDown` / `Ctrl+D`| История | Прокрутка вниз |
188
- | `Esc` | Модальные окна | Закрыть модальное окно / отменить Reply/Edit |
189
- | `F1` или `?` | Глобально | Окно справки со всеми горячими клавишами |
190
- | `Ctrl+Q` / `Ctrl+C` | Глобально | Безопасный выход из клиента |
431
+ | `Tab` / `Shift+Tab` | Global | Cycle focus: dialog listmessage feedinput box |
432
+ | `↑` / `↓` | Dialog list | Select a chat |
433
+ | `Enter` | Dialog list | Open the selected chat and load its history |
434
+ | `1` .. `6` | Dialog list | Switch category: `1:All`, `2:DM`, `3:Groups`, `4:Channels`, `5:Bots`, `6:Unread` |
435
+ | `/` | Dialog list | Search / filter chats |
436
+ | `Enter` | Input box | Send the typed message |
437
+ | `Ctrl+J` | Input box | Insert a line break without sending |
438
+ | `Ctrl+R` | Chat / Input | Reply to the last message |
439
+ | `Ctrl+E` | Chat / Input | Edit your own last message |
440
+ | `Ctrl+A` | Messages | Context action menu (reactions, delete, download, reply) |
441
+ | `Ctrl+O` | Global | Send a file / photo / document |
442
+ | `Ctrl+F` | Send dialog | File browser (navigate folders) |
443
+ | `Ctrl+D` | Send dialog | Send uncompressed, as a document |
444
+ | `Ctrl+P` | Global | Info about the current chat (ID, members, links) |
445
+ | `PageUp` / `Ctrl+U` | History | Scroll up / load older history |
446
+ | `PageDown` / `Ctrl+D` | History | Scroll down |
447
+ | `Esc` | Modals | Close the modal / cancel reply or edit |
448
+ | `F1` or `?` | Global | Help window with every shortcut |
449
+ | `Ctrl+Q` / `Ctrl+C` | Global | Safely exit the client |
191
450
 
192
451
  ---
193
452
 
194
- ## 💬 Слэш-команды в поле ввода
453
+ ## 💬 Slash commands in the input box
195
454
 
196
- В поле ввода сообщения доступны быстрые команды (начинаются с `/`):
455
+ Quick commands are available in the message input box (they start with `/`):
197
456
 
198
- - `/help` — открыть окно помощи;
199
- - `/info` — подробная информация о текущем чате;
200
- - `/sendfile` — открыть окно отправки файла;
201
- - `/sendfile <путь>`отправить файл сразу;
202
- - `/sendfile <путь> -- <подпись>`файл с подписью;
203
- - `/sendfile <путь> | <путь> -- <подпись>`альбом из нескольких файлов;
204
- - `/clear` — очистить экранную ленту сообщений;
205
- - `/logout` — выйти из аккаунта Telegram.
457
+ - `/help` — open the help window;
458
+ - `/info` — detailed information about the current chat;
459
+ - `/sendfile` — open the send-file dialog;
460
+ - `/sendfile <path>`send a file right away;
461
+ - `/sendfile <path> -- <caption>`file with a caption;
462
+ - `/sendfile <path> | <path> -- <caption>`an album of several files;
463
+ - `/clear` — clear the on-screen message feed;
464
+ - `/logout` — sign out of the Telegram account.
206
465
 
207
466
  ---
208
467
 
209
- ## 📎 Отправка файлов и картинок
468
+ ## 📎 Sending files and images
210
469
 
211
- Три способа: окно `Ctrl+O`, слэш-команда `/sendfile`, консольная команда `sendfile`.
470
+ Three ways: the `Ctrl+O` dialog, the `/sendfile` slash command, and the `sendfile` console command.
212
471
 
213
- **Окно отправки (`Ctrl+O`)**
472
+ **The send dialog (`Ctrl+O`)**
214
473
 
215
- - `Ctrl+F` — обзор файлов: навигация по папкам стрелками, `Enter` войти в папку или выбрать файл, `Esc` назад. Внизу показывается размер подсвеченного файла.
216
- - Путь можно и просто ввести: понимает `~/Desktop/foto.png`, пути в кавычках и с экранированными пробеламито есть перетаскивание файла прямо в терминал работает.
217
- - Несколько файловчерез `|` в поле пути (или добавляйте их по одному через обзор). До 10 штук уходят одним альбомом.
218
- - `Ctrl+D` — отправить без сжатия, документом. Полезно, когда важно исходное качество картинки.
219
- - Строка под чекбоксом сразу показывает, что именно уйдёт: `✓ photo.png · 2.4 MB · уйдёт как фото`.
220
- - Если в этот момент активен режим ответа (`Ctrl+R`), файл уйдёт **ответом** на сообщение.
474
+ - `Ctrl+F` — file browser: navigate folders with the arrow keys, `Enter` enters a folder or picks a file, `Esc` goes back. The size of the highlighted file is shown at the bottom.
475
+ - You can also just type a path: `~/Desktop/photo.png`, quoted paths and escaped spaces are understoodso dragging a file into the terminal works.
476
+ - Multiple filesseparate them with `|` in the path field (or add them one by one via the browser). Up to 10 are sent as a single album.
477
+ - `Ctrl+D` — send uncompressed, as a document. Useful when the original image quality matters.
478
+ - The line under the checkbox shows exactly what will be sent: `✓ photo.png · 2.4 MB · will be sent as a photo`.
479
+ - If reply mode (`Ctrl+R`) is active at that moment, the file is sent **as a reply** to that message.
221
480
 
222
- **Что уходит фото, а что документом**
481
+ **What goes as a photo and what as a document**
223
482
 
224
- `.png`, `.jpg`, `.jpeg` Telegram принимает как сжатое фото; видеоформаты (`.mp4`, `.mov`, `.mkv` и т.п.) как видео; всё остальное, включая `.webp` и `.heic`, документом. Флажок «Как файл, без сжатия» (`Ctrl+D`, в CLI — `--as-file`) заставляет отправить документом что угодно.
483
+ Telegram accepts `.png`, `.jpg`, `.jpeg` as compressed photos; video formats (`.mp4`, `.mov`, `.mkv`, etc.) as video; everything else, including `.webp` and `.heic`, as a document. The "As a file, uncompressed" checkbox (`Ctrl+D`, or `--as-file` in the CLI) forces anything to be sent as a document.
225
484
 
226
- **Прогресс и отмена**
485
+ **Progress and cancellation**
227
486
 
228
- Во время загрузки в строке состояния идут проценты. `Esc` прерывает отправку.
487
+ The status bar shows a percentage during upload. `Esc` aborts the transfer.
229
488
 
230
- **Скачивание входящих**
489
+ **Downloading incoming media**
231
490
 
232
- `Ctrl+A` на сообщении«Скачать медиа-вложение». Файл сохранится в `data/downloads/`.
491
+ `Ctrl+A` on a message "Download attachment". The file is saved to the downloads directory.
233
492
 
234
493
  ---
235
494
 
236
- ## 🎨 Темы оформления
495
+ ## 🎨 Themes
237
496
 
238
- Тема задаётся в `.env`:
497
+ The theme is set in `.env`:
239
498
 
240
499
  ```env
241
- TUI_THEME=default # тёмная (по умолчанию)
500
+ TUI_THEME=default # dark (default)
242
501
  TUI_THEME=nord # Nord
243
- TUI_THEME=light # светлая
502
+ TUI_THEME=light # light
503
+ ```
504
+
505
+ All colors are given as hex values and are reduced to the xterm-256 palette (indices ≥ 16).
506
+ Named colors (`blue`, `cyan`, `gray`) are deliberately avoided: they occupy indices 0–15,
507
+ which the terminal theme repaints as it pleases — that is why a blue background could render
508
+ as teal and gray text could disappear entirely.
509
+
510
+ The contrast of every "text on background" pair is verified by an automated WCAG test
511
+ (threshold 3:1) **after** conversion to xterm-256 — that is, exactly as the user will see it.
512
+
513
+ ---
514
+
515
+ ## 🌐 Proxy configuration
516
+
517
+ TuiGram supports routing MTProto connections through HTTP (including HTTPS CONNECT) and SOCKS5/SOCKS4 proxies — both with and without username/password authentication.
518
+
519
+ Proxy options can be configured in `.env` (or via environment variables):
520
+
521
+ **Single URL:**
522
+ ```env
523
+ PROXY_URL=http://127.0.0.1:8080
524
+ PROXY_URL=http://user:password@proxy.example.com:8080
525
+ PROXY_URL=socks5://127.0.0.1:1080
526
+ PROXY_URL=socks5://user:password@127.0.0.1:1080
244
527
  ```
245
528
 
246
- Все цвета заданы hex-значениями и сводятся к палитре xterm-256 (индексы ≥ 16).
247
- Именованные цвета (`blue`, `cyan`, `gray`) специально не используются: они
248
- занимают индексы 0–15, которые тема терминала перекрашивает по-своему — из-за
249
- этого синий фон мог рисоваться бирюзовым, а серый текст пропадать совсем.
529
+ **Or separate variables:**
530
+ ```env
531
+ PROXY_TYPE=http # http, https, socks5, socks4
532
+ PROXY_HOST=127.0.0.1
533
+ PROXY_PORT=8080
534
+ PROXY_USERNAME=user # optional
535
+ PROXY_PASSWORD=password # optional
536
+ PROXY_TIMEOUT=10 # timeout in seconds (default: 10)
537
+ ```
250
538
 
251
- Контраст каждой пары «текст на фоне» проверяется автотестом по WCAG (порог 3:1)
252
- уже **после** конверсии в xterm-256, то есть ровно в том виде, в каком цвет
253
- увидит пользователь.
539
+ Standard environment variables `HTTPS_PROXY`, `HTTP_PROXY`, and `ALL_PROXY` are also supported as fallbacks.
540
+ The active proxy status can be inspected using `tuigram paths`.
254
541
 
255
542
  ---
256
543
 
257
- ## 🛠️ Использование через консоль (CLI)
544
+ ## 🛠️ Command line usage (CLI)
258
545
 
259
- TuiGram можно запускать в режиме консольных утилит (при запуске из клона
260
- репозитория подставьте `node bin/tuigram.js` вместо `tuigram`):
546
+ TuiGram can be used as a set of console utilities (when running from a repository
547
+ clone, substitute `node bin/tuigram.js` for `tuigram`):
261
548
 
262
549
  ```bash
263
- # Авторизация
550
+ # Authorization
264
551
  tuigram login
265
552
 
266
- # Список диалогов
553
+ # List dialogs
267
554
  tuigram dialogs --limit 30
268
555
 
269
- # Просмотр истории чата (@username, ID или me для «Избранного»)
270
- tuigram history @durov --limit 20
556
+ # View chat history (@username, ID, or `me` for Saved Messages)
557
+ tuigram history @sam_lee --limit 20
271
558
  tuigram history me
272
559
 
273
- # Отправка текстового сообщения
274
- tuigram send me "Привет из терминала!"
275
- tuigram send @friend "Встречаемся в 18:00"
560
+ # Send a text message
561
+ tuigram send me "Hello from the terminal!"
562
+ tuigram send @friend "See you at 18:00"
276
563
 
277
- # Отправка файла (несколько путей уходят одним альбомом)
564
+ # Send a file (multiple paths are sent as one album)
278
565
  tuigram sendfile me ./screenshot.png
279
- tuigram sendfile me ~/a.png ~/b.png --caption "Две картинки"
280
- tuigram sendfile me ~/photo.png --as-file # без сжатия, документом
566
+ tuigram sendfile me ~/a.png ~/b.png --caption "Two pictures"
567
+ tuigram sendfile me ~/photo.png --as-file # uncompressed, as a document
281
568
 
282
- # Живой стрим обновлений в реальном времени
569
+ # Live stream of real-time updates
283
570
  tuigram listen
284
571
  ```
285
572
 
286
573
  ---
287
574
 
288
- ## 📁 Структура проекта
575
+ ## 📁 Project structure
289
576
 
290
577
  ```
291
578
  TuiGram/
292
579
  ├── bin/
293
- │ └── tuigram.js # CLI исполняемый файл
580
+ │ └── tuigram.js # CLI executable
294
581
  ├── src/
295
- │ ├── index.js # Главная точка входа (TUI / CLI роутер)
296
- │ ├── config.js # Пути пользовательских директорий и загрузчик .env
297
- │ ├── state.js # Реактивное централизованное хранилище состояния
582
+ │ ├── index.js # Main entry point (TUI / CLI router)
583
+ │ ├── config.js # User directory paths and .env loader
584
+ │ ├── state.js # Reactive centralized state store
298
585
  │ ├── telegram/
299
- │ │ ├── client.js # Создание и управление MTProto клиентом
300
- │ │ ├── auth.js # Интерактивный логин-визард и 2FA
301
- │ │ ├── dialogs.js # Получение, фильтрация и поиск диалогов
302
- │ │ ├── messages.js # Загрузка истории, отправка, правка, файлы, реакции
303
- │ │ ├── listener.js # Живой фоновый слушатель событий MTProto
304
- │ │ ├── entities.js # Парсинг пиров, типы чатов и кэш сущностей
305
- │ │ └── formatter.js # Telegram Entities -> Blessed ANSI форматирование
586
+ │ │ ├── client.js # MTProto client creation and management
587
+ │ │ ├── socket.js # MTProto network transport and proxy tunneling (HTTP/SOCKS5)
588
+ │ │ ├── auth.js # Interactive login wizard and 2FA
589
+ │ │ ├── dialogs.js # Fetching, filtering and searching dialogs
590
+ │ │ ├── messages.js # History loading, sending, editing, files, reactions
591
+ │ │ ├── listener.js # Live background MTProto event listener
592
+ │ │ ├── entities.js # Peer parsing, chat types and entity cache
593
+ │ │ └── formatter.js # Telegram entities -> Blessed ANSI formatting
306
594
  │ ├── ui/
307
- │ │ ├── screen.js # Управление Blessed Screen
308
- │ │ ├── theme.js # Темы оформления (Default Dark, Nord, Light)
309
- │ │ ├── app.js # Главный координатор интерфейса
595
+ │ │ ├── screen.js # Blessed screen management
596
+ │ │ ├── theme.js # Themes (Default Dark, Nord, Light)
597
+ │ │ ├── app.js # Main interface coordinator
310
598
  │ │ └── components/
311
- │ │ ├── header.js # Верхняя шапка и статус подключения
312
- │ │ ├── chatList.js # Список диалогов со скроллом, табами и поиском
313
- │ │ ├── chatView.js # Лента сообщений с автоскроллом и форматированием
314
- │ │ ├── inputBox.js # Поле ввода с плашкой Reply/Edit и историей
315
- │ │ ├── statusBar.js # Нижняя строка подсказок и тостов
599
+ │ │ ├── header.js # Top header and connection status
600
+ │ │ ├── chatList.js # Dialog list with scrolling, tabs and search
601
+ │ │ ├── chatView.js # Message feed with autoscroll and formatting
602
+ │ │ ├── inputBox.js # Input box with reply/edit banner and history
603
+ │ │ ├── statusBar.js # Bottom hint line and toasts
316
604
  │ │ └── modals/
317
- │ │ ├── helpModal.js # Окно справки
318
- │ │ ├── chatInfoModal.js # Окно информации о чате
319
- │ │ ├── actionModal.js # Меню действий с сообщением
320
- │ │ ├── fileModal.js # Диалог отправки файла
321
- │ │ └── confirmModal.js # Диалог подтверждения
605
+ │ │ ├── helpModal.js # Help window
606
+ │ │ ├── chatInfoModal.js # Chat info window
607
+ │ │ ├── actionModal.js # Message action menu
608
+ │ │ ├── fileModal.js # Send-file dialog
609
+ │ │ └── confirmModal.js # Confirmation dialog
322
610
  │ ├── cli/
323
- │ │ ├── cliCommands.js # Автономные CLI команды
324
- │ │ ├── init.js # tuigram init / paths — настройка и диагностика
325
- │ │ └── formatters.js # Консольные форматтеры таблиц и логов
611
+ │ │ ├── cliCommands.js # Standalone CLI commands
612
+ │ │ ├── init.js # tuigram init / paths — setup and diagnostics
613
+ │ │ └── formatters.js # Console table and log formatters
326
614
  │ └── utils/
327
- │ ├── storage.js # Файловые операции и сохранение сессий
328
- │ └── time.js # Форматирование времени и дат
615
+ │ ├── storage.js # File operations and session persistence
616
+ │ └── time.js # Time and date formatting
329
617
  ├── scripts/
330
- │ └── check-package.js # Предпубликационная проверка npm-пакета
618
+ │ └── check-package.js # Pre-publish npm package check
331
619
  ├── test/
332
- │ └── unit.test.js # Юнит-тесты
333
- ├── .env.example # Пример конфигурации
334
- ├── run.sh # Меню-диспетчер для разработки
620
+ │ └── unit.test.js # Unit tests
621
+ ├── .env.example # Configuration example
622
+ ├── run.sh # Development launcher menu
623
+ ├── AGENTS.md # Codebase rules (source of truth for AI agents)
624
+ ├── CHANGELOG.md
335
625
  ├── LICENSE
336
626
  ├── package.json
337
- └── README.md
627
+ ├── README.md
628
+ └── README.ru.md
629
+ ```
630
+
631
+ > The published npm package contains only `bin/`, `src/`, `README.md`, `README.ru.md`,
632
+ > `CHANGELOG.md`, `LICENSE` and `.env.example` — see the `files` field in `package.json`.
633
+
634
+ ---
635
+
636
+ ## 🔒 Security
637
+
638
+ **Where the authorization lives.** A single file — `session.txt` in the data directory
639
+ (`~/.local/share/tuigram/` or `%LOCALAPPDATA%\tuigram\`; the location can be changed with
640
+ `TUIGRAM_DATA_DIR` and inspected with `tuigram paths`). It holds an MTProto `StringSession`:
641
+ the format version, the data-center number, its address and port, and a 256-byte `authKey`,
642
+ base64-encoded. Neither your password nor the confirmation code is stored there.
643
+
644
+ - The session file and the settings file are written with `0600` permissions — owner read/write only.
645
+ - Neither the session nor the credentials live inside the package: `npm update` does not touch them.
646
+ - `data/` and `.env` are in `.gitignore` and excluded from the npm package via the `files` field;
647
+ `node scripts/check-package.js` fails if a secret ends up in the build anyway.
648
+ - **The `authKey` is stored in the clear**: base64 is an encoding, not encryption.
649
+ Anyone who reads the file gets full access to the account without the phone, the code or 2FA.
650
+ Do not put it in shared folders or unencrypted backups. If the file leaks,
651
+ terminate the session in an official client (*Settings → Devices*) — that revokes the key
652
+ on the server and makes the string useless.
653
+ - `/logout` in the TUI revokes the key on the server and deletes the session file.
654
+ - No data is sent to third-party servers — the client connects directly to the official
655
+ Telegram MTProto servers.
656
+
657
+ ---
658
+
659
+ ## 📜 Changelog
660
+
661
+ All notable changes are recorded in [CHANGELOG.md](./CHANGELOG.md).
662
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
663
+ and versioning follows [SemVer](https://semver.org/).
664
+
665
+ ---
666
+
667
+ ## 🤝 Contributing
668
+
669
+ Bug reports and pull requests are welcome:
670
+ [issues](https://github.com/emaxe/tuigram/issues).
671
+
672
+ Before submitting changes:
673
+
674
+ ```bash
675
+ npm test # unit tests must be green
676
+ node scripts/check-package.js # .env and the session must not reach the package
338
677
  ```
339
678
 
340
- > В опубликованный npm-пакет попадают только `bin/`, `src/`, `README.md`, `LICENSE`
341
- > и `.env.example` см. поле `files` в `package.json`.
679
+ Codebase rules for humans and AI agents live in [AGENTS.md](./AGENTS.md) — the single
680
+ source of truth for architecture, style, testing and security. If you work with
681
+ Claude Code, Cursor or Copilot, start there.
682
+
683
+ Both README versions (`README.md` and `README.ru.md`) must be updated together.
342
684
 
343
685
  ---
344
686
 
345
- ## 🔒 Безопасность
346
-
347
- **Где лежит авторизация.** Единственный файл — `session.txt` в директории данных
348
- (`~/.local/share/tuigram/` или `%LOCALAPPDATA%\tuigram\`; путь можно сменить через
349
- `TUIGRAM_DATA_DIR`, посмотреть командой `tuigram paths`). Внутри строка
350
- `StringSession` от MTProto: версия формата, номер дата-центра, его адрес и порт,
351
- и 256-байтный `authKey`, закодированные в base64. Пароля и кода подтверждения там нет.
352
-
353
- - Файл сессии и файл настроек сохраняются с правами `0600` — чтение и запись только владельцу.
354
- - Ни сессия, ни ключи не лежат внутри пакета: `npm update` их не затрагивает.
355
- - `data/` и `.env` в `.gitignore` и исключены из npm-пакета полем `files`;
356
- проверка `node scripts/check-package.js` падает, если секрет всё же попал в сборку.
357
- - **`authKey` хранится в открытом виде**: base64 — это кодирование, а не шифрование.
358
- Кто прочитает файл, тот получит полный доступ к аккаунту без телефона, кода и 2FA.
359
- Не кладите его в общие папки и незашифрованные бэкапы. Если файл утёк —
360
- завершите сеанс в официальном клиенте («Настройки → Устройства»), это отзовёт ключ
361
- на сервере, и строка станет бесполезной.
362
- - `/logout` в TUI отзывает ключ на сервере и удаляет файл сессии.
363
- - Никакие данные не передаются сторонним серверам — прямое соединение с официальными
364
- серверами Telegram MTProto.
687
+ ## 📄 License
688
+
689
+ [MIT](./LICENSE) © Maksim Klisin
690
+
691
+ TuiGram is an unofficial client. The project is not affiliated with,
692
+ nor endorsed by, Telegram Messenger Inc.