Skip to main content

Send files to Telegram contacts from your CLI

Project description

📨 tg-send-cli

Send files to Telegram contacts from your CLI with a pretty TUI.

PyPI Python

Features

  • Pretty TUI — Colors, progress bars, and unicode symbols
  • Fuzzy search — Find contacts by typing part of their name
  • Easy install — One command installation
  • LLM-friendly — JSON output commands for automation

Installation

uv tool install tg-send-cli

Or with pip:

pip install tg-send-cli

Setup

Before first use, you need Telegram API credentials:

  1. Go to my.telegram.org
  2. Log in with your phone number
  3. Create a new application
  4. Copy your API ID and API Hash

The tool will prompt you for these on first run.

Usage

Interactive Mode (TUI)

tgsend photo.jpg        # Send a photo
tgsend document.pdf     # Send a document
tgsend video.mp4        # Send a video

Contact Selection:

  • Type to fuzzy search through contacts
  • ↑↓ to navigate
  • Enter to select
  • Esc to cancel

LLM-Friendly Commands (JSON Output)

All commands below output JSON for easy parsing by LLMs and scripts.

Configure credentials

tgsend config --api-id 12345 --api-hash "your_hash"

Check status

tgsend status
# {"success": true, "configured": true, "authenticated": true, "user": {...}}

Authenticate

# Step 1: Request code
tgsend auth --phone "+1234567890"
# {"success": true, "status": "code_sent", "phone_code_hash": "abc123", ...}

# Step 2: Verify code
tgsend auth --phone "+1234567890" --code 12345
# {"success": true, "status": "authorized", "user": {...}}

# If 2FA is enabled:
tgsend auth --phone "+1234567890" --code 12345 --password "your_2fa_password"

List/search contacts

# List all contacts
tgsend contacts
# {"success": true, "count": 50, "contacts": [{"id": 123, "name": "John", "type": "user"}, ...]}

# Search contacts
tgsend contacts --search "john"
# {"success": true, "count": 3, "contacts": [{"id": 123, "name": "John Doe", "type": "user", "match_score": 90}, ...]}

Send file (non-interactive)

# By name (fuzzy matched)
tgsend send photo.jpg --to "John Doe"

# By Telegram ID
tgsend send photo.jpg --to-id 123456789

Session Storage

Your session is saved locally at ~/.telegram_file_sender/.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tg_send_cli-1.2.0.tar.gz (35.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tg_send_cli-1.2.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file tg_send_cli-1.2.0.tar.gz.

File metadata

  • Download URL: tg_send_cli-1.2.0.tar.gz
  • Upload date:
  • Size: 35.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tg_send_cli-1.2.0.tar.gz
Algorithm Hash digest
SHA256 38162a7641e1f20c67ab93e0f9cac48606786ccac6ad68934ac60a562902a4fd
MD5 2981689ba831ce2471a02139464a52ea
BLAKE2b-256 c09f430842cf1834ed210f275e904987e0c023804f94990ab13191e99e7187e6

See more details on using hashes here.

File details

Details for the file tg_send_cli-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: tg_send_cli-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tg_send_cli-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb09f732eb96fe1ea1b60ef64db3db891cb48d4e936dfde3bd80885ae447854f
MD5 3d50071e7b105d9801f87ae2596893d7
BLAKE2b-256 7c4c4a962cd97f593474286b02a41126c55d69bf499a089869fda597594a238a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page