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.1.0.tar.gz (33.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.1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tg_send_cli-1.1.0.tar.gz
  • Upload date:
  • Size: 33.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.1.0.tar.gz
Algorithm Hash digest
SHA256 9b684c3bf94a3dced948990ef9fc086548b3a5168b6cf8f167da46ce532e115a
MD5 9d47a67a4529d0a826e2dc8e221c8715
BLAKE2b-256 3c5a121e4b47559ac66989331c5c7afac5ef8556a0f8b75246ce071ed6d8205b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tg_send_cli-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d15930805b1411fd44017a4b8277d2a6992d09047a3e228d3799e51b93be838c
MD5 c3bb690ad8aad92348f58266321df6f7
BLAKE2b-256 834b6588b988c9400a280319cfe28136aa7072fde22be150510ff679492f8570

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