Telegram bot that proxies your local Codex CLI input/output.
/project <path>sets the working directory/clearclears the current session and project/resume <id|index>sets the current Codex session id/newstarts a fresh Codex session on the next message/continueshows the current session id/statusshows current settings
npm install
cp .env.example .envFill in .env:
TELEGRAM_BOT_TOKENALLOWED_USER_IDS(comma-separated)CODEX_CMDandCODEX_ARGSif needed
Run:
npm run dev- The bot runs
codex exec resume --lastby default (non-interactive). - If your Codex CLI prints a session id, set
CODEX_SESSION_REGEXto auto-capture it. - Default mode is
CODEX_MODE=exec, which avoids TTY issues and uses Codex's built-in session resume. - If you switch to
CODEX_MODE=interactive, keepCODEX_USE_PTY=trueandCODEX_USE_SCRIPT=trueto emulate a TTY. - Use
PROMPT_PREFIXto steer Codex responses (for example, avoid mentioning sandboxes).
Build once, then install:
npm run build
./scripts/launchctl/install.shStop/remove:
./scripts/launchctl/uninstall.shLogs:
~/.codexgram/logs/codexgram.out.log~/.codexgram/logs/codexgram.err.log