better-tg-cli 0.25.0 → 0.25.2
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 +37 -2
- package/README.ru.md +37 -2
- package/dist/telegram.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ that AI agents (Claude Code, Codex, …) can drive it cheaply and safely.
|
|
|
28
28
|
$ telegram inbox -n 3
|
|
29
29
|
48 unread in 7 chats (showing 3)
|
|
30
30
|
1234567890 user unread=2 Alice @alice | see you at 7?
|
|
31
|
-
-1001234567 supergroup muted unread=41 Rust
|
|
31
|
+
-1001234567 supergroup muted unread=41 Rust Seattle @rust_sea | anyone tried 1.90?
|
|
32
32
|
-1009876543 channel unread=5 Changelog | v2.4 is out
|
|
33
33
|
$ telegram read @alice -n 1 --json
|
|
34
34
|
{"chatTitle":"Alice","messages":[{"id":812,"date":"2026-09-27T10:02:11.000Z","sender":"Alice","senderId":"1234567890","text":"see you at 7?"}]}
|
|
@@ -41,6 +41,8 @@ $ telegram read @alice -n 1 --json
|
|
|
41
41
|
> use Telegram yourself, keep writes off unless you need them, and read [SECURITY.md](SECURITY.md)
|
|
42
42
|
> before letting an agent write. The authors are not responsible for restricted accounts.
|
|
43
43
|
|
|
44
|
+
**Contents:** [Why this fork](#why-this-fork) · [Install](#install) · [Log in](#log-in) · [Usage](#usage) · [MCP server](#mcp-server) · [FAQ](#faq) · [Development](#development) · [Privacy](#privacy) · [License](#license)
|
|
45
|
+
|
|
44
46
|
## Why this fork
|
|
45
47
|
|
|
46
48
|
A fork of [skillhq/telegram](https://github.com/skillhq/telegram), reworked for agents:
|
|
@@ -159,7 +161,8 @@ telegram download "Chat" 812 # save the attached file
|
|
|
159
161
|
telegram sync --chat "Chat" --output ./export --resume # incremental markdown export
|
|
160
162
|
|
|
161
163
|
telegram write-access on --for 1h # a human confirms this
|
|
162
|
-
|
|
164
|
+
telegram send @alice "on my way"
|
|
165
|
+
printf '%s' "$text" | telegram send @alice - # long or multi-line text: from stdin, no quoting problems
|
|
163
166
|
telegram reply "Chat" 812 "on it" --silent
|
|
164
167
|
telegram click @SomeBot 4410 "Settings" # press an inline button
|
|
165
168
|
```
|
|
@@ -229,6 +232,38 @@ tunnel URL plus `/mcp` (for example `https://<machine>.<tailnet>.ts.net/mcp`) an
|
|
|
229
232
|
for your tailnet first. A `cloudflared` quick tunnel gets a new URL on every start. Read "Remote
|
|
230
233
|
MCP over HTTP" in [SECURITY.md](SECURITY.md) first.
|
|
231
234
|
|
|
235
|
+
## FAQ
|
|
236
|
+
|
|
237
|
+
**Will Telegram ban my account?**
|
|
238
|
+
Using your own account from a third-party client is allowed by the [Telegram API terms](https://core.telegram.org/api/terms). What gets accounts limited is behaviour that looks like a bot: bulk messaging, mass joins or invites, spam, and brand-new accounts doing a lot at once. Use it the way you would use Telegram yourself. The skill tells agents to avoid these patterns.
|
|
239
|
+
|
|
240
|
+
**Is this a bot?**
|
|
241
|
+
No. It logs in as you over MTProto, like Telegram Desktop, and sees exactly what you see. Bots can't read your chats; this can.
|
|
242
|
+
|
|
243
|
+
**Can an agent send messages on its own?**
|
|
244
|
+
Only after you turn writes on. `telegram write-access on` asks you to confirm in the terminal or in a macOS dialog, which an agent can't answer. Writes then need an exact chat, and each one is logged. Over MCP, writing is a separate tool that clients can ask you to approve every time. Details are in [SECURITY.md](SECURITY.md).
|
|
245
|
+
|
|
246
|
+
**Does reading mark messages as read?**
|
|
247
|
+
No. `read`, `inbox` and `search` leave chats unread. Only `telegram mark-read` marks them.
|
|
248
|
+
|
|
249
|
+
**Do I need my own API keys?**
|
|
250
|
+
Yes, from [my.telegram.org/apps](https://my.telegram.org/apps). They are free and take a minute to create. If the maintainer gave you an invite, `telegram auth --invite --qr` logs you in without them.
|
|
251
|
+
|
|
252
|
+
**Where is my session stored, and who can see my messages?**
|
|
253
|
+
The session is in the macOS Keychain, the Linux Secret Service or 1Password. The CLI talks to Telegram directly and has no analytics. The only other hosts are npm for a daily version check and the invite service at login. See [PRIVACY.md](PRIVACY.md).
|
|
254
|
+
|
|
255
|
+
**Can I use several accounts?**
|
|
256
|
+
Yes, with `TG_PROFILE`: each profile has its own login, config and Keychain items, for example `TG_PROFILE=work telegram auth --qr`. Switching accounts properly is tracked in [#5](https://github.com/TheVilfer/better-tg-cli/issues/5).
|
|
257
|
+
|
|
258
|
+
**Does it work on Windows?**
|
|
259
|
+
Not yet. It is built and tested on macOS and Linux, and relies on their secret stores.
|
|
260
|
+
|
|
261
|
+
**Can I use it from Grok Bot, ChatGPT or another cloud agent?**
|
|
262
|
+
Cloud agents can't start a program on your computer, so run the MCP server over HTTP and reach it through a tunnel. See [Grok Bot](#grok-bot-remote-mcp-over-http).
|
|
263
|
+
|
|
264
|
+
**How do I update?**
|
|
265
|
+
Run `telegram update`. It uses the same channel you installed from: Homebrew, npm or a release binary.
|
|
266
|
+
|
|
232
267
|
## Development
|
|
233
268
|
|
|
234
269
|
[DEVELOPMENT.md](DEVELOPMENT.md) covers:
|
package/README.ru.md
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
$ telegram inbox -n 3
|
|
29
29
|
48 unread in 7 chats (showing 3)
|
|
30
30
|
1234567890 user unread=2 Алиса @alice | в 7 в силе?
|
|
31
|
-
-1001234567 supergroup muted unread=41 Rust
|
|
31
|
+
-1001234567 supergroup muted unread=41 Rust Seattle @rust_sea | кто уже пробовал 1.90?
|
|
32
32
|
-1009876543 channel unread=5 Changelog | вышла v2.4
|
|
33
33
|
```
|
|
34
34
|
|
|
@@ -40,6 +40,8 @@ $ telegram inbox -n 3
|
|
|
40
40
|
> она не нужна. Прежде чем разрешать агенту писать, прочитайте [SECURITY.md](SECURITY.md). Авторы
|
|
41
41
|
> не отвечают за ограниченные аккаунты.
|
|
42
42
|
|
|
43
|
+
**Содержание:** [Чем этот форк лучше](#чем-этот-форк-лучше) · [Установка](#установка) · [Вход](#вход) · [Использование](#использование) · [MCP-сервер](#mcp-сервер) · [FAQ](#faq) · [Разработка](#разработка) · [Приватность](#приватность) · [Лицензия](#лицензия)
|
|
44
|
+
|
|
43
45
|
## Чем этот форк лучше
|
|
44
46
|
|
|
45
47
|
Это форк [skillhq/telegram](https://github.com/skillhq/telegram), переделанный под агентов:
|
|
@@ -159,7 +161,8 @@ telegram download "Чат" 812 # сохранить вложе
|
|
|
159
161
|
telegram sync --chat "Чат" --output ./export --resume # инкрементальная выгрузка в markdown
|
|
160
162
|
|
|
161
163
|
telegram write-access on --for 1h # подтверждает человек
|
|
162
|
-
|
|
164
|
+
telegram send @alice "уже еду"
|
|
165
|
+
printf '%s' "$text" | telegram send @alice - # длинный или многострочный текст: из stdin, без проблем с кавычками
|
|
163
166
|
telegram reply "Чат" 812 "беру" --silent
|
|
164
167
|
telegram click @SomeBot 4410 "Настройки" # нажать инлайн-кнопку
|
|
165
168
|
```
|
|
@@ -230,6 +233,38 @@ tailscale funnel --bg 8787 # или: cloudflared tunnel --url h
|
|
|
230
233
|
разрешить для вашего tailnet. Быстрый туннель `cloudflared` при каждом запуске получает новый
|
|
231
234
|
адрес. Сначала прочитайте раздел «Remote MCP over HTTP» в [SECURITY.md](SECURITY.md).
|
|
232
235
|
|
|
236
|
+
## FAQ
|
|
237
|
+
|
|
238
|
+
**Не забанит ли Telegram мой аккаунт?**
|
|
239
|
+
[Условия Telegram API](https://core.telegram.org/api/terms) разрешают пользоваться своим аккаунтом через сторонние клиенты. Ограничения получают за поведение, похожее на бота: массовые рассылки, массовые вступления и приглашения, спам, активность только что созданного аккаунта. Пользуйтесь так же, как пользовались бы самим Telegram. Скилл учит агентов обходить эти сценарии.
|
|
240
|
+
|
|
241
|
+
**Это бот?**
|
|
242
|
+
Нет. CLI входит от вашего имени по MTProto, как Telegram Desktop, и видит ровно то же, что и вы. Боты не читают ваши чаты, а этот клиент читает.
|
|
243
|
+
|
|
244
|
+
**Может ли агент отправлять сообщения сам?**
|
|
245
|
+
Только после того, как вы включите запись. `telegram write-access on` просит подтверждения в терминале или в диалоге macOS, на которое агент ответить не может. Дальше запись требует точно указанный чат, а каждая отправка пишется в журнал. В MCP запись вынесена в отдельный инструмент, и клиенты могут спрашивать вас перед каждым вызовом. Подробнее в [SECURITY.md](SECURITY.md).
|
|
246
|
+
|
|
247
|
+
**Отмечает ли чтение сообщения прочитанными?**
|
|
248
|
+
Нет. `read`, `inbox` и `search` оставляют чаты непрочитанными. Отмечает только `telegram mark-read`.
|
|
249
|
+
|
|
250
|
+
**Нужны ли свои API-ключи?**
|
|
251
|
+
Да, с [my.telegram.org/apps](https://my.telegram.org/apps). Они бесплатные, их создание занимает минуту. Если мейнтейнер дал вам инвайт, `telegram auth --invite --qr` войдёт без своих ключей.
|
|
252
|
+
|
|
253
|
+
**Где хранится сессия и кто видит мои сообщения?**
|
|
254
|
+
Сессия лежит в Keychain macOS, в Secret Service на Linux или в 1Password. CLI общается с Telegram напрямую, аналитики нет. Кроме Telegram, он ходит только в npm (раз в день за номером версии) и в сервис инвайтов при входе. Подробнее в [PRIVACY.md](PRIVACY.md).
|
|
255
|
+
|
|
256
|
+
**Можно ли несколько аккаунтов?**
|
|
257
|
+
Да, через `TG_PROFILE`: у каждого профиля свой вход, конфиг и записи в Keychain, например `TG_PROFILE=work telegram auth --qr`. Удобное переключение аккаунтов — в [#5](https://github.com/TheVilfer/better-tg-cli/issues/5).
|
|
258
|
+
|
|
259
|
+
**Работает ли на Windows?**
|
|
260
|
+
Пока нет. CLI собирается и проверяется на macOS и Linux и опирается на их хранилища секретов.
|
|
261
|
+
|
|
262
|
+
**Можно ли пользоваться из Grok Bot, ChatGPT или другого облачного агента?**
|
|
263
|
+
Облачный агент не может запустить программу на вашем компьютере, поэтому поднимите MCP-сервер по HTTP и откройте к нему туннель. См. [Grok Bot](#grok-bot-удалённый-mcp-по-http).
|
|
264
|
+
|
|
265
|
+
**Как обновиться?**
|
|
266
|
+
`telegram update`. Команда обновляет тем же способом, каким CLI был установлен: Homebrew, npm или бинарник из релиза.
|
|
267
|
+
|
|
233
268
|
## Разработка
|
|
234
269
|
|
|
235
270
|
В [DEVELOPMENT.md](DEVELOPMENT.md) описаны:
|