telegram-cli-local 0.2.0__tar.gz → 0.2.1__tar.gz
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.
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/.agents/skills/telegram-cli/SKILL.md +11 -99
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/.claude/skills/telegram-cli/SKILL.md +11 -99
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/AGENTS.md +2 -2
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/CHANGELOG.md +6 -0
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/CLAUDE.md +2 -2
- {telegram_cli_local-0.2.0/telegram_cli_local.egg-info → telegram_cli_local-0.2.1}/PKG-INFO +6 -6
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/README.md +5 -5
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/README.ru.md +5 -5
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/RELEASING.md +2 -2
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/tcli_skills/SKILL.md +11 -99
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/tcli_skills/__init__.py +1 -1
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1/telegram_cli_local.egg-info}/PKG-INFO +6 -6
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/LICENSE +0 -0
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/MANIFEST.in +0 -0
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/pyproject.toml +0 -0
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/requirements.txt +0 -0
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/scripts/check_distribution.py +0 -0
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/setup.cfg +0 -0
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/telegram_cli_local.egg-info/SOURCES.txt +0 -0
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/telegram_cli_local.egg-info/dependency_links.txt +0 -0
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/telegram_cli_local.egg-info/entry_points.txt +0 -0
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/telegram_cli_local.egg-info/requires.txt +0 -0
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/telegram_cli_local.egg-info/top_level.txt +0 -0
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/tests/test_tg.py +0 -0
- {telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/tg.py +0 -0
|
@@ -1,90 +1,26 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: telegram-cli
|
|
3
|
-
description:
|
|
3
|
+
description: Use the personal-account Telegram CLI (tcli). Use for chats, message search/history, plain or formatted sending, JSON automation, watching, configuration, login, and diagnostics.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Telegram CLI
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Use the installed `tcli` command from any directory. Run development and installation commands from the project root.
|
|
12
|
-
Respond in the user's requested language; English CLI output does not require English conversation replies.
|
|
13
|
-
Keep the Codex, Claude Code, and bundled `tcli_skills/SKILL.md` copies identical when updating them.
|
|
14
|
-
|
|
15
|
-
## Project map
|
|
16
|
-
|
|
17
|
-
A local Python 3.10+ CLI for one personal Telegram account, using Telethon and MTProto.
|
|
18
|
-
No bot, HTTP server, application database, or FTP deployment is involved.
|
|
19
|
-
|
|
20
|
-
| Location | Responsibility |
|
|
21
|
-
| --- | --- |
|
|
22
|
-
| `tg.py: parser()` | argparse commands, help text, examples, limits |
|
|
23
|
-
| `tg.py: main()` | Help dispatch before credentials, paths, errors, asyncio entry point |
|
|
24
|
-
| `validate_credentials()` / `load_credentials()` / `configure()` | Validate credentials, environment/file precedence, atomic local configuration |
|
|
25
|
-
| `run()` | Connect, authenticate, execute commands, disconnect in finally |
|
|
26
|
-
| `resolve_chat()` | me/@username via Telethon; numeric IDs and exact titles via dialogs |
|
|
27
|
-
| `safe_text()` / `show_message()` | Strip terminal control characters and display messages |
|
|
28
|
-
| `message_data()` | Serialize message fields for JSON and JSONL output |
|
|
29
|
-
| `install_skills()` / `atomic_write()` | Offline user-skill installation, backups, and atomic file replacement |
|
|
30
|
-
| `tcli_skills/` | Version and bundled portable SKILL.md included in wheels |
|
|
31
|
-
| `pyproject.toml` | `tcli` entry point calling `tg:main`; dependencies from requirements.txt |
|
|
32
|
-
| `tests/test_tg.py` | Offline unit tests and help subprocess checks |
|
|
33
|
-
| `README.md` / `README.ru.md` | English and Russian user documentation |
|
|
34
|
-
|
|
35
|
-
Use Semble to locate implementations when available, then read the matching functions and callers.
|
|
36
|
-
Current code and command help take precedence over stale documentation.
|
|
37
|
-
The CLI, developer documentation, and agent instructions are English; preserve Unicode chat names and messages.
|
|
8
|
+
Use `tcli` to work with the user's personal Telegram account from any directory.
|
|
9
|
+
Respond in the user's requested language; CLI output is English.
|
|
10
|
+
Use `tcli help COMMAND` to check available options.
|
|
38
11
|
|
|
39
12
|
## Setup
|
|
40
13
|
|
|
41
14
|
Install the published CLI with `pipx install telegram-cli-local`.
|
|
42
15
|
Update it with `pipx upgrade telegram-cli-local`, then run `tcli skills install` to update user skills.
|
|
43
|
-
|
|
44
|
-
`tcli --version` reports the CLI version.
|
|
45
|
-
|
|
46
|
-
Install from this local project with `py -m pip install --user -e .` on Windows.
|
|
47
|
-
The user scripts directory must be in PATH. If tcli is not found, run in PowerShell:
|
|
48
|
-
|
|
49
|
-
```powershell
|
|
50
|
-
$tcliScriptsDir = (py -c "import sysconfig; print(sysconfig.get_path('scripts', scheme='nt_user'))").Trim()
|
|
51
|
-
$tcliUserPath = [Environment]::GetEnvironmentVariable('Path', 'User')
|
|
52
|
-
if (($tcliUserPath -split ';') -notcontains $tcliScriptsDir) {
|
|
53
|
-
$tcliUpdatedPath = (($tcliUserPath + ';' + $tcliScriptsDir).Trim(';'))
|
|
54
|
-
[Environment]::SetEnvironmentVariable('Path', $tcliUpdatedPath, 'User')
|
|
55
|
-
}
|
|
56
|
-
$env:Path = $tcliScriptsDir + ';' + $env:Path
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
New terminals inherit the saved PATH; restart existing terminals or their parent application if needed.
|
|
60
|
-
If pip is missing, run `py -m ensurepip --upgrade --user` before installing.
|
|
61
|
-
Do not install an unrelated similarly named package from PyPI.
|
|
62
|
-
Editable installation depends on the source folder; reinstall if it moves.
|
|
63
|
-
The installed `tcli` command works outside the project root.
|
|
64
|
-
|
|
65
|
-
For development, run from the project root:
|
|
66
|
-
|
|
67
|
-
```powershell
|
|
68
|
-
py -m venv .venv
|
|
69
|
-
.\.venv\Scripts\python.exe -m pip install -e .
|
|
70
|
-
.\.venv\Scripts\tcli.exe help
|
|
71
|
-
.\.venv\Scripts\python.exe -X utf8 -m unittest discover -s tests -v
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
On POSIX use `python3 -m venv .venv`, `.venv/bin/python`, and `.venv/bin/tcli`.
|
|
75
|
-
No activation is needed with those explicit paths.
|
|
76
|
-
On this Windows machine, `py` is available; the system `python` alias may open Microsoft Store.
|
|
77
|
-
If an agent process has an old PATH, refresh its environment or use the installed executable's full path.
|
|
16
|
+
`tcli --version` reports the installed version.
|
|
78
17
|
|
|
79
18
|
## Help and commands
|
|
80
19
|
|
|
81
20
|
`tcli`, `tcli help`, `tcli --help`, and `tcli -h` display general help and exit successfully.
|
|
82
21
|
`tcli help send` is equivalent to `tcli send --help`; this applies to every subcommand.
|
|
83
22
|
Help does not load credentials, create Telegram sessions, or connect to Telegram.
|
|
84
|
-
Interactive general help
|
|
85
|
-
It uses a one-second network timeout and a 24-hour cache at data-directory/cache/update-check.json,
|
|
86
|
-
including failed attempts. It only reports updates on stderr, never installs them automatically.
|
|
87
|
-
Network/cache errors are silent. Redirected stdout, command-specific help, and --version skip checks.
|
|
23
|
+
Interactive general help may report a newer release on stderr; it never installs updates automatically.
|
|
88
24
|
Set TCLI_NO_UPDATE_CHECK=1 to disable checks and their cache writes entirely.
|
|
89
25
|
Unknown commands, unknown help topics, and invalid arguments remain usage errors (exit 2).
|
|
90
26
|
|
|
@@ -171,9 +107,7 @@ Formatting may trim surrounding whitespace. Use HTML for nested formatting.
|
|
|
171
107
|
No message deletion or interactive conversation UI.
|
|
172
108
|
`doctor` is local, creates no files, and exits 1 for invalid credentials or missing session.
|
|
173
109
|
File presence does not prove authorization. --connect can update the existing Telethon session.
|
|
174
|
-
`watch`
|
|
175
|
-
min_id and reverse order with no fixed batch limit. It includes sends from another CLI process
|
|
176
|
-
and Saved Messages. Session writes are committed before idle waits to release SQLite locks.
|
|
110
|
+
`watch` shows new messages, including sends from another CLI process and Saved Messages.
|
|
177
111
|
Messages deleted before polling cannot be seen. `watch` has no past history; prefer `read` for a one-time request.
|
|
178
112
|
|
|
179
113
|
## Automation, context, filters, and editing
|
|
@@ -186,16 +120,15 @@ Search follows Telegram text-search semantics, not local filename/extension matc
|
|
|
186
120
|
|
|
187
121
|
`edit CHAT ID TEXT`, `edit CHAT ID --file PATH`, or `edit CHAT ID --stdin` edits outgoing text
|
|
188
122
|
or a caption. Exactly one nonblank UTF-8 text source is required. --format plain|markdown|html
|
|
189
|
-
works as for send.
|
|
123
|
+
works as for send. Use a message ID from history and check that the message is outgoing before editing.
|
|
190
124
|
Telegram enforces edit permissions and time limits; unchanged text can raise an RPC error.
|
|
191
125
|
Editing does not replace attachments or clear captions with empty text.
|
|
192
126
|
|
|
193
127
|
`download CHAT ID --album --output-dir DIR` downloads the album containing that message.
|
|
194
128
|
--output-dir requires --album, excludes --output, and must already exist.
|
|
195
|
-
|
|
196
|
-
Telegram albums have at most ten adjacent messages; message IDs can have gaps.
|
|
129
|
+
Telegram albums have at most ten items; message IDs can have gaps.
|
|
197
130
|
Save as <message_id><extension>, with .bin for missing/unsafe extensions; never use remote filenames.
|
|
198
|
-
|
|
131
|
+
Existing destination files are never overwritten.
|
|
199
132
|
Keep completed files on failure and remove the current partial file. Missing/deleted/inaccessible
|
|
200
133
|
album items cannot be recovered. Download JSON keeps captions and grouped_id without sidecar files.
|
|
201
134
|
|
|
@@ -236,8 +169,7 @@ Development/testing does not authorize live forwarding. Verify history before re
|
|
|
236
169
|
|
|
237
170
|
send (attachments only) and download support --progress / --no-progress.
|
|
238
171
|
Default: enabled when stderr is a terminal. Progress reports bytes, percentage, and average bytes/sec
|
|
239
|
-
on stderr
|
|
240
|
-
Throttle updates to twice per second, plus completion. With --json, progress is JSONL on stderr:
|
|
172
|
+
on stderr. With --json, progress is JSONL on stderr:
|
|
241
173
|
event="transfer_progress", operation="upload"|"download", file, transferred_bytes, total_bytes,
|
|
242
174
|
percent (null for unknown/zero size), bytes_per_second. Errors have ok=false and may follow progress events.
|
|
243
175
|
Stdout remains the final JSON result. Progress is not proof of delivery; cached transfers may emit no events.
|
|
@@ -247,10 +179,6 @@ Stdout remains the final JSON result. Progress is not proof of delivery; cached
|
|
|
247
179
|
`skills install` defaults to --agent auto: detect installed agents and copy the bundled skill only for those agents.
|
|
248
180
|
Default destinations are the official personal skill locations, independent of the current directory:
|
|
249
181
|
Codex: ~/.agents/skills/telegram-cli/SKILL.md; Claude Code: ~/.claude/skills/telegram-cli/SKILL.md.
|
|
250
|
-
See [OpenAI](https://learn.chatgpt.com/docs/build-skills#where-codex-loads-local-skills) and
|
|
251
|
-
[Anthropic](https://code.claude.com/docs/en/skills#where-skills-live).
|
|
252
|
-
Detection checks PATH, native ~/.local/bin executables, standard npm/binary locations, Codex.app on macOS,
|
|
253
|
-
and the OpenAI.Codex Windows Store installation. Configuration folders alone are not installation evidence.
|
|
254
182
|
If neither agent is found, it creates nothing. Explicit --agent codex|claude|all bypasses detection for custom installations.
|
|
255
183
|
The installer never downloads anything or launches either agent.
|
|
256
184
|
It skips identical files, backs up differing SKILL.md files as SKILL.md.backup-*.bak, and atomically
|
|
@@ -313,20 +241,4 @@ Missing authorization: suggest local `tcli login`.
|
|
|
313
241
|
FloodWait: wait the reported duration; do not bypass limits or retry immediately.
|
|
314
242
|
RPC/network errors: address the specific cause; a send may have an uncertain outcome.
|
|
315
243
|
SQLite locking: investigate other CLI processes; do not delete the session file.
|
|
316
|
-
`Could not find platform independent libraries <prefix>`: Python installation/path warning before application startup.
|
|
317
|
-
Inspect the interpreter and its standard library; repair the installation rather than suppressing stderr or changing Telegram code.
|
|
318
244
|
Exit codes: 0 success, 1 handled error, 2 argparse usage error, 130 Ctrl+C.
|
|
319
|
-
Telethon may perform internal retries; the CLI has no custom send retry loop.
|
|
320
|
-
|
|
321
|
-
Preserve credential validation, authorization checks, unambiguous chat resolution,
|
|
322
|
-
terminal sanitization, literal outgoing text by default, disconnect in finally, and FloodWait handling.
|
|
323
|
-
Update affected tests, both READMEs, and all three copies of this SKILL.md when changing commands.
|
|
324
|
-
Record every notable change in CHANGELOG.md under Unreleased; version the entries when releasing.
|
|
325
|
-
Tests cover help without credentials, JSON/JSONL, search/pagination arguments, replies, stdin/files,
|
|
326
|
-
doctor, login/logout, watch polling/cursors and cancellation, formatting selection, disconnects
|
|
327
|
-
and handled errors including FloodWait and SQLite locks. They also cover send/download/edit JSON,
|
|
328
|
-
read by ID, reply/album context, media filters, ordered multi-file sends, albums, edits,
|
|
329
|
-
partial failures, destination collisions, safe filenames, structured usage/runtime errors,
|
|
330
|
-
bounded filename search, surrounding context, forwarding, and transfer progress.
|
|
331
|
-
They do not verify real login,
|
|
332
|
-
network watching, or message delivery. State those limits when reporting validation.
|
|
@@ -1,90 +1,26 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: telegram-cli
|
|
3
|
-
description:
|
|
3
|
+
description: Use the personal-account Telegram CLI (tcli). Use for chats, message search/history, plain or formatted sending, JSON automation, watching, configuration, login, and diagnostics.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Telegram CLI
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Use the installed `tcli` command from any directory. Run development and installation commands from the project root.
|
|
12
|
-
Respond in the user's requested language; English CLI output does not require English conversation replies.
|
|
13
|
-
Keep the Codex, Claude Code, and bundled `tcli_skills/SKILL.md` copies identical when updating them.
|
|
14
|
-
|
|
15
|
-
## Project map
|
|
16
|
-
|
|
17
|
-
A local Python 3.10+ CLI for one personal Telegram account, using Telethon and MTProto.
|
|
18
|
-
No bot, HTTP server, application database, or FTP deployment is involved.
|
|
19
|
-
|
|
20
|
-
| Location | Responsibility |
|
|
21
|
-
| --- | --- |
|
|
22
|
-
| `tg.py: parser()` | argparse commands, help text, examples, limits |
|
|
23
|
-
| `tg.py: main()` | Help dispatch before credentials, paths, errors, asyncio entry point |
|
|
24
|
-
| `validate_credentials()` / `load_credentials()` / `configure()` | Validate credentials, environment/file precedence, atomic local configuration |
|
|
25
|
-
| `run()` | Connect, authenticate, execute commands, disconnect in finally |
|
|
26
|
-
| `resolve_chat()` | me/@username via Telethon; numeric IDs and exact titles via dialogs |
|
|
27
|
-
| `safe_text()` / `show_message()` | Strip terminal control characters and display messages |
|
|
28
|
-
| `message_data()` | Serialize message fields for JSON and JSONL output |
|
|
29
|
-
| `install_skills()` / `atomic_write()` | Offline user-skill installation, backups, and atomic file replacement |
|
|
30
|
-
| `tcli_skills/` | Version and bundled portable SKILL.md included in wheels |
|
|
31
|
-
| `pyproject.toml` | `tcli` entry point calling `tg:main`; dependencies from requirements.txt |
|
|
32
|
-
| `tests/test_tg.py` | Offline unit tests and help subprocess checks |
|
|
33
|
-
| `README.md` / `README.ru.md` | English and Russian user documentation |
|
|
34
|
-
|
|
35
|
-
Use Semble to locate implementations when available, then read the matching functions and callers.
|
|
36
|
-
Current code and command help take precedence over stale documentation.
|
|
37
|
-
The CLI, developer documentation, and agent instructions are English; preserve Unicode chat names and messages.
|
|
8
|
+
Use `tcli` to work with the user's personal Telegram account from any directory.
|
|
9
|
+
Respond in the user's requested language; CLI output is English.
|
|
10
|
+
Use `tcli help COMMAND` to check available options.
|
|
38
11
|
|
|
39
12
|
## Setup
|
|
40
13
|
|
|
41
14
|
Install the published CLI with `pipx install telegram-cli-local`.
|
|
42
15
|
Update it with `pipx upgrade telegram-cli-local`, then run `tcli skills install` to update user skills.
|
|
43
|
-
|
|
44
|
-
`tcli --version` reports the CLI version.
|
|
45
|
-
|
|
46
|
-
Install from this local project with `py -m pip install --user -e .` on Windows.
|
|
47
|
-
The user scripts directory must be in PATH. If tcli is not found, run in PowerShell:
|
|
48
|
-
|
|
49
|
-
```powershell
|
|
50
|
-
$tcliScriptsDir = (py -c "import sysconfig; print(sysconfig.get_path('scripts', scheme='nt_user'))").Trim()
|
|
51
|
-
$tcliUserPath = [Environment]::GetEnvironmentVariable('Path', 'User')
|
|
52
|
-
if (($tcliUserPath -split ';') -notcontains $tcliScriptsDir) {
|
|
53
|
-
$tcliUpdatedPath = (($tcliUserPath + ';' + $tcliScriptsDir).Trim(';'))
|
|
54
|
-
[Environment]::SetEnvironmentVariable('Path', $tcliUpdatedPath, 'User')
|
|
55
|
-
}
|
|
56
|
-
$env:Path = $tcliScriptsDir + ';' + $env:Path
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
New terminals inherit the saved PATH; restart existing terminals or their parent application if needed.
|
|
60
|
-
If pip is missing, run `py -m ensurepip --upgrade --user` before installing.
|
|
61
|
-
Do not install an unrelated similarly named package from PyPI.
|
|
62
|
-
Editable installation depends on the source folder; reinstall if it moves.
|
|
63
|
-
The installed `tcli` command works outside the project root.
|
|
64
|
-
|
|
65
|
-
For development, run from the project root:
|
|
66
|
-
|
|
67
|
-
```powershell
|
|
68
|
-
py -m venv .venv
|
|
69
|
-
.\.venv\Scripts\python.exe -m pip install -e .
|
|
70
|
-
.\.venv\Scripts\tcli.exe help
|
|
71
|
-
.\.venv\Scripts\python.exe -X utf8 -m unittest discover -s tests -v
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
On POSIX use `python3 -m venv .venv`, `.venv/bin/python`, and `.venv/bin/tcli`.
|
|
75
|
-
No activation is needed with those explicit paths.
|
|
76
|
-
On this Windows machine, `py` is available; the system `python` alias may open Microsoft Store.
|
|
77
|
-
If an agent process has an old PATH, refresh its environment or use the installed executable's full path.
|
|
16
|
+
`tcli --version` reports the installed version.
|
|
78
17
|
|
|
79
18
|
## Help and commands
|
|
80
19
|
|
|
81
20
|
`tcli`, `tcli help`, `tcli --help`, and `tcli -h` display general help and exit successfully.
|
|
82
21
|
`tcli help send` is equivalent to `tcli send --help`; this applies to every subcommand.
|
|
83
22
|
Help does not load credentials, create Telegram sessions, or connect to Telegram.
|
|
84
|
-
Interactive general help
|
|
85
|
-
It uses a one-second network timeout and a 24-hour cache at data-directory/cache/update-check.json,
|
|
86
|
-
including failed attempts. It only reports updates on stderr, never installs them automatically.
|
|
87
|
-
Network/cache errors are silent. Redirected stdout, command-specific help, and --version skip checks.
|
|
23
|
+
Interactive general help may report a newer release on stderr; it never installs updates automatically.
|
|
88
24
|
Set TCLI_NO_UPDATE_CHECK=1 to disable checks and their cache writes entirely.
|
|
89
25
|
Unknown commands, unknown help topics, and invalid arguments remain usage errors (exit 2).
|
|
90
26
|
|
|
@@ -171,9 +107,7 @@ Formatting may trim surrounding whitespace. Use HTML for nested formatting.
|
|
|
171
107
|
No message deletion or interactive conversation UI.
|
|
172
108
|
`doctor` is local, creates no files, and exits 1 for invalid credentials or missing session.
|
|
173
109
|
File presence does not prove authorization. --connect can update the existing Telethon session.
|
|
174
|
-
`watch`
|
|
175
|
-
min_id and reverse order with no fixed batch limit. It includes sends from another CLI process
|
|
176
|
-
and Saved Messages. Session writes are committed before idle waits to release SQLite locks.
|
|
110
|
+
`watch` shows new messages, including sends from another CLI process and Saved Messages.
|
|
177
111
|
Messages deleted before polling cannot be seen. `watch` has no past history; prefer `read` for a one-time request.
|
|
178
112
|
|
|
179
113
|
## Automation, context, filters, and editing
|
|
@@ -186,16 +120,15 @@ Search follows Telegram text-search semantics, not local filename/extension matc
|
|
|
186
120
|
|
|
187
121
|
`edit CHAT ID TEXT`, `edit CHAT ID --file PATH`, or `edit CHAT ID --stdin` edits outgoing text
|
|
188
122
|
or a caption. Exactly one nonblank UTF-8 text source is required. --format plain|markdown|html
|
|
189
|
-
works as for send.
|
|
123
|
+
works as for send. Use a message ID from history and check that the message is outgoing before editing.
|
|
190
124
|
Telegram enforces edit permissions and time limits; unchanged text can raise an RPC error.
|
|
191
125
|
Editing does not replace attachments or clear captions with empty text.
|
|
192
126
|
|
|
193
127
|
`download CHAT ID --album --output-dir DIR` downloads the album containing that message.
|
|
194
128
|
--output-dir requires --album, excludes --output, and must already exist.
|
|
195
|
-
|
|
196
|
-
Telegram albums have at most ten adjacent messages; message IDs can have gaps.
|
|
129
|
+
Telegram albums have at most ten items; message IDs can have gaps.
|
|
197
130
|
Save as <message_id><extension>, with .bin for missing/unsafe extensions; never use remote filenames.
|
|
198
|
-
|
|
131
|
+
Existing destination files are never overwritten.
|
|
199
132
|
Keep completed files on failure and remove the current partial file. Missing/deleted/inaccessible
|
|
200
133
|
album items cannot be recovered. Download JSON keeps captions and grouped_id without sidecar files.
|
|
201
134
|
|
|
@@ -236,8 +169,7 @@ Development/testing does not authorize live forwarding. Verify history before re
|
|
|
236
169
|
|
|
237
170
|
send (attachments only) and download support --progress / --no-progress.
|
|
238
171
|
Default: enabled when stderr is a terminal. Progress reports bytes, percentage, and average bytes/sec
|
|
239
|
-
on stderr
|
|
240
|
-
Throttle updates to twice per second, plus completion. With --json, progress is JSONL on stderr:
|
|
172
|
+
on stderr. With --json, progress is JSONL on stderr:
|
|
241
173
|
event="transfer_progress", operation="upload"|"download", file, transferred_bytes, total_bytes,
|
|
242
174
|
percent (null for unknown/zero size), bytes_per_second. Errors have ok=false and may follow progress events.
|
|
243
175
|
Stdout remains the final JSON result. Progress is not proof of delivery; cached transfers may emit no events.
|
|
@@ -247,10 +179,6 @@ Stdout remains the final JSON result. Progress is not proof of delivery; cached
|
|
|
247
179
|
`skills install` defaults to --agent auto: detect installed agents and copy the bundled skill only for those agents.
|
|
248
180
|
Default destinations are the official personal skill locations, independent of the current directory:
|
|
249
181
|
Codex: ~/.agents/skills/telegram-cli/SKILL.md; Claude Code: ~/.claude/skills/telegram-cli/SKILL.md.
|
|
250
|
-
See [OpenAI](https://learn.chatgpt.com/docs/build-skills#where-codex-loads-local-skills) and
|
|
251
|
-
[Anthropic](https://code.claude.com/docs/en/skills#where-skills-live).
|
|
252
|
-
Detection checks PATH, native ~/.local/bin executables, standard npm/binary locations, Codex.app on macOS,
|
|
253
|
-
and the OpenAI.Codex Windows Store installation. Configuration folders alone are not installation evidence.
|
|
254
182
|
If neither agent is found, it creates nothing. Explicit --agent codex|claude|all bypasses detection for custom installations.
|
|
255
183
|
The installer never downloads anything or launches either agent.
|
|
256
184
|
It skips identical files, backs up differing SKILL.md files as SKILL.md.backup-*.bak, and atomically
|
|
@@ -313,20 +241,4 @@ Missing authorization: suggest local `tcli login`.
|
|
|
313
241
|
FloodWait: wait the reported duration; do not bypass limits or retry immediately.
|
|
314
242
|
RPC/network errors: address the specific cause; a send may have an uncertain outcome.
|
|
315
243
|
SQLite locking: investigate other CLI processes; do not delete the session file.
|
|
316
|
-
`Could not find platform independent libraries <prefix>`: Python installation/path warning before application startup.
|
|
317
|
-
Inspect the interpreter and its standard library; repair the installation rather than suppressing stderr or changing Telegram code.
|
|
318
244
|
Exit codes: 0 success, 1 handled error, 2 argparse usage error, 130 Ctrl+C.
|
|
319
|
-
Telethon may perform internal retries; the CLI has no custom send retry loop.
|
|
320
|
-
|
|
321
|
-
Preserve credential validation, authorization checks, unambiguous chat resolution,
|
|
322
|
-
terminal sanitization, literal outgoing text by default, disconnect in finally, and FloodWait handling.
|
|
323
|
-
Update affected tests, both READMEs, and all three copies of this SKILL.md when changing commands.
|
|
324
|
-
Record every notable change in CHANGELOG.md under Unreleased; version the entries when releasing.
|
|
325
|
-
Tests cover help without credentials, JSON/JSONL, search/pagination arguments, replies, stdin/files,
|
|
326
|
-
doctor, login/logout, watch polling/cursors and cancellation, formatting selection, disconnects
|
|
327
|
-
and handled errors including FloodWait and SQLite locks. They also cover send/download/edit JSON,
|
|
328
|
-
read by ID, reply/album context, media filters, ordered multi-file sends, albums, edits,
|
|
329
|
-
partial failures, destination collisions, safe filenames, structured usage/runtime errors,
|
|
330
|
-
bounded filename search, surrounding context, forwarding, and transfer progress.
|
|
331
|
-
They do not verify real login,
|
|
332
|
-
network watching, or message delivery. State those limits when reporting validation.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Telegram CLI
|
|
2
2
|
|
|
3
3
|
Local Python CLI for a personal Telegram account, using Telethon. Entry point: `tg.py`.
|
|
4
|
-
Use `.agents/skills/telegram-cli/SKILL.md` for CLI
|
|
5
|
-
|
|
4
|
+
Use `.agents/skills/telegram-cli/SKILL.md` for CLI usage, commands, and operational constraints.
|
|
5
|
+
Keep architecture and development instructions in repository documentation, not in the skill.
|
|
6
6
|
|
|
7
7
|
Offline validation: `.\.venv\Scripts\python.exe -X utf8 -m unittest discover -s tests -v`.
|
|
8
8
|
Development and tests do not require a live account or sending real messages.
|
|
@@ -7,6 +7,12 @@ move them into a versioned section when publishing a release.
|
|
|
7
7
|
|
|
8
8
|
No unreleased changes.
|
|
9
9
|
|
|
10
|
+
## 0.2.1 - 2026-10-18
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Focus the Telegram CLI skill on usage; remove project architecture and development instructions from all three copies.
|
|
15
|
+
|
|
10
16
|
## 0.2.0 - 2026-10-18
|
|
11
17
|
|
|
12
18
|
### Added
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Telegram CLI
|
|
2
2
|
|
|
3
3
|
Local Python CLI for a personal Telegram account, using Telethon.
|
|
4
|
-
Use `.claude/skills/telegram-cli/SKILL.md` for
|
|
5
|
-
|
|
4
|
+
Use `.claude/skills/telegram-cli/SKILL.md` for CLI usage, commands, and diagnostics.
|
|
5
|
+
For development instructions, follow `AGENTS.md` and repository documentation.
|
|
6
6
|
Do not send live messages as part of code validation.
|
|
7
7
|
Keep CLI output and developer instructions in English; maintain both English and Russian READMEs.
|
|
8
8
|
Keep both repository skills and `tcli_skills/SKILL.md` identical. See `RELEASING.md` for package checks.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: telegram-cli-local
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Telegram CLI for a personal account
|
|
5
5
|
Author: BYxarek
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -63,7 +63,7 @@ It uses the Telegram API and acts as your personal account. You need your own
|
|
|
63
63
|
- **Local configuration:** enter API credentials once using `tcli config`.
|
|
64
64
|
- **Saved login:** reuse your local session on later runs.
|
|
65
65
|
- **Built-in help:** `tcli`, `tcli help`, and `tcli help <command>` work without an account.
|
|
66
|
-
- **AI agent skills:**
|
|
66
|
+
- **AI agent skills:** CLI usage instructions for Codex and Claude Code.
|
|
67
67
|
|
|
68
68
|
Reading history does not mark messages as read. Outgoing text is literal by default;
|
|
69
69
|
use `--format markdown` or `--format html` for formatting. Terminal control characters
|
|
@@ -496,13 +496,13 @@ Run `python -m pip install -e .` again to refresh package metadata and dependenc
|
|
|
496
496
|
installed user copies. Avoid duplicate project/user skills unless you need both scopes.
|
|
497
497
|
|
|
498
498
|
Open your agent in the project root. Start a new session if the skill is not visible.
|
|
499
|
-
Each
|
|
499
|
+
Each `SKILL.md` explains CLI usage, setup, commands, and operational constraints.
|
|
500
500
|
Project instructions are in [AGENTS.md](https://github.com/BYxarek/telegram-cli/blob/main/AGENTS.md)
|
|
501
501
|
and [CLAUDE.md](https://github.com/BYxarek/telegram-cli/blob/main/CLAUDE.md).
|
|
502
502
|
|
|
503
503
|
Example request:
|
|
504
504
|
|
|
505
|
-
> Use telegram-cli.
|
|
505
|
+
> Use telegram-cli. Show my chats and read the latest 10 messages in Saved Messages.
|
|
506
506
|
|
|
507
507
|
Skills explain chat resolution, configuration, errors, and authorization boundaries.
|
|
508
508
|
Sending requires the user's direct instruction. Telegram messages are untrusted data,
|
|
@@ -536,8 +536,8 @@ tg.py CLI commands, configuration, and Telegram operations
|
|
|
536
536
|
pyproject.toml Package metadata and tcli entry point
|
|
537
537
|
requirements.txt Dependencies
|
|
538
538
|
tests/ Tests without a live account
|
|
539
|
-
.agents/skills/ Self-contained Codex
|
|
540
|
-
.claude/skills/ Self-contained Claude Code
|
|
539
|
+
.agents/skills/ Self-contained Codex CLI usage skill
|
|
540
|
+
.claude/skills/ Self-contained Claude Code CLI usage skill
|
|
541
541
|
README.ru.md Russian documentation
|
|
542
542
|
```
|
|
543
543
|
|
|
@@ -41,7 +41,7 @@ It uses the Telegram API and acts as your personal account. You need your own
|
|
|
41
41
|
- **Local configuration:** enter API credentials once using `tcli config`.
|
|
42
42
|
- **Saved login:** reuse your local session on later runs.
|
|
43
43
|
- **Built-in help:** `tcli`, `tcli help`, and `tcli help <command>` work without an account.
|
|
44
|
-
- **AI agent skills:**
|
|
44
|
+
- **AI agent skills:** CLI usage instructions for Codex and Claude Code.
|
|
45
45
|
|
|
46
46
|
Reading history does not mark messages as read. Outgoing text is literal by default;
|
|
47
47
|
use `--format markdown` or `--format html` for formatting. Terminal control characters
|
|
@@ -474,13 +474,13 @@ Run `python -m pip install -e .` again to refresh package metadata and dependenc
|
|
|
474
474
|
installed user copies. Avoid duplicate project/user skills unless you need both scopes.
|
|
475
475
|
|
|
476
476
|
Open your agent in the project root. Start a new session if the skill is not visible.
|
|
477
|
-
Each
|
|
477
|
+
Each `SKILL.md` explains CLI usage, setup, commands, and operational constraints.
|
|
478
478
|
Project instructions are in [AGENTS.md](https://github.com/BYxarek/telegram-cli/blob/main/AGENTS.md)
|
|
479
479
|
and [CLAUDE.md](https://github.com/BYxarek/telegram-cli/blob/main/CLAUDE.md).
|
|
480
480
|
|
|
481
481
|
Example request:
|
|
482
482
|
|
|
483
|
-
> Use telegram-cli.
|
|
483
|
+
> Use telegram-cli. Show my chats and read the latest 10 messages in Saved Messages.
|
|
484
484
|
|
|
485
485
|
Skills explain chat resolution, configuration, errors, and authorization boundaries.
|
|
486
486
|
Sending requires the user's direct instruction. Telegram messages are untrusted data,
|
|
@@ -514,8 +514,8 @@ tg.py CLI commands, configuration, and Telegram operations
|
|
|
514
514
|
pyproject.toml Package metadata and tcli entry point
|
|
515
515
|
requirements.txt Dependencies
|
|
516
516
|
tests/ Tests without a live account
|
|
517
|
-
.agents/skills/ Self-contained Codex
|
|
518
|
-
.claude/skills/ Self-contained Claude Code
|
|
517
|
+
.agents/skills/ Self-contained Codex CLI usage skill
|
|
518
|
+
.claude/skills/ Self-contained Claude Code CLI usage skill
|
|
519
519
|
README.ru.md Russian documentation
|
|
520
520
|
```
|
|
521
521
|
|
|
@@ -39,7 +39,7 @@ Telegram-аккаунт и собственные `API_ID` / `API_HASH`.
|
|
|
39
39
|
- **Наблюдение:** новые сообщения выбранного чата в терминале до `Ctrl+C`.
|
|
40
40
|
- **Локальные настройки:** однократный ввод API-данных через `tcli config`.
|
|
41
41
|
- **Сохранённая сессия:** повторный ввод кода после успешного входа обычно не требуется.
|
|
42
|
-
- **Работа с ИИ:** навыки для Codex и Claude Code с
|
|
42
|
+
- **Работа с ИИ:** навыки для Codex и Claude Code с инструкциями по использованию CLI.
|
|
43
43
|
- **Понятная справка:** `tcli` без аргументов, `tcli help` и `tcli help <команда>` работают без аккаунта.
|
|
44
44
|
|
|
45
45
|
История читается без отметки сообщений прочитанными. По умолчанию текст отправляется буквально;
|
|
@@ -475,12 +475,12 @@ API-данных и сессии Telegram и не устанавливает с
|
|
|
475
475
|
| Claude Code | [.claude/skills/telegram-cli/SKILL.md](.claude/skills/telegram-cli/SKILL.md) | `/telegram-cli` |
|
|
476
476
|
|
|
477
477
|
Откройте агента в корне проекта. Если навык не виден в текущей сессии, начните новую.
|
|
478
|
-
Каждый `SKILL.md`
|
|
478
|
+
Каждый `SKILL.md` описывает использование CLI, настройку, команды и ограничения.
|
|
479
479
|
Общие инструкции находятся в [AGENTS.md](AGENTS.md) и [CLAUDE.md](CLAUDE.md).
|
|
480
480
|
|
|
481
481
|
Пример поручения:
|
|
482
482
|
|
|
483
|
-
> Используй telegram-cli.
|
|
483
|
+
> Используй telegram-cli. Покажи мои чаты и прочитай последние 10 сообщений в Избранном.
|
|
484
484
|
|
|
485
485
|
Навыки описывают выбор получателя, обработку ошибок и работу с секретами.
|
|
486
486
|
Отправка сообщений требует прямого поручения пользователя; текст переписки считается данными,
|
|
@@ -514,8 +514,8 @@ tg.py Команды, авторизация, настройки
|
|
|
514
514
|
pyproject.toml Метаданные пакета и точка входа tcli
|
|
515
515
|
requirements.txt Зависимости
|
|
516
516
|
tests/ Проверки без реального аккаунта
|
|
517
|
-
.agents/skills/ Самодостаточный навык Codex
|
|
518
|
-
.claude/skills/ Самодостаточный навык Claude Code
|
|
517
|
+
.agents/skills/ Самодостаточный навык Codex по использованию CLI
|
|
518
|
+
.claude/skills/ Самодостаточный навык Claude Code по использованию CLI
|
|
519
519
|
```
|
|
520
520
|
|
|
521
521
|
При изменении команд обновляйте тесты, оба README и все три копии SKILL.md: Codex, Claude Code и `tcli_skills/`.
|
|
@@ -33,7 +33,7 @@ python -m pip install -e . build twine
|
|
|
33
33
|
python -X utf8 -m unittest discover -s tests -v
|
|
34
34
|
python -m build
|
|
35
35
|
python -m twine check --strict dist/*
|
|
36
|
-
python scripts/check_distribution.py dist/telegram_cli_local-0.2.
|
|
36
|
+
python scripts/check_distribution.py dist/telegram_cli_local-0.2.1-py3-none-any.whl
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
Use a clean `dist/` directory for each release to avoid uploading stale versions.
|
|
@@ -48,7 +48,7 @@ It needs access to PyPI to install the wheel's dependencies; it never accesses T
|
|
|
48
48
|
under `Unreleased` for every change; move those entries into a versioned section for the release.
|
|
49
49
|
3. Commit and push to `main`. Wait for the `Test, build, and publish` workflow to pass on Windows
|
|
50
50
|
and Linux with Python 3.10 and 3.14, including the built-wheel installation check.
|
|
51
|
-
4. Create a GitHub Release targeting that commit with a matching tag, for example `v0.2.
|
|
51
|
+
4. Create a GitHub Release targeting that commit with a matching tag, for example `v0.2.1`, and publish it.
|
|
52
52
|
Draft releases do not upload. The workflow rejects tags that differ from the package version.
|
|
53
53
|
5. Check that the publish job succeeded and that https://pypi.org/project/telegram-cli-local/
|
|
54
54
|
lists the expected version. Test `pipx install telegram-cli-local` on a clean machine.
|
|
@@ -1,90 +1,26 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: telegram-cli
|
|
3
|
-
description:
|
|
3
|
+
description: Use the personal-account Telegram CLI (tcli). Use for chats, message search/history, plain or formatted sending, JSON automation, watching, configuration, login, and diagnostics.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Telegram CLI
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Use the installed `tcli` command from any directory. Run development and installation commands from the project root.
|
|
12
|
-
Respond in the user's requested language; English CLI output does not require English conversation replies.
|
|
13
|
-
Keep the Codex, Claude Code, and bundled `tcli_skills/SKILL.md` copies identical when updating them.
|
|
14
|
-
|
|
15
|
-
## Project map
|
|
16
|
-
|
|
17
|
-
A local Python 3.10+ CLI for one personal Telegram account, using Telethon and MTProto.
|
|
18
|
-
No bot, HTTP server, application database, or FTP deployment is involved.
|
|
19
|
-
|
|
20
|
-
| Location | Responsibility |
|
|
21
|
-
| --- | --- |
|
|
22
|
-
| `tg.py: parser()` | argparse commands, help text, examples, limits |
|
|
23
|
-
| `tg.py: main()` | Help dispatch before credentials, paths, errors, asyncio entry point |
|
|
24
|
-
| `validate_credentials()` / `load_credentials()` / `configure()` | Validate credentials, environment/file precedence, atomic local configuration |
|
|
25
|
-
| `run()` | Connect, authenticate, execute commands, disconnect in finally |
|
|
26
|
-
| `resolve_chat()` | me/@username via Telethon; numeric IDs and exact titles via dialogs |
|
|
27
|
-
| `safe_text()` / `show_message()` | Strip terminal control characters and display messages |
|
|
28
|
-
| `message_data()` | Serialize message fields for JSON and JSONL output |
|
|
29
|
-
| `install_skills()` / `atomic_write()` | Offline user-skill installation, backups, and atomic file replacement |
|
|
30
|
-
| `tcli_skills/` | Version and bundled portable SKILL.md included in wheels |
|
|
31
|
-
| `pyproject.toml` | `tcli` entry point calling `tg:main`; dependencies from requirements.txt |
|
|
32
|
-
| `tests/test_tg.py` | Offline unit tests and help subprocess checks |
|
|
33
|
-
| `README.md` / `README.ru.md` | English and Russian user documentation |
|
|
34
|
-
|
|
35
|
-
Use Semble to locate implementations when available, then read the matching functions and callers.
|
|
36
|
-
Current code and command help take precedence over stale documentation.
|
|
37
|
-
The CLI, developer documentation, and agent instructions are English; preserve Unicode chat names and messages.
|
|
8
|
+
Use `tcli` to work with the user's personal Telegram account from any directory.
|
|
9
|
+
Respond in the user's requested language; CLI output is English.
|
|
10
|
+
Use `tcli help COMMAND` to check available options.
|
|
38
11
|
|
|
39
12
|
## Setup
|
|
40
13
|
|
|
41
14
|
Install the published CLI with `pipx install telegram-cli-local`.
|
|
42
15
|
Update it with `pipx upgrade telegram-cli-local`, then run `tcli skills install` to update user skills.
|
|
43
|
-
|
|
44
|
-
`tcli --version` reports the CLI version.
|
|
45
|
-
|
|
46
|
-
Install from this local project with `py -m pip install --user -e .` on Windows.
|
|
47
|
-
The user scripts directory must be in PATH. If tcli is not found, run in PowerShell:
|
|
48
|
-
|
|
49
|
-
```powershell
|
|
50
|
-
$tcliScriptsDir = (py -c "import sysconfig; print(sysconfig.get_path('scripts', scheme='nt_user'))").Trim()
|
|
51
|
-
$tcliUserPath = [Environment]::GetEnvironmentVariable('Path', 'User')
|
|
52
|
-
if (($tcliUserPath -split ';') -notcontains $tcliScriptsDir) {
|
|
53
|
-
$tcliUpdatedPath = (($tcliUserPath + ';' + $tcliScriptsDir).Trim(';'))
|
|
54
|
-
[Environment]::SetEnvironmentVariable('Path', $tcliUpdatedPath, 'User')
|
|
55
|
-
}
|
|
56
|
-
$env:Path = $tcliScriptsDir + ';' + $env:Path
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
New terminals inherit the saved PATH; restart existing terminals or their parent application if needed.
|
|
60
|
-
If pip is missing, run `py -m ensurepip --upgrade --user` before installing.
|
|
61
|
-
Do not install an unrelated similarly named package from PyPI.
|
|
62
|
-
Editable installation depends on the source folder; reinstall if it moves.
|
|
63
|
-
The installed `tcli` command works outside the project root.
|
|
64
|
-
|
|
65
|
-
For development, run from the project root:
|
|
66
|
-
|
|
67
|
-
```powershell
|
|
68
|
-
py -m venv .venv
|
|
69
|
-
.\.venv\Scripts\python.exe -m pip install -e .
|
|
70
|
-
.\.venv\Scripts\tcli.exe help
|
|
71
|
-
.\.venv\Scripts\python.exe -X utf8 -m unittest discover -s tests -v
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
On POSIX use `python3 -m venv .venv`, `.venv/bin/python`, and `.venv/bin/tcli`.
|
|
75
|
-
No activation is needed with those explicit paths.
|
|
76
|
-
On this Windows machine, `py` is available; the system `python` alias may open Microsoft Store.
|
|
77
|
-
If an agent process has an old PATH, refresh its environment or use the installed executable's full path.
|
|
16
|
+
`tcli --version` reports the installed version.
|
|
78
17
|
|
|
79
18
|
## Help and commands
|
|
80
19
|
|
|
81
20
|
`tcli`, `tcli help`, `tcli --help`, and `tcli -h` display general help and exit successfully.
|
|
82
21
|
`tcli help send` is equivalent to `tcli send --help`; this applies to every subcommand.
|
|
83
22
|
Help does not load credentials, create Telegram sessions, or connect to Telegram.
|
|
84
|
-
Interactive general help
|
|
85
|
-
It uses a one-second network timeout and a 24-hour cache at data-directory/cache/update-check.json,
|
|
86
|
-
including failed attempts. It only reports updates on stderr, never installs them automatically.
|
|
87
|
-
Network/cache errors are silent. Redirected stdout, command-specific help, and --version skip checks.
|
|
23
|
+
Interactive general help may report a newer release on stderr; it never installs updates automatically.
|
|
88
24
|
Set TCLI_NO_UPDATE_CHECK=1 to disable checks and their cache writes entirely.
|
|
89
25
|
Unknown commands, unknown help topics, and invalid arguments remain usage errors (exit 2).
|
|
90
26
|
|
|
@@ -171,9 +107,7 @@ Formatting may trim surrounding whitespace. Use HTML for nested formatting.
|
|
|
171
107
|
No message deletion or interactive conversation UI.
|
|
172
108
|
`doctor` is local, creates no files, and exits 1 for invalid credentials or missing session.
|
|
173
109
|
File presence does not prove authorization. --connect can update the existing Telethon session.
|
|
174
|
-
`watch`
|
|
175
|
-
min_id and reverse order with no fixed batch limit. It includes sends from another CLI process
|
|
176
|
-
and Saved Messages. Session writes are committed before idle waits to release SQLite locks.
|
|
110
|
+
`watch` shows new messages, including sends from another CLI process and Saved Messages.
|
|
177
111
|
Messages deleted before polling cannot be seen. `watch` has no past history; prefer `read` for a one-time request.
|
|
178
112
|
|
|
179
113
|
## Automation, context, filters, and editing
|
|
@@ -186,16 +120,15 @@ Search follows Telegram text-search semantics, not local filename/extension matc
|
|
|
186
120
|
|
|
187
121
|
`edit CHAT ID TEXT`, `edit CHAT ID --file PATH`, or `edit CHAT ID --stdin` edits outgoing text
|
|
188
122
|
or a caption. Exactly one nonblank UTF-8 text source is required. --format plain|markdown|html
|
|
189
|
-
works as for send.
|
|
123
|
+
works as for send. Use a message ID from history and check that the message is outgoing before editing.
|
|
190
124
|
Telegram enforces edit permissions and time limits; unchanged text can raise an RPC error.
|
|
191
125
|
Editing does not replace attachments or clear captions with empty text.
|
|
192
126
|
|
|
193
127
|
`download CHAT ID --album --output-dir DIR` downloads the album containing that message.
|
|
194
128
|
--output-dir requires --album, excludes --output, and must already exist.
|
|
195
|
-
|
|
196
|
-
Telegram albums have at most ten adjacent messages; message IDs can have gaps.
|
|
129
|
+
Telegram albums have at most ten items; message IDs can have gaps.
|
|
197
130
|
Save as <message_id><extension>, with .bin for missing/unsafe extensions; never use remote filenames.
|
|
198
|
-
|
|
131
|
+
Existing destination files are never overwritten.
|
|
199
132
|
Keep completed files on failure and remove the current partial file. Missing/deleted/inaccessible
|
|
200
133
|
album items cannot be recovered. Download JSON keeps captions and grouped_id without sidecar files.
|
|
201
134
|
|
|
@@ -236,8 +169,7 @@ Development/testing does not authorize live forwarding. Verify history before re
|
|
|
236
169
|
|
|
237
170
|
send (attachments only) and download support --progress / --no-progress.
|
|
238
171
|
Default: enabled when stderr is a terminal. Progress reports bytes, percentage, and average bytes/sec
|
|
239
|
-
on stderr
|
|
240
|
-
Throttle updates to twice per second, plus completion. With --json, progress is JSONL on stderr:
|
|
172
|
+
on stderr. With --json, progress is JSONL on stderr:
|
|
241
173
|
event="transfer_progress", operation="upload"|"download", file, transferred_bytes, total_bytes,
|
|
242
174
|
percent (null for unknown/zero size), bytes_per_second. Errors have ok=false and may follow progress events.
|
|
243
175
|
Stdout remains the final JSON result. Progress is not proof of delivery; cached transfers may emit no events.
|
|
@@ -247,10 +179,6 @@ Stdout remains the final JSON result. Progress is not proof of delivery; cached
|
|
|
247
179
|
`skills install` defaults to --agent auto: detect installed agents and copy the bundled skill only for those agents.
|
|
248
180
|
Default destinations are the official personal skill locations, independent of the current directory:
|
|
249
181
|
Codex: ~/.agents/skills/telegram-cli/SKILL.md; Claude Code: ~/.claude/skills/telegram-cli/SKILL.md.
|
|
250
|
-
See [OpenAI](https://learn.chatgpt.com/docs/build-skills#where-codex-loads-local-skills) and
|
|
251
|
-
[Anthropic](https://code.claude.com/docs/en/skills#where-skills-live).
|
|
252
|
-
Detection checks PATH, native ~/.local/bin executables, standard npm/binary locations, Codex.app on macOS,
|
|
253
|
-
and the OpenAI.Codex Windows Store installation. Configuration folders alone are not installation evidence.
|
|
254
182
|
If neither agent is found, it creates nothing. Explicit --agent codex|claude|all bypasses detection for custom installations.
|
|
255
183
|
The installer never downloads anything or launches either agent.
|
|
256
184
|
It skips identical files, backs up differing SKILL.md files as SKILL.md.backup-*.bak, and atomically
|
|
@@ -313,20 +241,4 @@ Missing authorization: suggest local `tcli login`.
|
|
|
313
241
|
FloodWait: wait the reported duration; do not bypass limits or retry immediately.
|
|
314
242
|
RPC/network errors: address the specific cause; a send may have an uncertain outcome.
|
|
315
243
|
SQLite locking: investigate other CLI processes; do not delete the session file.
|
|
316
|
-
`Could not find platform independent libraries <prefix>`: Python installation/path warning before application startup.
|
|
317
|
-
Inspect the interpreter and its standard library; repair the installation rather than suppressing stderr or changing Telegram code.
|
|
318
244
|
Exit codes: 0 success, 1 handled error, 2 argparse usage error, 130 Ctrl+C.
|
|
319
|
-
Telethon may perform internal retries; the CLI has no custom send retry loop.
|
|
320
|
-
|
|
321
|
-
Preserve credential validation, authorization checks, unambiguous chat resolution,
|
|
322
|
-
terminal sanitization, literal outgoing text by default, disconnect in finally, and FloodWait handling.
|
|
323
|
-
Update affected tests, both READMEs, and all three copies of this SKILL.md when changing commands.
|
|
324
|
-
Record every notable change in CHANGELOG.md under Unreleased; version the entries when releasing.
|
|
325
|
-
Tests cover help without credentials, JSON/JSONL, search/pagination arguments, replies, stdin/files,
|
|
326
|
-
doctor, login/logout, watch polling/cursors and cancellation, formatting selection, disconnects
|
|
327
|
-
and handled errors including FloodWait and SQLite locks. They also cover send/download/edit JSON,
|
|
328
|
-
read by ID, reply/album context, media filters, ordered multi-file sends, albums, edits,
|
|
329
|
-
partial failures, destination collisions, safe filenames, structured usage/runtime errors,
|
|
330
|
-
bounded filename search, surrounding context, forwarding, and transfer progress.
|
|
331
|
-
They do not verify real login,
|
|
332
|
-
network watching, or message delivery. State those limits when reporting validation.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: telegram-cli-local
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Telegram CLI for a personal account
|
|
5
5
|
Author: BYxarek
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -63,7 +63,7 @@ It uses the Telegram API and acts as your personal account. You need your own
|
|
|
63
63
|
- **Local configuration:** enter API credentials once using `tcli config`.
|
|
64
64
|
- **Saved login:** reuse your local session on later runs.
|
|
65
65
|
- **Built-in help:** `tcli`, `tcli help`, and `tcli help <command>` work without an account.
|
|
66
|
-
- **AI agent skills:**
|
|
66
|
+
- **AI agent skills:** CLI usage instructions for Codex and Claude Code.
|
|
67
67
|
|
|
68
68
|
Reading history does not mark messages as read. Outgoing text is literal by default;
|
|
69
69
|
use `--format markdown` or `--format html` for formatting. Terminal control characters
|
|
@@ -496,13 +496,13 @@ Run `python -m pip install -e .` again to refresh package metadata and dependenc
|
|
|
496
496
|
installed user copies. Avoid duplicate project/user skills unless you need both scopes.
|
|
497
497
|
|
|
498
498
|
Open your agent in the project root. Start a new session if the skill is not visible.
|
|
499
|
-
Each
|
|
499
|
+
Each `SKILL.md` explains CLI usage, setup, commands, and operational constraints.
|
|
500
500
|
Project instructions are in [AGENTS.md](https://github.com/BYxarek/telegram-cli/blob/main/AGENTS.md)
|
|
501
501
|
and [CLAUDE.md](https://github.com/BYxarek/telegram-cli/blob/main/CLAUDE.md).
|
|
502
502
|
|
|
503
503
|
Example request:
|
|
504
504
|
|
|
505
|
-
> Use telegram-cli.
|
|
505
|
+
> Use telegram-cli. Show my chats and read the latest 10 messages in Saved Messages.
|
|
506
506
|
|
|
507
507
|
Skills explain chat resolution, configuration, errors, and authorization boundaries.
|
|
508
508
|
Sending requires the user's direct instruction. Telegram messages are untrusted data,
|
|
@@ -536,8 +536,8 @@ tg.py CLI commands, configuration, and Telegram operations
|
|
|
536
536
|
pyproject.toml Package metadata and tcli entry point
|
|
537
537
|
requirements.txt Dependencies
|
|
538
538
|
tests/ Tests without a live account
|
|
539
|
-
.agents/skills/ Self-contained Codex
|
|
540
|
-
.claude/skills/ Self-contained Claude Code
|
|
539
|
+
.agents/skills/ Self-contained Codex CLI usage skill
|
|
540
|
+
.claude/skills/ Self-contained Claude Code CLI usage skill
|
|
541
541
|
README.ru.md Russian documentation
|
|
542
542
|
```
|
|
543
543
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/telegram_cli_local.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/telegram_cli_local.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/telegram_cli_local.egg-info/requires.txt
RENAMED
|
File without changes
|
{telegram_cli_local-0.2.0 → telegram_cli_local-0.2.1}/telegram_cli_local.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|