Skip to main content

Telegram ACP bot

CI docs PyPI version Changelog Ruff ty License

A Telegram bot that implements the Agent Client Protocol to interact with AI agents.

Project documentation: https://mgaitan.github.io/telegram-acp-bot/

Status

This project is in alpha and under active development. Development has included extensive use of AI agents. Human and agents contributions are welcome.

Features

Some of the most useful capabilities are documented here:

Quick Start

Run directly without installing via uvx:

uvx telegram-acp-bot --help

Run the latest development version from git:

uvx git+https://github.com/mgaitan/telegram-acp-bot --help

Run the bot with a real ACP agent:

TELEGRAM_BOT_TOKEN=123456:abc \
ACP_AGENT_COMMAND="npx @zed-industries/codex-acp" \
uvx telegram-acp-bot

Current interaction capabilities:

  • /new [workspace], /resume [N|workspace], /session, /cancel, /stop, /clear, /restart [N [workspace]]
  • /mode [normal|compact|verbose] to switch the activity display per chat
  • Interactive permission prompts with inline buttons (Always, This time, Deny)
  • Plain text prompts
  • Image and document attachments from Telegram messages
  • ACP file:// resources are sent as attachments when they resolve to files inside the active workspace
  • Agent markdown output (with fallback to plain text when Telegram rejects entities)

Message flow:

  • The bot sends activity blocks while the prompt is running.
  • Activity display modes:
    • normal: separate activity messages, no streaming edits.
    • compact: one in-progress status message that becomes the final answer.
    • verbose: append-only in-place streaming for active reply text and tool activity.
  • Common labels are 💡 Thinking, ⚙️ Running, 📖 Reading, ✏️ Editing, ✍️ Writing, 🌐 Searching web, and 🔎 Querying.
  • Permission prompts for risky actions are sent as independent messages with inline buttons.
  • In normal, the final answer is sent as a separate message after activity blocks.
  • If the final text is empty, no dummy "(no text response)" message is sent.

For development, /restart stops polling and relaunches the process. If ACP_RESTART_COMMAND (or --restart-command) is configured, that command is used (recommended when running with uv run ... and extra flags). Otherwise, it falls back to re-execing the current process (sys.executable + sys.argv).

Telegram Bot Token

Create your token with @BotFather:

  1. Open BotFather and run /newbot.
  2. Choose a bot name and username.
  3. Copy the token returned by BotFather.

Store the token in your local .env file (gitignored):

At least one allowlist entry is required (TELEGRAM_ALLOWED_USER_IDS or TELEGRAM_ALLOWED_USERNAMES).

TELEGRAM_BOT_TOKEN=123456:abc
TELEGRAM_ALLOWED_USER_IDS=123456789
# TELEGRAM_ALLOWED_USERNAMES=alice,@bob
ACP_AGENT_COMMAND="npx @zed-industries/codex-acp"
ACP_RESTART_COMMAND="uv run telegram-acp-bot --telegram-token <TOKEN> --agent-command \"npx @zed-industries/codex-acp\""
ACP_PERMISSION_MODE=ask
ACP_PERMISSION_EVENT_OUTPUT=stdout
ACP_STDIO_LIMIT=8388608

Agent Command

Set ACP_AGENT_COMMAND to the ACP-compatible agent command you want the bot to run.

Example:

ACP_AGENT_COMMAND="npx @zed-industries/codex-acp"

To install the tool permanently:

uv tool install telegram-acp-bot

Development

  • Install dependencies with uv sync.
  • Then run uv run telegram-acp-bot
  • New dependency releases are delayed by one week via uv cooldown ([tool.uv].exclude-newer = "1 week"), with per-package overrides when required (for example, ty).
  • Run the QA bundle with ty:
uv run ty check

Metadata

Release files for telegram-acp-bot 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for telegram-acp-bot 0.3.0
File Size Uploaded Provenance
telegram_acp_bot-0.3.0.tar.gz 51.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for telegram-acp-bot 0.3.0
File Interpreter ABI Platform
telegram_acp_bot-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 117.5 kB

Release files / telegram_acp_bot-0.3.0.tar.gz

Download URL telegram_acp_bot-0.3.0.tar.gz
Size 51.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c25cb686def8071127d2265d5c5e0b1d56bbb406849ba461ca953db92da6b55a
BLAKE2b-256 checksum
How to use checksums
6638a689c802a43891cc5dc37184a1e7ab7b3246ceb074c0f179dec1c20c7941
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 30, 2026.

Transparency log

Release files / telegram_acp_bot-0.3.0-py3-none-any.whl

Download URL telegram_acp_bot-0.3.0-py3-none-any.whl
Size 65.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47a33dd41abfebeb97309ffd2268beeae4bb85050ebb3c739189be73a957711c
BLAKE2b-256 checksum
How to use checksums
7bc8dbe0a31fce7d158c6a094a3ef130478933b5b9514db9d9e20084d579ecce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 30, 2026.

Transparency log

Security for telegram-acp-bot 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for telegram_acp_bot-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page