PHPackages                             jlaso/telegram-cli-wrapper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jlaso/telegram-cli-wrapper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jlaso/telegram-cli-wrapper
==========================

wrapper to telegram-cli

4103[1 issues](https://github.com/jlaso/telegram-cli-wrapper/issues)PHP

Since Nov 14Pushed 7y ago3 watchersCompare

[ Source](https://github.com/jlaso/telegram-cli-wrapper)[ Packagist](https://packagist.org/packages/jlaso/telegram-cli-wrapper)[ RSS](/packages/jlaso-telegram-cli-wrapper/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#A wrapper for [Telegram-CLI](https://github.com/vysheng/tg)

\##Dependencies Follow the [instructions](https://github.com/vysheng/tg/blob/master/README.md) for your operating system.

You need to start the telegram-cli the first time manually in order to register the phone number.

./bin/telegram-cli

After that, start telegram-cli as a daemon from the root of the tg repo.

./bin/telegram-cli --json -dWS /tmp/tg.sck &amp;

You can try to use that one to install telegram-cli as a daemon in your server (I was unable to do)

\###Notes Basically you have to create a group telegram and add users www-data (or apache), root (or the user you use to access through ssh) and telegramd. give permissions to /tmp/tg.sck to that group (telegram) You can start telegram-cli manually following the above order or just let the script to start it.

\##Install Once installed vysheng/tg clone this project with:

`git clone https://github.com/jlaso/telegram-cli-wrapper.git`

Run `composer install` inside the folder repo in order to create autoload files.

\##Examples Take a look on test folder to see how easy is to use the wrapper.

If you don't want to have started telegram-cli you can use TelegramCliHelper in order to start it automatically each time is needed. To do that you need to create a config.ini in the config folder (you have config.ini.dis as a template)

All the examples in the test folder use this Helper.

\##Why TelegramCliHelper and Why to use it ?

The better way to use telegram-cli IMHO is to have started always the telegram-cli as a daemon. But maybe you want to test something or only start it when you really need it. Becase you use a lazy cron that checks for chats once per hour or something like that. In a real environment I would prefer to have started telegram-cli and a php script checking in loop all chats in order to serve to users in real time.

\##Last thoughts In order that you know how to use the automated system to accept "orders" from the users or notify them by Telegram I have prepared a little web application that you can find in /public folder. Remember that some "orders" need defailed configuration in /config/config.ini, openweathermap is one of them. You can create a free account. The weather is cached in order that don't exceed the number of free calls.

Obviously all of this is only a big example, a proof of concept if you want. You have to create the services that your web need and provide access to your users in the way you consider the better.

In order to simplify at maximum the examples I have created a simpleStorage system for users that come to the web, on the /data/user folder the users are serialized and labeled with the phone number. In your definitive system you have to connect your real users with the phone number, probably with a mysql table or something like that.

Any pull request or issue with improvement proposal are welcome.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f19216fd9d91bd7cfff14362e2ddb5728bd2d8f50d2e0174626fc61510ed33b?d=identicon)[jlaso](/maintainers/jlaso)

---

Top Contributors

[![jlaso](https://avatars.githubusercontent.com/u/1332197?v=4)](https://github.com/jlaso "jlaso (2 commits)")

### Embed Badge

![Health badge](/badges/jlaso-telegram-cli-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/jlaso-telegram-cli-wrapper/health.svg)](https://phpackages.com/packages/jlaso-telegram-cli-wrapper)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
