PHPackages                             iwh3n/tgram - 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. [CLI &amp; Console](/categories/cli)
4. /
5. iwh3n/tgram

ActiveLibrary[CLI &amp; Console](/categories/cli)

iwh3n/tgram
===========

CLI tool to run your Telegram bot locally without Webhooks

v2.0.1(2mo ago)14MITPHPPHP &gt;=8.2

Since Feb 15Pushed 2mo agoCompare

[ Source](https://github.com/iwh3n/TGram)[ Packagist](https://packagist.org/packages/iwh3n/tgram)[ Docs](https://github.com/iwh3n/tgram)[ RSS](/packages/iwh3n-tgram/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

TGram 🚀
=======

[](#tgram-)

**CLI tool to run your Telegram bot locally without Webhooks**

TGram allows you to **test your Telegram bots locally** without exposing a public webhook. It fetches updates from Telegram using **long polling** and forwards them to your local bot endpoint so you can **develop, debug, and test** your bot easily.

---

✨ Features
----------

[](#-features)

- Receive Telegram updates on **local environments**.
- Works for **bots using webhooks**, no public URL required.
- Easy configuration using **YAML**.
- CLI interface powered by **Symfony Console**.
- Support for **multiple bots** simultaneously.
- Real-time logs for **debugging and monitoring**.

---

💻 Installation
--------------

[](#-installation)

Make sure you have **PHP &gt;= 8.2** and **Composer** installed.

### Linux / macOS

[](#linux--macos)

```
composer global require iwh3n/tgram
export PATH="$(composer global config bin-dir --absolute | tail -n1):$PATH"  # session-only
```

> ⚠️ This adds TGram **only for the current terminal session**. To make it permanent, enter the following commands:
>
> ```
> COMPOSER_GLOBAL_BIN=$(composer global config bin-dir --absolute)
>
> # for bash:
> echo "export PATH=\"\$PATH:$COMPOSER_GLOBAL_BIN\"" >> ~/.bashrc
> source ./.bashrc
>
> # for zsh:
> echo "export PATH=\"\$PATH:$COMPOSER_GLOBAL_BIN\"" >> ~/.zshrc
> source ./.zshrc
> ```

### Windows (PowerShell)

[](#windows-powershell)

```
composer global require iwh3n/tgram
$env:PATH = "$(composer global config bin-dir --absolute | Select-Object -Last 1);$env:PATH"  # session-only
```

> ⚠️ This adds TGram **only for the current PowerShell session**. To make it permanent, use:
>
> ```
> setx PATH "$($env:APPDATA)\Composer\vendor\bin;$env:PATH"
> ```
>
>
>
> Then restart your PowerShell.

Verify installation:

```
tgram --version
```

---

⚙️ Quick Start
--------------

[](#️-quick-start)

1. **Initialize configuration**

```
tgram init
```

Example `tgram.yaml`:

```
bot:
  token: "123456789:ABCDEF..."
  endpoint: "http://localhost:8000/bot"
```

2. **Run TGram**

```
tgram run
```

TGram will start **long polling Telegram** and forward updates to your local endpoint.

3. **Stop TGram**

```
CTRL+C
```

---

🛠 Example Workflow
------------------

[](#-example-workflow)

```
# Initialize config
tgram init

# Run bot
tgram run
```

Now any message sent to your bot will be received by your **local development server** at the endpoint you configured.

---

⚙️ Configuration Options
------------------------

[](#️-configuration-options)

- `token` – Telegram bot token.
- `endpoint` – Local URL where your bot script listens.

---

📊 How It Works
--------------

[](#-how-it-works)

```
Telegram Server → [Long Polling] → TGram CLI → Your Local Bot

```

1. Telegram sends updates → TGram CLI grabs them.
2. TGram forwards updates → Your local bot endpoint.
3. You can **debug, log, and test** locally.

---

Made with ❤️ by H O S S E I N

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance84

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~4 days

Total

3

Last Release

83d ago

Major Versions

v1.0.0 → v2.0.02026-02-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/c4aa13686d14a298fa445c11dbc7369bb2eb3e8d4bc07471305fafdedb29ad57?d=identicon)[iwh3n](/maintainers/iwh3n)

---

Top Contributors

[![iwh3n](https://avatars.githubusercontent.com/u/190838457?v=4)](https://github.com/iwh3n "iwh3n (62 commits)")

---

Tags

clicli-toolframeworklong-pollingopen-sourcepackagephptelegramtelegram-bottelegrambottelegrambotapitoolcliconsolebottelegram

### Embed Badge

![Health badge](/badges/iwh3n-tgram/health.svg)

```
[![Health](https://phpackages.com/badges/iwh3n-tgram/health.svg)](https://phpackages.com/packages/iwh3n-tgram)
```

###  Alternatives

[acquia/orca

A tool for testing a company's software packages together in the context of a realistic, functioning, best practices Drupal build

32902.4k](/packages/acquia-orca)[drupal/console-core

Drupal Console Core

13514.7M12](/packages/drupal-console-core)[seregazhuk/php-watcher

Automatically restart PHP application once the source code changes

394137.8k4](/packages/seregazhuk-php-watcher)[laminas/laminas-cli

Command-line interface for Laminas projects

563.7M54](/packages/laminas-laminas-cli)

PHPackages © 2026

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