Metadata-Version: 2.4
Name: tg-push
Version: 2.0.1
Summary: Single-shot CLI for sending text plus an optional image or video to Telegram.
Author-email: Alex Ermolov <alex@ermolov.space>
License-Expression: MIT
Project-URL: Homepage, https://github.com/htdt/tg-push
Project-URL: Issues, https://github.com/htdt/tg-push/issues
Keywords: telegram,cli,bot,notification
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.md
Dynamic: license-file

# tg-push

Python CLI for sending text plus an optional image or video to Telegram.

There is no bot polling loop, no MCP bridge, and no long-running server, just simple one-way messages.

## Install

```bash
pip install tg-push
```

Or with [pipx](https://pipx.pypa.io) for an isolated install:

```bash
pipx install tg-push
```

## Environment

| Variable | Required | Description |
|---|---|---|
| `TG_BOT_TOKEN` | yes | Telegram bot token from [@BotFather](https://t.me/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

```bash
tg-push --text "build finished"
tg-push --file ./render.png
tg-push --text "latest render" --file ./render.png
```

## Behavior

- At least one of `--text` or `--file` is required.
- If `--file` is present, the tool auto-detects image vs video from the file extension.
- Supported image extensions: `.jpg`, `.jpeg`, `.png`, `.webp`
- Supported video extensions: `.mp4`, `.mov`, `.m4v`, `.webm`, `.mkv`, `.avi`
- If `--text` is longer than Telegram's media caption limit, the file is sent first and the text is sent as follow-up messages.
- The project has no runtime dependencies outside the Python standard library.
