Telegram bot bridge for codex app-server over stdio
Project description
telecodex
Telegram bot bridge for codex app-server over stdio JSON-RPC.
The bot receives Telegram messages, sends them to codex app-server, and replies back to Telegram chats.
Requirements
- Python 3.10+
- A Telegram bot token (from
@BotFather) codexCLI installed withcodex app-serveravailable
Install
uv sync --group dev
Configuration
By default, telecodex reads a platform-specific config path:
- macOS:
~/Library/Application Support/telecodex/config.toml - Linux:
~/.config/telecodex/config.toml - Windows:
%APPDATA%\\telecodex\\config.toml
Example:
[telecodex]
telegram_bot_token = "123456:ABC..."
allowed_chat_id = 123456789
# optional: enable ACP message logging
# acp_log_file = "/path/to/acp-messages.log"
codex_app_server_cmd = "codex app-server"
codex_model = "gpt-5"
codex_cwd = "."
codex_approval_policy = "never"
poll_timeout_seconds = 30
You can choose another config file with:
python3 -m telecodex --config /path/to/config.toml
Option precedence is:
- CLI flags
- Environment variables (
TELEGRAM_BOT_TOKEN,TELEGRAM_ALLOWED_CHAT_ID,TELECODEX_ACP_LOG_FILE,CODEX_*,POLL_TIMEOUT_SECONDS) - TOML config values
- Built-in defaults
allowed_chat_id (or TELEGRAM_ALLOWED_CHAT_ID) is mandatory, and the bot only replies to that chat id.
ACP/app-server message logging is disabled by default and is enabled only when acp_log_file (or TELECODEX_ACP_LOG_FILE) is set.
Run
# optional: create config.toml at the default platform-specific location shown above
python3 -m telecodex
Telegram commands
On startup, the bot registers Telegram commands:
/start: sendshelloto Codex to initialize/start the conversation turn/verbose: toggles an internal verbose flag (startsfalse)/status: shows latest stored ACP rate-limit values (account/rateLimits/updated)
When verbose mode is enabled, every ACP/app-server message that is not normally processed by the bridge is sent back to the allowed chat as raw JSON in Markdown.
Development
- Lint/format:
make lint - Lint check only:
make lint-check - Tests:
make test
Protocol flow
The bot uses the codex app-server JSON-RPC flow:
initializeinitialized(notification)thread/startturn/startfor each Telegram message- stream
item/agentMessage/delta - wait for
turn/completed
Project details
Release history Release notifications | RSS feed
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 telecodex-0.0.1.tar.gz.
File metadata
- Download URL: telecodex-0.0.1.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ec02dc42e370de782b10ed9e3cb0429d20f15630e7b56cd93488b99cfbf9dc3
|
|
| MD5 |
8b67ea6e0fa7bf035e15a213226dc7ba
|
|
| BLAKE2b-256 |
d6c5cc95848b224ade48420b00686cd441de5e440a0788d7d91f92150002158e
|
File details
Details for the file telecodex-0.0.1-py3-none-any.whl.
File metadata
- Download URL: telecodex-0.0.1-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91f914c9d1cb327b5424c1aa289a2379df575945b7dd9407cffdc67d8d99d1e4
|
|
| MD5 |
71e85e9f1e18aa9497d63600950abb1a
|
|
| BLAKE2b-256 |
b26aaef1468450a023cc66b8199bcedbe6254992f4598f12a67d29db376d92bd
|