A cleaner Windows release package for controlling codex app-server from Telegram.
This repo is organized so end users only need a few entry points at the root:
setup.cmdstart.cmdapprove-pair.cmdREADME.md
Everything else is grouped into src/ and scripts/.
- GitHub repo: chillinh/telegram-codex-bridge
- Releases: GitHub Releases
- Issues: GitHub Issues
- chat with Codex from Telegram
- optionally run a live local mirror console at the same time
- switch workspace, session, model, mode, and permission
- restart the runtime from Telegram
- pause the whole bridge with
/shutdownand resume it with/start - show account and quota status from Codex Manager
- switch Codex accounts from Telegram when Codex Manager data is available
- Windows
- Node.js 22 or newer
- Codex CLI installed and available as
codex - a Telegram bot token from @BotFather
Optional but recommended:
- Codex Manager
Required only for
/accounts,/switch_acc, and quota details in/status.
.
|-- approve-pair.cmd
|-- package.json
|-- README.md
|-- setup.cmd
|-- start.cmd
|-- scripts/
| |-- launch-console.cmd
| |-- register-startup-task.ps1
| |-- setup.ps1
| `-- start-bot.cmd
`-- src/
|-- codex-manager-electron-helper.js
|-- console-client.js
|-- index.js
`-- lib/
`-- codex-transport.js
This is the intended user flow:
- Double-click
setup.cmd - Paste the Telegram bot token when asked
- Let setup install dependencies and start the bot
- Open the bot in Telegram and send
/pair - Double-click
approve-pair.cmd - Paste the pairing code
- Send
/menuin Telegram and start using it
setup.cmd calls scripts/setup.ps1, which:
- checks that
node,npm, andcodexare installed - verifies Node.js 22+
- runs
npm install - asks for
TELEGRAM_BOT_TOKEN - saves the token in the current user's environment variables
- optionally starts the bridge immediately
First-run installer for normal users.
Starts the Telegram bridge through the restart wrapper.
Approves a Telegram pairing code. You can either:
- double-click it and paste the code
- or run
approve-pair.cmd ABC123
/start/menu/help/status/models/mode/permission/permission default/permission full_access/workspace/set_workspace D:\path\to\project/accounts/switch_acc 1/new_session/restart/stop/shutdown/pair
The bridge can open a second console window that mirrors runtime activity.
- set
ENABLE_LOCAL_MIRROR=1to auto-open it - or launch it manually with
.\scripts\launch-console.cmd - or keep it disabled for a cleaner background setup
When the mirror is running, you can:
- watch prompts coming from Telegram
- watch assistant replies
- inspect tool and activity events
- send prompts locally into the same runtime
/stopinterrupts only the current turn/shutdownpauses the whole bridge and blocks new prompts or mutating actions/startresumes the paused bridge and opens a fresh runtime session
default- approval policy: on-request
- sandbox: workspace write
full-access- approval policy: never
- sandbox: danger full access
The bridge accepts full_access, full-access, and full access.
Codex Manager is optional, but it unlocks:
/accounts/switch_acc- quota visibility inside
/status
Without Codex Manager, the core Telegram bridge still works.
Required:
TELEGRAM_BOT_TOKEN
Optional:
CODEX_HOMECODEX_TELEGRAM_BRIDGE_STATE_DIRENABLE_LOCAL_MIRRORCODEX_MIRROR_HOSTCODEX_MIRROR_PORTCODEX_MANAGER_STATE_PATHCODEX_MANAGER_ELECTRON_USER_DATA_DIRTELEGRAM_BRIDGE_ELECTRON_CLI
Wrapper defaults:
- state is stored in
.\.state - mirror auto-open is disabled with
ENABLE_LOCAL_MIRROR=0
setup.cmd already handles TELEGRAM_BOT_TOKEN for most users.
Optional:
powershell -ExecutionPolicy Bypass -File .\scripts\register-startup-task.ps1If you are preparing this folder as the public repository root:
git init
git branch -M main
git remote add origin https://github.com/chillinh/telegram-codex-bridge.git
git add .
git commit -m "Initial public release"
git push -u origin mainRecommended tag format:
v0.1.0v0.1.1v0.2.0
Typical release flow:
git add .
git commit -m "Release v0.1.0"
git push origin main
git tag v0.1.0
git push origin v0.1.0If you publish GitHub Releases from tags, keep the tag name aligned with the version in package.json.
- do not commit your Telegram bot token
- do not commit
.run/logs - do not commit local auth or state files
- Codex account payloads are not stored in this repo
- only paired Telegram users can control the bridge
This repo excludes:
node_modules/.run/.state/*.log.env*
Before publishing, verify:
- no token or private account data is hardcoded
- no local runtime logs or state files are included
- syntax still passes
node --check .\src\index.js
node --check .\src\console-client.js
node --check .\src\codex-manager-electron-helper.jsDu an nay dung de dieu khien codex app-server tren may Windows bang Telegram, va co the mo them local mirror neu ban muon theo doi session dang chay.
- Bam
setup.cmd - Nhap token Telegram bot
- De setup cai dependency va start bot
- Mo bot trong Telegram va gui
/pair - Bam
approve-pair.cmd - Dan ma pair vao cua so vua mo
- Gui
/menutren Telegram la dung duoc
/stop: chi dung turn dang chay/shutdown: tam dung toan bo bot/start: bat lai bot sau khi pause
- Bot khong tu mo mirror console nua, tru khi ban set
ENABLE_LOCAL_MIRROR=1 - Neu can, ban co the chay tay
.\scripts\launch-console.cmd - State mac dinh cua ban release duoc dat trong
.\.state
Khong bat buoc.
- Bat buoc:
Codex CLI - Khuyen dung them:
Codex Manager
Neu co Codex Manager, nguoi dung se co them:
/accounts/switch_acc- thong tin quota trong
/status
Repo du kien:
https://github.com/chillinh/telegram-codex-bridge
Format tag nen dung:
v0.1.0v0.1.1v0.2.0
Flow release co the dung:
git add .
git commit -m "Release v0.1.0"
git push origin main
git tag v0.1.0
git push origin v0.1.0/status: xem model, mode, permission, workspace, quota/accounts: xem danh sach account trong Codex Manager/switch_acc 1: doi account theo thu tu/permission default: quay ve che do can duyet/permission full_access: chuyen sang full access/set_workspace D:\project: doi thu muc lam viec/restart: restart runtime va tao session moi/shutdown: pause toan bo bot/start: resume bot sau khi pause
- Linh Bui
- GitHub: @chillinh
- Facebook: chillinh.page
- Email: chillinh.page@gmail.com
- Website:
chilling.page(coming soon)