Get a shell on your RasPi, I prefer to do this over SSH. You can also plug your RasPi to a screen and ann a keyboard.
sudo apt-get install -y git sudo apt-get install -y libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev make git clone --recursive https://github.com/vysheng/tg.git && cd tg ./configure make mkdir ~/bin cp bin/telegram-cli ~/bin/
Then, add this like to your
~/.bashrc to make the binary available in your PATH:
telegram-cli -k <your pubkey>
Then you have to enter the code you get per sms to your phone.
You can now use the telegram CLI.