Incursa Codex Telegram lets you talk to a local Codex CLI session from a private Telegram chat. It runs on your own machine, stores state locally, and only accepts messages from allowlisted Telegram users.
Use it when you want to start, steer, and inspect Codex work from your phone without exposing your whole machine to Telegram users.
Demo
Watch a two-minute private-chat demo showing a local Codex session controlled from Telegram with project selection, text prompts, and voice input.
For the available Telegram buttons and menus, see the menus and button reference.
Download
Download the latest release binary for your operating system:
| Platform | Download | Checksum |
|---|---|---|
| Windows x64 | codex-telegram-win-x64.exe | sha256 |
| Linux x64 | codex-telegram-linux-x64 | sha256 |
| macOS arm64 | codex-telegram-osx-arm64 | sha256 |
All releases are listed at GitHub Releases.
What You Need
Before starting, have these ready:
- A Telegram account.
- A Telegram bot token from
@BotFather. - A local Codex CLI installation that already works in a terminal.
- At least one local repository or workspace directory you want Codex to use.
- Optional: an OpenAI API key for voice-note transcription. Install
ffmpegonly if Telegram audio must be transcoded; Telegram voice notes commonly need it.
This app does not bundle Codex, Telegram credentials, or OpenAI credentials. If you use voice notes, any required audio transcoder must already exist on the machine running the bot.
For Codex CLI setup, use OpenAI's official Codex CLI docs.
Quick Start
Start by creating a Telegram bot, then follow the complete setup path for your operating system.
Create A Telegram Bot
In Telegram:
- Open a chat with
@BotFather. - Send
/newbot. - Choose a display name.
- Choose a username ending in
bot. - Copy the bot token.
Keep the token private. Anyone with the token can control the bot account.
Recommended BotFather settings for a first private-chat release:
- Use
/setdescriptionand/setabouttextto explain that this bot controls a local Codex installation. - Keep group joins disabled unless you intentionally want group support.
- Keep privacy mode enabled unless you intentionally need ordinary group text routed to Codex.
- Add commands later after the private-chat flow works.
Copy-paste BotFather text, command lists, and privacy recommendations are in BotFather setup.
BotFather gives you the bot token, but it cannot give you your personal Telegram user ID. On first run, Codex Telegram can validate the bot token, wait for one private message to the bot, and save your user ID automatically.
Windows
Use this path if the bot will run on Windows x64.
- Download
codex-telegram-win-x64.exeandcodex-telegram-win-x64.exe.sha256from the latest release. - Optional but recommended: verify the checksum before renaming or moving the file.
Get-FileHash .\codex-telegram-win-x64.exe -Algorithm SHA256 Get-Content .\codex-telegram-win-x64.exe.sha256
- Put the binary in a stable folder.
New-Item -ItemType Directory -Force C:\tools\codex-telegram | Out-Null Move-Item .\codex-telegram-win-x64.exe C:\tools\codex-telegram\codex-telegram.exe Set-Location C:\tools\codex-telegram
- Confirm Codex works locally before involving Telegram.
codex --version
codex- Start the setup menu from the app folder.
.\codex-telegram.exe- Complete the first-run wizard.
Use these values as a starting point:
Telegram bot token: <token from BotFather>
Telegram polling: enabled
Admin user ID: let the wizard capture it by sending one private Telegram message to the bot
Codex executable path: leave blank if codex is on PATH, otherwise set the full codex.exe path
Workspace root: C:\src
Default working directory: C:\src\your-repo
OpenAI transcription: only if you want voice notes
Local data root: leave blank unless you need a custom state folder
The app writes appsettings.Local.json beside the executable by default. Keep that file local and untracked. If you launch the app from another command-line directory later, it still uses the settings file in the app folder.
- Start normal operation with the menu skipped.
.\codex-telegram.exe --run
Keep that terminal open, or run the app under your preferred Windows service manager.
- In the private Telegram chat, run the first private Codex session.
/doctor
/projects
/project add C:\src\your-repo
/new release-demo
Summarize this repository and tell me the next safest setup check to run.
/tail
At this point you have a working private Telegram chat connected to a local Codex session.
Linux
Use this path if the bot will run on Linux x64.
- Download
codex-telegram-linux-x64andcodex-telegram-linux-x64.sha256from the latest release. - Or download both files directly with
curl.
curl -fL -o codex-telegram-linux-x64 https://github.com/incursa/codex-telegram/releases/latest/download/codex-telegram-linux-x64 curl -fL -o codex-telegram-linux-x64.sha256 https://github.com/incursa/codex-telegram/releases/latest/download/codex-telegram-linux-x64.sha256
- Optional but recommended: verify the checksum before renaming or moving the file.
shasum -a 256 -c ./codex-telegram-linux-x64.sha256
- Put the binary in a stable folder and mark it executable.
mkdir -p ~/tools/codex-telegram mv ./codex-telegram-linux-x64 ~/tools/codex-telegram/codex-telegram chmod +x ~/tools/codex-telegram/codex-telegram cd ~/tools/codex-telegram
- Confirm Codex works locally before involving Telegram.
codex --version codex
- Start the setup menu from the app folder.
./codex-telegram
- Complete the first-run wizard.
Use these values as a starting point:
Telegram bot token: <token from BotFather>
Telegram polling: enabled
Admin user ID: let the wizard capture it by sending one private Telegram message to the bot
Codex executable path: leave blank if codex is on PATH, otherwise set the full codex path
Workspace root: /home/you/src
Default working directory: /home/you/src/your-repo
OpenAI transcription: only if you want voice notes
Local data root: leave blank unless you need a custom state folder
The app writes appsettings.Local.json beside the executable by default. Keep that file local and untracked. If you launch the app from another command-line directory later, it still uses the settings file in the app folder.
- Start normal operation with the menu skipped.
./codex-telegram --run
Keep that terminal open, or run the app under systemd, tmux, screen, or another process supervisor.
- In the private Telegram chat, run the first private Codex session.
/doctor
/projects
/project add /home/you/src/your-repo
/new release-demo
Summarize this repository and tell me the next safest setup check to run.
/tail
At this point you have a working private Telegram chat connected to a local Codex session.
macOS
Use this path if the bot will run on Apple Silicon macOS.
- Download
codex-telegram-osx-arm64andcodex-telegram-osx-arm64.sha256from the latest release. - Or download both files directly with
curl.
curl -fL -o codex-telegram-osx-arm64 https://github.com/incursa/codex-telegram/releases/latest/download/codex-telegram-osx-arm64 curl -fL -o codex-telegram-osx-arm64.sha256 https://github.com/incursa/codex-telegram/releases/latest/download/codex-telegram-osx-arm64.sha256
- Optional but recommended: verify the checksum before renaming or moving the file.
shasum -a 256 -c ./codex-telegram-osx-arm64.sha256
- Put the binary in a stable folder and mark it executable.
mkdir -p ~/tools/codex-telegram mv ./codex-telegram-osx-arm64 ~/tools/codex-telegram/codex-telegram chmod +x ~/tools/codex-telegram/codex-telegram cd ~/tools/codex-telegram
- If macOS blocks the binary because it was downloaded from the internet, verify the checksum first. If you trust the release, remove the quarantine attribute.
xattr -d com.apple.quarantine ~/tools/codex-telegram/codex-telegram- Confirm Codex works locally before involving Telegram.
codex --version codex
- Start the setup menu from the app folder.
./codex-telegram
- Complete the first-run wizard.
Use these values as a starting point:
Telegram bot token: <token from BotFather>
Telegram polling: enabled
Admin user ID: let the wizard capture it by sending one private Telegram message to the bot
Codex executable path: leave blank if codex is on PATH, otherwise set the full codex path
Workspace root: /Users/you/src
Default working directory: /Users/you/src/your-repo
OpenAI transcription: only if you want voice notes
Local data root: leave blank unless you need a custom state folder
The app writes appsettings.Local.json beside the executable by default. Keep that file local and untracked. If you launch the app from another command-line directory later, it still uses the settings file in the app folder.
- Start normal operation with the menu skipped.
./codex-telegram --run
Keep that terminal open, or run the app under launchd, tmux, screen, or another process supervisor.
- In the private Telegram chat, run the first private Codex session.
/doctor
/projects
/project add /Users/you/src/your-repo
/new release-demo
Summarize this repository and tell me the next safest setup check to run.
/tail
At this point you have a working private Telegram chat connected to a local Codex session.
Voice Notes
Voice notes are optional. The bot downloads Telegram audio, transcribes it with OpenAI, shows the transcript, and sends only the transcribed text to the active Codex session. Codex does not receive raw Telegram audio.
Voice note requirements:
OpenAI:ApiKeyorOPENAI_API_KEY.- A transcription-capable
OpenAI:Model. ffmpegonly when the downloaded audio is not in a format OpenAI accepts directly. Telegram voice notes commonly arrive as OGG/OPUS, so installffmpegor configureOpenAI:FfmpegPathfor reliable voice-note support.
If ffmpeg is missing when a voice note needs conversion, the bot leaves the Codex session untouched and replies with setup guidance instead of failing silently.
Suggested first voice test:
Please review the current project and tell me the three most important setup risks. Keep it concise and do not edit files.
After a successful test, you should see the transcription in Telegram before the Codex response starts.
Day-To-Day Commands
| Command | Use |
|---|---|
/doctor |
Explain authorization, routing, active project/session, workspace roots, queue state, and next action. |
/help |
Show the built-in command summary. |
/whoami |
Show Telegram user, chat, and topic IDs for setup and troubleshooting. |
/projects |
List known local project directories. |
/project add <path> |
Add and select a repository or workspace. |
/project current |
Confirm the active project for this Telegram conversation. |
/new <name> |
Create and select a fresh Codex session. |
/sessions |
Show active and Telegram-managed sessions. |
/sessions all [count] |
Show older Codex history. |
/use <sessionId> |
Resume an existing session. |
/send <text> |
Send text when plain text is not automatically routed, especially in groups. |
/steer <text> |
Add guidance to a currently active turn. |
/queue |
View queued prompts for the conversation, then edit, delete, or send one now. |
/model |
Show or change the active session model. |
/thinking |
Show or change reasoning effort. |
/status |
Show active session status, including compact Codex usage when available. |
/usage |
Show five-hour and weekly Codex usage, with reset times. |
/tail [lines] |
Show recent output and keep following the session; defaults to 40 lines. |
/outbound |
Inspect delayed or batched Telegram output. |
/stop |
Gracefully stop a session. |
/restart confirm |
Show standalone-process restart guidance. |
/topic ... |
Manage forum-topic sessions in allowed supergroups. |
For a fuller operator guide, see docs/usage.md. For every command, parameter, and expected behavior, see docs/command-reference.md.
How Output Delivery Works
Telegram output is rate-limited and batched so active Codex sessions do not flood your chat.
Practical rules:
- Use
/tailbefore assuming Telegram scrollback contains the full transcript. - Use
/outboundif messages seem delayed. - Use
/usagewhen you need current five-hour and weekly Codex usage percentages and reset times. - Batched messages are concatenated with simple spacing and preserve multi-line content, including numbered lists and headings.
- If the local outbound buffer is compacted, the bot sends an explicit compaction notice.
- A final
~~ fin ~~marker means the turn reached a terminal event.
Local State And Safety
The app stores local state under CodexTelegram:Workspace:DataRoot. By default, that is the user's application data folder.
State includes:
projects.jsontelegram-state.json- Per-thread manifests
Secrets should stay in appsettings.Local.json, user secrets, environment variables, or another secret store. Secrets are not supposed to be written to the state files.
Security rules:
- Keep
TelegramBot:AllowedUserIdsnarrow. - Keep
TelegramBot:AllowedChatIdsempty unless you intentionally want group or forum-topic access. - Set explicit workspace roots and a default working directory before enabling polling.
- Review Codex sandbox and approval settings before exposing sensitive repositories.
- Rotate the BotFather token if it is exposed.
Supported Modes
Private chat is the primary supported operating mode and the recommended first setup path.
Groups and forum topics are available for advanced workflows, but they require:
- An allowed Telegram user.
- An allowed group chat ID.
- BotFather privacy settings that match the desired behavior.
- Topic-management rights if the bot should create forum topics.
Start privately first. Add groups only after the private flow works.
Support And Security
For general open-source project questions, contact oss@incursa.com.
For security issues, use GitHub private vulnerability reporting when it is enabled for this repository. If that is unavailable, contact security@incursa.com. Do not include secrets, private transcripts, exploit details, or local credential paths in public issues.
More Documentation
User and operator docs:
- Getting started guide
- Day-to-day usage
- Operations
- BotFather setup
- Command reference
- Menus and button reference
- Security
Developer and maintainer docs:

























