Install Telegram Messenger di CLI

  1. Pertama clone dulu GitHub Repositorynya
git clone --recursive && cd tg
  1. Install paket-paket pendukungnya, karena saya menggunakan Debian maka perintahnya
sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev make
  1. Jika mendapati kode kesalahan seperti ini
Submodule path 'tgl/tl-parser': checked out 'ec8a8ed7a4f22428b83e21a9d3b5815f7a6f3bd9'

maka lakukan

git submodule update --init --recursive

Selanjutnya jalankan perintah

  1. Tunggu hinggra prosesnya selesai, lalu jalankan Telegram Cli dengan perintah
bin/telegram-cli -k
  1. Saat pertama menginstall kalian akan diperintahkan memasukkan nomor handphone untuk pendaftaran, selanjutnya tunggu dan masukkan kode konfirmasinya. Selesai

Beberapa contoh baris perintah Telegram di CLI



  • msg Text – sends message to this peer </li>
  • fwd – forward message to user. You can see message numbers starting client with -N </li>
  • chat_with_peer starts one on one chat session with this peer. /exit or /quit to end this mode. </li>
  • add_contact – tries to add contact to contact-list by phone </li>
  • rename_contact – tries to rename contact. If you have another device it will be a fight </li>
  • mark_read – mark read all received messages with peer </li>
  • delete_msg – deletes message (not completly, though) </li>
  • restore_msg – restores delete message. Impossible for secret chats. Only possible short time (one hour, I think) after deletion </li> </ul>


    • send_photo – sends photo to peer </li>
    • send_video – sends video to peer </li>
    • send_text – sends text file as plain messages </li>
    • load_photo/load_video/load_video_thumb/load_audio/load_document/load_document_thumb – loads photo/video/audio/document to download dir </li>
    • view_photo/view_video/view_video_thumb/view_audio/view_document/view_document_thumb – loads photo/video to download dir and starts system default viewer </li>
    • fwd_media send media in your message. Use this to prevent sharing info about author of media (though, it is possible to determine user_id from media itself, it is not possible get access_hash of this user) </li>
    • set_profile_photo – sets userpic. Photo should be square, or server will cut biggest central square part </li> </ul>

      Group chat options

      • chat_info – prints info about chat </li>
      • chat_add_user – add user to chat </li>
      • chat_del_user – remove user from chat </li>
      • rename_chat </li>
      • create_group_chat … – creates a groupchat with users, use chat_add_user to add more users </li>
      • chat_set_photo – sets group chat photo. Same limits as for profile photos. </li> </ul>


        • search pattern – searches pattern in messages with peer </li>
        • global_search pattern – searches pattern in all messages
        • </ul>

          Secret chat

          • create_secret_chat – creates secret chat with this user </li>
          • visualize_key – prints visualization of encryption key. You should compare it to your partner’s one </li>
          • set_ttl – sets ttl to secret chat. Though client does ignore it, client on other end can make use of it </li>
          • accept_secret_chat – manually accept secret chat (only useful when starting with -E key) </li> </ul>

            Stats and various info

            • user_info – prints info about user </li>
            • history [limit] – prints history (and marks it as read). Default limit = 40 </li>
            • dialog_list – prints info about your dialogs
            • contact_list – prints info about users in your contact list
            • suggested_contacts – print info about contacts, you have max common friends
            • stats – just for debugging
            • show_license – prints contents of GPLv2
            • help – prints this help
            • </ul>