Control the macOS Codex App from Telegram by mapping Codex App threads to Telegram forum topics.
This project is a local plugin plus a local gateway daemon:
- Codex App provides the thread and project surface.
- Telegram provides the remote chat UI.
- This gateway binds each Codex App thread to one Telegram topic and keeps messages flowing in both directions.
Codex App is strongest on the desktop, but remote monitoring and steering are awkward when you step away from your Mac. Telegram topics solve the remote-control side well, but only if the bridge understands Codex App projects, Codex App threads, and Codex plugin installation.
This repository packages that bridge so you can:
- see Codex App projects and threads in Telegram topics
- send thread messages from Telegram and receive Codex replies back in the same topic
- configure and operate the gateway with a normal CLI
- run the gateway directly or as a macOS
launchdservice - install the plugin into Codex App through a local marketplace entry instead of manual JSON editing
The system has three parts:
- The plugin bundle, which Codex App loads from a local marketplace entry.
- The local gateway runtime, which polls Telegram and talks to Codex App.
- The operator CLI, which installs, configures, updates, starts, stops, and services the runtime.
Default managed paths:
- Install root:
~/.codex-telegram-plugin - Runtime home:
~/.codex-telegram - Managed env file:
~/.codex-telegram/.env - Personal plugin marketplace:
~/.agents/plugins/marketplace.json - macOS launch agent:
~/Library/LaunchAgents/com.kangmo.codex-telegram-gateway.plist
Run the one-line installer:
curl -fsSL https://raw.githubusercontent.com/Kangmo/Codex-Telegram-Plugin/main/install/install.sh | shThe installer will:
- Clone or refresh the managed checkout in
~/.codex-telegram-plugin - Create
~/.codex-telegram-plugin/.venv - Install the package into that venv
- Prompt for:
- Telegram bot token
- numeric user ID
- group chat ID
- Register the plugin in your personal Codex plugin marketplace
After that:
- Restart Codex App.
- Open
Pluginsin Codex App. - Look for the local marketplace named
Codex Local Plugins. - Install or enable
codex-telegram-gateway. - Start the gateway runtime:
~/.codex-telegram-plugin/.venv/bin/codex-telegram-gateway startOr install it as a service:
~/.codex-telegram-plugin/.venv/bin/codex-telegram-gateway service install- Open Telegram and start a chat with @BotFather.
- Run
/newbot. - Choose a bot name and username.
- Copy the bot token.
In BotFather, configure the bot so the gateway can work in forum topics:
- Enable group usage for the bot.
- Turn
Privacy Modeoff so the bot can see topic messages in the group. - Make sure
Topicssupport is enabled when BotFather offers that setting.
- Create a normal Telegram group.
- Convert or configure it as a topic-enabled group.
- Enable
Topicsin the group settings. - Add your bot to that group.
- Promote the bot to admin if you want it to create or rename topics automatically.
Recommended admin permissions:
- manage topics
- delete messages
- pin messages
You need:
- the bot token
- your numeric user ID
- the group chat ID
Ways to get them:
- numeric user ID:
- ask @userinfobot, or
- use another ID bot that reports your numeric user ID
- group chat ID:
- ask a bot such as @RawDataBot, or
- use a Telegram ID bot inside the group and copy the group chat ID
The installer asks for all three values directly.
The installer already registers this plugin in your personal marketplace. Codex App still needs to load it.
Restart after the installer or after codex-telegram-gateway update.
In Codex App:
- Open
Plugins. - Find the marketplace named
Codex Local Plugins. - Install or enable
codex-telegram-gateway.
If the plugin does not appear:
~/.codex-telegram-plugin/.venv/bin/codex-telegram-gateway plugin statusIf needed, re-register it:
~/.codex-telegram-plugin/.venv/bin/codex-telegram-gateway plugin installThen restart Codex App again.
The installed operator CLI is:
~/.codex-telegram-plugin/.venv/bin/codex-telegram-gatewayInteractive first-time setup:
codex-telegram-gateway installReconfigure later:
codex-telegram-gateway configure
codex-telegram-gateway configure --group-chat-id -1001234567890Register the plugin entry:
codex-telegram-gateway plugin installCheck marketplace status:
codex-telegram-gateway plugin statusStart the local daemon:
codex-telegram-gateway startStop it:
codex-telegram-gateway stopRestart it:
codex-telegram-gateway restartShow runtime and install summary:
codex-telegram-gateway statusShow recent logs:
codex-telegram-gateway logsInstall and bootstrap the launchd service:
codex-telegram-gateway service installStop the service:
codex-telegram-gateway service stopStart it again:
codex-telegram-gateway service startRestart it:
codex-telegram-gateway service restartCheck service status:
codex-telegram-gateway service statusRemove the service:
codex-telegram-gateway service uninstallRefresh the managed checkout from its git origin:
codex-telegram-gateway updateThis command will:
- Read the installed checkout's git
origin - Clone a fresh copy
- Sync it into the managed install root
- Preserve
.gitand.venv - Re-run
pip install -e - Refresh the local plugin marketplace entry
After codex-telegram-gateway update, restart Codex App so the plugin cache reloads the new version.
curl -fsSL https://raw.githubusercontent.com/Kangmo/Codex-Telegram-Plugin/main/install/install.sh | sh
~/.codex-telegram-plugin/.venv/bin/codex-telegram-gateway service installThen restart Codex App and enable the plugin from Plugins.
~/.codex-telegram-plugin/.venv/bin/codex-telegram-gateway configure~/.codex-telegram-plugin/.venv/bin/codex-telegram-gateway start
~/.codex-telegram-plugin/.venv/bin/codex-telegram-gateway status
~/.codex-telegram-plugin/.venv/bin/codex-telegram-gateway logs
~/.codex-telegram-plugin/.venv/bin/codex-telegram-gateway stop~/.codex-telegram-plugin/.venv/bin/codex-telegram-gateway service install
~/.codex-telegram-plugin/.venv/bin/codex-telegram-gateway service status~/.codex-telegram-plugin/.venv/bin/codex-telegram-gateway updateThen:
- Restart Codex App
- Reopen
Plugins - Confirm the plugin is still enabled
Managed files are split intentionally:
- source checkout:
~/.codex-telegram-plugin
- runtime state:
~/.codex-telegram/.env~/.codex-telegram/gateway.db~/.codex-telegram/toolbar.toml~/.codex-telegram/logs/gateway.log~/.codex-telegram/run/gateway.pid
This keeps updates from overwriting your runtime configuration and local state.
- Run:
codex-telegram-gateway plugin status- Confirm the marketplace entry exists under
Codex Local Plugins - Restart Codex App
- Open
Pluginsagain
- Run:
codex-telegram-gateway status
codex-telegram-gateway logs- Confirm
~/.codex-telegram/.envexists - Confirm the bot token, numeric user ID, and group chat ID are correct
- Run:
codex-telegram-gateway service status
codex-telegram-gateway logs- If needed:
codex-telegram-gateway service restartRun:
codex-telegram-gateway updateThen fully restart Codex App. Local plugins are cached by Codex App, so the app restart matters.