tg-push
Python CLI for sending text plus an optional file to Telegram.
There is no bot polling loop, no MCP bridge, and no long-running server, just simple one-way messages.
Install
pip install tg-push
Or with pipx for an isolated install:
pipx install tg-push
Environment
| Variable | Required | Description |
|---|---|---|
TG_BOT_TOKEN |
yes | Telegram bot token from @BotFather |
TG_CHAT_ID |
yes | Target chat ID or @channelusername |
For a 1:1 bot chat, TG_CHAT_ID is your Telegram user id. For groups and channels, use the actual chat id instead.
Usage
tg-push --text "build finished"
tg-push --file ./render.png
tg-push --text "latest render" --file ./render.png
tg-push --text "report" --file ./report.pdf
Behavior
- At least one of
--textor--fileis required. - If
--fileis present, recognized images and videos are sent as Telegram media. - Other files are sent as documents, so PDFs, archives, and extensionless files work.
- Supported image extensions:
.jpg,.jpeg,.png,.webp - Supported video extensions:
.mp4,.mov,.m4v,.webm,.mkv,.avi - If
--textis longer than Telegram's media caption limit, the file is sent first and the text is sent as follow-up messages. - On success a one-line confirmation is printed to stdout, for example
Sent report.pdf (document) to @mychannel. Errors go to stderr with exit code 1. - The project has no runtime dependencies outside the Python standard library.
Metadata
Release files for tg-push 2.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tg_push-2.0.3.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tg_push-2.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.1 kB
Release files / tg_push-2.0.3.tar.gz
| Download URL | tg_push-2.0.3.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54a804e847d023825a2017202beb6f9f0fac7975a66a70a8f9a1ea76a61d7a40
|
|
BLAKE2b-256 checksum How to use checksums |
afc5a770c16a4c7b7cadd8d6beab57d08e716dede7aa3c3cbf3f84d2b07153a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / tg_push-2.0.3-py3-none-any.whl
| Download URL | tg_push-2.0.3-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
122c662364206e2bd9059ce5080cb0b49fa47adbcffb5d1bfd08f3ae45fce52e
|
|
BLAKE2b-256 checksum How to use checksums |
270e208ae9bf64779e8da4e974073d75b7531532ec953ca3950ffce841dc44dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|