codex-anywhere
v0.4.2
Published
Telegram-native Codex client for background use anywhere
Maintainers
Readme
Codex Anywhere
Codex Anywhere is a Telegram-native client for codex, so you can use Codex anywhere, anytime with session continuity, native Codex commands, featured /goal support, and first-class Oh-My-Codex workflows. Install it as a background service to operate native Codex from Telegram at your fingertips anywhere, anytime, 24/7, with no extra API key.
Prerequisites
- codex installed and signed in
- A Telegram bot token from @BotFather
Quick Start
1. Install
npm install -g codex-anywhereCheck the installed CLI version with:
codex-anywhere --version2. Create a Telegram bot
Open @BotFather in Telegram, send /newbot, and follow the prompts.
Copy the bot token for the next step.
3. Connect
codex-anywhere connectTelegram bot token (from BotFather): <paste your token here>
Workspace path for Codex tasks [/current/dir]: ← press Enter to acceptThe workspace defaults to the folder where you run connect.
Add another Telegram bot
codex-anywhere add-botUse this when you want another bot pointed at another workspace.
4. Install the background service
codex-anywhere install-serviceThis registers a LaunchAgent (macOS) so the bot starts at login and keeps running when the terminal closes.
On Linux, it installs a user-level systemd service.
5. Open Telegram and send /start
Your bot is ready. Try /help to see available commands, or just send a task to begin.
Usage
Send a task to start a new Codex session, or use these commands:
/newstarts fresh/resumecontinues a session from the current workspace/continuebrowses sessions from all workspaces/reloadrefreshes the current session/goalshows or changes the current goal/accountshows, signs in, switches, or signs out of Codex/download <path>sends a workspace file back to Telegram/upgradeupdates Codex Anywhere and relaunches the service/upgrade testverifies that the supervised restart helper can run/escstops the active turn
You can also send screenshots, photos, and files. Text files such as .txt, .log, .json, and .crash are sent as readable text so Codex can inspect them directly.
While a turn is running, Telegram keeps progress and run details compact. When Codex finishes, the final answer is sent as a new message that quotes your original request, so it is easy to find and triggers normal Telegram notifications. Queued turns also quote the request they belong to.
Download files from the workspace
Use /download <path> to send files created by Codex back to Telegram. Paths must stay inside the configured workspace or /tmp.
/download <path> choose the best Telegram format automatically
/download file <path> send as a file
/download photo <path> send an image as a Telegram photo
/download zip <path> send a file or folder as a zip archive
/download list [path] list files
/download info <path> show file detailsFor Oh-My-Codex, send $deep-interview, $autopilot, or other skills directly in chat. Use /omx <args> for OMX commands.
For Computer Use, send /computer <task>. Enable Computer Use in the Codex app first.
Service Management
codex-anywhere restart-service
codex-anywhere service-status
codex-anywhere uninstall-serviceLogs are written to logs/ under the Codex Anywhere storage root (CODEX_ANYWHERE_HOME).
Upgrade status is recorded there too: upgrade-state.json, upgrade-events.jsonl, and upgrade-restart.log.
Telegram Commands
| Command | Description |
|---|---|
| /status | Show current thread and model settings |
| /version | Show the installed Codex Anywhere version |
| /workspace <path> | Show or change the bot workspace |
| /addbot | Add another Telegram bot |
| /resume | Continue a session in this workspace |
| /continue [session-id] | Continue from any workspace |
| /reload | Refresh the current session |
| /account [status\|login\|switch\|logout] | Manage Codex sign-in |
| /goal [status\|set <objective>\|clear] | Manage the current goal |
| /download [auto\|file\|photo\|zip\|list\|info] <path> | Send workspace files to Telegram |
| /upgrade | Upgrade Codex Anywhere |
| /upgrade test | Test the upgrade restart helper without installing |
| /omx [args] | Run Oh-My-Codex commands |
| /computer <task> | Use Computer Use |
| /interrupt, /esc | Interrupt the active turn |
| /cancel | Cancel the active prompt or picker |
Many native Codex slash commands also work from Telegram, including /model, /fast, /permissions, /sandbox, /review, /rename, /fork, /compact, /clear, /diff, /mention, /skills, /mcp, /apps, /plugins, /verbose, /logout, and /stop.
Development
Clone and install:
git clone https://github.com/Mempat-AI/codex-anywhere
cd codex-anywhere
pnpm install
pnpm run connect # runs directly from src/ via tsx
pnpm run add-bot # appends a new bot definition to configRun checks:
pnpm run test
pnpm run typecheck
pnpm run buildTests are local and do not require Telegram, Codex, OMX, or network access.
Contributing
Use pull requests for all changes.
Repository policy:
- PR title gate
- CI gate
- squash merge only
See CONTRIBUTING.md for contribution rules.
Notes
- Single-user (for now), private chats only
codexmust be installed and authenticated before setup- Config and state live under the user config directory or
CODEX_ANYWHERE_HOME - Background services support macOS LaunchAgent and Linux user-level
systemd
Not affiliated with OpenAI.
Built with 💡 in Singapore.
