Skip to main content

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

Project description

Telegram ACP bot

CI docs PyPI version Changelog Ruff 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 heavy active development.

Development has included extensive use of gpt-5.3-codex.

Quick Start

Run directly without installing via uvx:

uvx telegram-acp-bot --help

Run the latest development version from git:

uvx --from git+https://github.com/mgaitan/telegram-acp-bot 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]]
  • Interactive permission prompts with inline buttons (Always, This time, Deny)
  • Plain text prompts
  • Tool activity updates are sent as separate messages per ACP tool kind
  • 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.
  • Common labels are 💡 Thinking, ⚙️ Tool call, 📖 Reading, ✏️ Editing, and 🔎 Searching.
  • Permission prompts for risky actions are sent as independent messages with inline buttons.
  • 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

telegram_acp_bot-0.1.1.tar.gz (28.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

telegram_acp_bot-0.1.1-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

Details for the file telegram_acp_bot-0.1.1.tar.gz.

File metadata

  • Download URL: telegram_acp_bot-0.1.1.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for telegram_acp_bot-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0e9cea3cc4227a0528e647669139200c422924a8252cbf40f065884215d5ac70
MD5 e40f583ab2f2d1b9f230c6c4545cef4b
BLAKE2b-256 1e2dc9ebb2d17d9aa76c6ed2ff73c14b15f03f80ca087e0ffba48acb379131b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for telegram_acp_bot-0.1.1.tar.gz:

Publisher: cd.yml on mgaitan/telegram-acp-bot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file telegram_acp_bot-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for telegram_acp_bot-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a05693cf28a4c06ce0c89f2fcecc2bcdc7556cc40175eb6e854a105e66c10403
MD5 7aa56e69dc8a4f04bfdbf2eb000e78f0
BLAKE2b-256 6c291012cb59724fde6624e66205da525b5e79d0ec19f81b6b6f668e2fa5bd47

See more details on using hashes here.

Provenance

The following attestation bundles were made for telegram_acp_bot-0.1.1-py3-none-any.whl:

Publisher: cd.yml on mgaitan/telegram-acp-bot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page