Send files to Telegram contacts from your CLI with a pretty TUI.
- Pretty TUI — Colors, progress bars, and unicode symbols
- Fuzzy search — Find contacts by typing part of their name
- Pinned contacts — Pin frequently used contacts to the top
- Easy install — One command installation
- LLM-friendly — JSON output commands for automation
uv tool install tg-send-cliOr with pip:
pip install tg-send-cliBefore first use, you need Telegram API credentials:
- Go to my.telegram.org
- Log in with your phone number
- Create a new application
- Copy your API ID and API Hash
The tool will prompt you for these on first run.
tgsend photo.jpg # Send a photo
tgsend document.pdf # Send a document
tgsend video.mp4 # Send a videoContact Selection:
- Type to fuzzy search through contacts
- ↑↓ to navigate
- Enter to select
- Ctrl+P to pin/unpin selected contact
- Esc to cancel
All commands below output JSON for easy parsing by LLMs and scripts.
tgsend config --api-id 12345 --api-hash "your_hash"tgsend status
# {"success": true, "configured": true, "authenticated": true, "user": {...}}# 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 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}, ...]}# By name (fuzzy matched)
tgsend send photo.jpg --to "John Doe"
# By Telegram ID
tgsend send photo.jpg --to-id 123456789# Pin a contact
tgsend pin "John Doe"
# Unpin a contact
tgsend unpin "John Doe"
# List pinned contacts
tgsend pinned
# List only pinned contacts
tgsend contacts --pinned-onlyYour session is saved locally at ~/.telegram_file_sender/.
MIT