A Telegram bot that implements Agent Client Protocol to interact with AI agents
Project description
Telegram ACP bot
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.
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:
- Open BotFather and run
/newbot. - Choose a bot name and username.
- 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
uvcooldown ([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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file telegram_acp_bot-0.2.0.tar.gz.
File metadata
- Download URL: telegram_acp_bot-0.2.0.tar.gz
- Upload date:
- Size: 39.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23eaa14a863b31a68885d8eaeda0b8ecaae3daa01199592d42931477721c2903
|
|
| MD5 |
3be3853e69fee859119014c625dae5c5
|
|
| BLAKE2b-256 |
33a02114554fce07c365886cfbbef12177a80159546161736accc3fe1e117344
|
Provenance
The following attestation bundles were made for telegram_acp_bot-0.2.0.tar.gz:
Publisher:
cd.yml on mgaitan/telegram-acp-bot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
telegram_acp_bot-0.2.0.tar.gz -
Subject digest:
23eaa14a863b31a68885d8eaeda0b8ecaae3daa01199592d42931477721c2903 - Sigstore transparency entry: 1195633993
- Sigstore integration time:
-
Permalink:
mgaitan/telegram-acp-bot@ee9d97390ae5bcacfe10d40ae1210405ce639709 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/mgaitan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@ee9d97390ae5bcacfe10d40ae1210405ce639709 -
Trigger Event:
release
-
Statement type:
File details
Details for the file telegram_acp_bot-0.2.0-py3-none-any.whl.
File metadata
- Download URL: telegram_acp_bot-0.2.0-py3-none-any.whl
- Upload date:
- Size: 46.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b386eea0a4bf62e3f2b5e716560a1f2ea1eddfbbf7a66e6c97bb0d0f42d497c
|
|
| MD5 |
cb5bf7b062bb675528b58ca79c03646e
|
|
| BLAKE2b-256 |
7626322e2a9bbf479d60b7a7fca7d8d146c75eb8be46c771e7c00a6ba0d41f93
|
Provenance
The following attestation bundles were made for telegram_acp_bot-0.2.0-py3-none-any.whl:
Publisher:
cd.yml on mgaitan/telegram-acp-bot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
telegram_acp_bot-0.2.0-py3-none-any.whl -
Subject digest:
8b386eea0a4bf62e3f2b5e716560a1f2ea1eddfbbf7a66e6c97bb0d0f42d497c - Sigstore transparency entry: 1195633995
- Sigstore integration time:
-
Permalink:
mgaitan/telegram-acp-bot@ee9d97390ae5bcacfe10d40ae1210405ce639709 -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/mgaitan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@ee9d97390ae5bcacfe10d40ae1210405ce639709 -
Trigger Event:
release
-
Statement type: