Skip to main content

telecodex

ci test codecov PyPI pyversions Current version on PyPI

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)
  • codex CLI installed with codex app-server available

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:

  1. CLI flags
  2. Environment variables (TELEGRAM_BOT_TOKEN, TELEGRAM_ALLOWED_CHAT_ID, TELECODEX_ACP_LOG_FILE, CODEX_*, POLL_TIMEOUT_SECONDS)
  3. TOML config values
  4. 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: sends hello to Codex to initialize/start the conversation turn
  • /verbose: toggles an internal verbose flag (starts false)
  • /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:

  1. initialize
  2. initialized (notification)
  3. thread/start
  4. turn/start for each Telegram message
  5. stream item/agentMessage/delta
  6. wait for turn/completed

Metadata

Release files for telecodex 0.0.1

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

Source distribution (sdist)

Source distribution for telecodex 0.0.1
File Size Uploaded
telecodex-0.0.1.tar.gz 11.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for telecodex 0.0.1
File Interpreter ABI Platform
telecodex-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.0 kB

Release files / telecodex-0.0.1.tar.gz

Download URL telecodex-0.0.1.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1ec02dc42e370de782b10ed9e3cb0429d20f15630e7b56cd93488b99cfbf9dc3
BLAKE2b-256 checksum
How to use checksums
d6c5cc95848b224ade48420b00686cd441de5e440a0788d7d91f92150002158e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Release files / telecodex-0.0.1-py3-none-any.whl

Download URL telecodex-0.0.1-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
91f914c9d1cb327b5424c1aa289a2379df575945b7dd9407cffdc67d8d99d1e4
BLAKE2b-256 checksum
How to use checksums
b26aaef1468450a023cc66b8199bcedbe6254992f4598f12a67d29db376d92bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

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