Install telegram cli and send messages from shell linux

Tutorial to installation telegram cli (Command line interface) on debian/raspbian/bananian

Install git if you don’t have it

apt-get install git

Clone from git

git clone --recursive

or download the master file and uncompress

wget -O
apt-get install unzip
cd tg-master

Install libs
sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev
apt-get install gcc
apt-get install make

Configure and make

after compiled, the only files you need are telegram and

run from the folder with

First time run program, he ask to sign up with a mobile number.
in your home directory will be created a hidden folder .telegram.
This directory contain the auth and other files.
For send message:
msg contactName message

for exit:

Multiuser (?):

you can copy telegram in /usr/bin:
mv telegram /usr/bin/telegram
make a config dir in etc
mkdir /etc/telegram
move .telegram-cli from home to etc
mv .telegram-cli /etc/telegram/telegram-cli
edit config file
nano /etc/telegram/telegram-cli/config
and insert this:

default_profile = "main";
main = {
config_directory = "/etc/telegram/telegram-cli";

mv /etc/telegram/

set correct permissions

now use with:

telegram -k /etc/telegram/ -c /etc/telegram/telegram-cli/config



read this post for create send script.

3 thoughts on “Install telegram cli and send messages from shell linux

  1. trying make command I got error:
    $ make
    make: *** No targets specified and no makefile found. Stop.

    can you please help me?

Leave a Reply

Your email address will not be published. Required fields are marked *