A simple command-line utility to send messages or files to Telegram chat directly from your terminal.
- Send messages to Telegram channel/chat/group directly from command line
- Automatically switch between message and file mode based on content length
- Generate shareable Telegram links
- Easy installation with guided setup
- Simple configuration
- Clone this repository:
git clone https://github.com/linuxmaster14/telepipe.git
cd telepipe- Run the installation script with an optional topic name:
chmod +x installer.sh
sudo ./installer.shDuring installation, you'll need to provide:
- Your Telegram Bot Token (get it from BotFather)
- Your Chat ID (can be a group, channel, or user ID)
# Show help
telepipe --help
# Show version
telepipe --version
# Send a simple message
echo "Hello from my server!" | telepipe
# Send the output of a command
uptime | telepipe
# Send the contents of a file
cat logfile.txt | telepipe
# Use it in your scripts
backup_db() {
# backup logic here
if [ $? -eq 0 ]; then
echo "Database backup completed successfully at $(date)" | telepipe
else
echo "Database backup FAILED at $(date)" | telepipe
fi
}The configuration file is located at /etc/telepipe/config and includes the following settings:
BOT_TOKEN: Your Telegram bot token from BotFatherCHAT_ID: ID of the chat where messages will be sentMAX_LEN: Maximum message length before sending as file (default: 4096)TIMEOUT: API request timeout in seconds (default: 5)DISABLE_LINK_PREVIEW: Whether to disable link previews (default: true)
MIT
Contributions are welcome! Please feel free to submit a Pull Request.