Telegram CLI for Linux

In Telegram, millions of users communicate every day. Attracts them, first of all, the security of information transmitted through the messenger. Telegram allows you to self-destruct correspondence, and also uses powerful encryption of all passing information. How can I communicate via the Telegram CLI, available on Linux? What you need to do for this, how installation and work are carried out, read on.

What is the Telegram CLI

Telegram CLI for Linux.

CLI is a console client from Telegram for Linux. The program allows users to communicate * nix-systems super confidentially and adheres to the main principles of the messenger: the reliability of the open API and the integrity of the data.

Using the CLI, you can exchange texts, photos, videos, documents and other information in secret chats that are inaccessible to anyone except the users who are in them.

CLI source code is open for public access, so anyone can help and participate in the finalization of the project.

Destination

Along with regular clients, Telegram CLI provides the ability to send, as well as receive and read messages on channels, in groups and chats.

However, thanks to the program, the user becomes available:

  • sending color messages;
  • the ability to create, manage and connect group chats;
  • advanced control of correspondence and management of its history;
  • confidential communication after creating one private chat (there is a limitation in telegram cli);
  • freedom to send any files, regardless of size and execution;
  • chance to add, delete and edit contacts.

Auto-completion is available in Telegram cli, with its help a user who finds it difficult to remember the whole command needed, enters only its beginning. By entering the first characters of the line and pressing “Tab”, you can relax, as the service will independently supplement it and execute the necessary command.

Important! The messenger does not allow you to send stickers, emoticons, set the background in correspondence, and other visual functions are not available in it, however, this is compensated by the merits.

Benefits

Telegram console and userside have a number of excellent features:

  • High speed: it takes several times less time to send messages from a line on linux than on Windows classics.
  • If the client has a graphical interface, it is not possible to send documents with text information. But the text interface on telegram cli is able to send such a file.
  • To send messages there is no need to use a mouse, select the contacts you need to write, switch from one window to another and so on. Just enter the name of the user to whom you want to send text, type a message – sending and delivery will occur instantly.
  • Demon mode exists for greater performance. It is possible to enter userside telegram in daemon mod, which will help to leave chat rooms and contacts in the active position, which will be located in the background.
  • The program is allowed to run through the console. A huge number of teams that serve to activate, expand the field of opportunities for work and the number of options for working in the program.
  • A small number of system characteristics for access. It is possible to install Telegram Cli on any known system.

Client Installation

Telegram CLI is an unofficial component of Linux distributions, so the user will have to install himself.

Next, we’ll talk about client installation algorithms for Ubuntu and Fedora.

For Ubuntu / Debian

Important! Popular forms of software distribution do not have the ability to install CLI using standard systems. For installation in this case, you need to use Snap packages.

Algorithm for installing Telegram CLI on Debian and Ubuntu RAMs:

  • launch the terminal itself;
  • enter the command: sudo snap install telegram-cli, which starts the client installation.

Attention! If the user has not used such a package management system, it will be necessary to install a special kernel, which requires Snap. Its activation will make it possible to work with the system. The kernel will need approximately 80 MB of RAM.

For Fedora

Fedora allows you to acquire Telegram CLI by downloading through the repository, for example, RPMFusion.

Installation Algorithm:

  • launch the terminal itself;
  • enter the command: sudo dnf install telegram-cli, which starts the client installation.

It remains to wait for the installation to complete and get started.

Application launch

Like any messenger, Telegram Kli functions only in conjunction with a mobile number, which serves as a confirmation of the user’s identity.

We install the following recommendations for installation:

  • We drive in the telegram-cli command after starting the client.
  • A prompt appears on the screen to enter the mobile number. We enter the phone without a “+” in front of it.
  • An SMS notification with a code comes to the entered number, the numbers must be entered, after which the client will be authorized.

CLI Client Commands

Telegram cli teams fall into several categories. The user can engage, entering them, communication, forwarding multimedia, search and others. After completing the installation, the person needs to remember the commands. With their help, you can work in the program. Even an account becomes accessible to the client only through the use of the command line.

Next, we’ll tell you what commands the installed CLI can use, but before that it’s worth noting what peer is.

Important! A feast is the name of a dialogue or contact in which underscores are used instead of spaces. If there are two identical names for people, a telephone number is added to their feast after the first and last names.

For example, to send a message to one of the friends in Telegram, enter this command:

msg [peer] [text]

CLI Client Commands.

It’s easy to replace [peer] with the username (we’ll start typing the name and press Tab, this will help to enter the feast automatically), instead of [text] we’ll drive in the message that you want to send to the interlocutor.

After sending in the received screenshot, you will see both the sent letter and the fact that you answered it.

Commands for communication

  • msg Text – sending a message to the interlocutor.
  • fwd – forward an already held message. Texts can pop up with numbers if the terminal during program start will enter: “–N”.
  • chat_with_peer – helps to get in touch with the entered subscriber. To exit, type / exit or / quit.
  • mark_read – if you want the messages sent by the peer to be in the read state, type this code.
  • delete_msg – to delete a message received from the interlocutor (it is erased from you, but not from him).
  • restore_msg – restore a deleted message. The secret chat is not applied. You can restore immediately after the deletion (about an hour), later it no longer works.

Some Media Management Commands

  • fwd_media – to send media in correspondence. It is used when it is necessary to encrypt the data of the author of the file, the interlocutor will not be able to find it by viewing a photo or video. However, having studied the audio recording or other media, you can find user_id.
  • set_profile_photo – setting an avatar for a user profile with automatic cropping to a square.

Commands for managing group chats

  • chat_info – displays data about the required chat.
  • chat_add_user – adds a feast to the conversation.
  • chat_del_user – enter to remove the interlocutor from communication.

Search

  • search pattern – allows you to find the desired text in a dialogue with the interlocutor.
  • global_search pattern – to search for a message among all messages existing in Kli.

Commands for displaying statistics and information

  • user_info – to view user information.
  • history [limit] – displays the history of messages and marks them as read. You can withdraw up to 40.
  • suggested_contacts – information about peers with which the user has a lot of common friends.
  • dialog_list – shows data on dialogs.
  • contact_list – displays information on users from the contact list.
  • get_self – data that contains its own contact.

Special cards with information about the feast

  • export_card – shows your data displayed in a special “map”. Other users can add this profile to their contact list.
  • import_card – request for receiving a feast on its card. Having information about him, you can start communication.

Exit console.

Output

  • quit – exit the console.
  • safe_quit – configure the program to wait for the completion of actions, after which the device exits Kli automatically.

A complete and constantly updated set of commands can be found on the official website.

Important! If an error is made during the typing of any command, it is not executed. Having a list at hand, you can always navigate and work productively using official developments.

Server status forwarding via Telegram CLI

We examined how to install and use the Telegram CLI in work. Now let’s see how to get information from a Linux server.

To do this, you must:

  • Drive the team: /root/status.sh
  • After that, the text file status.txt appears, where we enter /root/tg_text_send.sh
  • To create a task and place it in the scheduler, enter /root/tg_status_send.sh
  • In crontab we drive.
  • Next, we prescribe the task line and reboot.
  • To control the execution of system tasks, open the log: grep CRON / var / log / syslog
  • Now you can view how things are on the server from the device where the CLI is installed.

conclusions

For those who work with the Linux system, the Telegram CLI is a great solution. This client helps to communicate and work through the messenger, adjusting userside and other parameters for themselves. You will have to complete the CLI installation only once, so difficulties can arise when entering commands, but even here we published the basic ones, which are enough for the user to work in Telegram.