OpenAI Codex CLI Meets Remote Control
OpenAI's Codex CLI provides terminal-based access to OpenAI's code generation models. As an Ink-based application, it receives the full benefit of Remocode's Ink-specific optimizations when accessed through via mode. This guide walks through the complete workflow for controlling Codex CLI remotely from Telegram.
Ink App Detection for Codex
Remocode automatically detects OpenAI Codex as an Ink application when you enter via mode. The detection enables:
- ●Clean output — Codex's terminal interface includes styled elements that look good in a terminal but are unreadable when sent as raw text to Telegram. Remocode strips ANSI codes, control characters, and UI chrome to deliver readable content.
- ●Smart input handling — Text is sent to Codex, followed by Enter after a 1-second pause. This timing accommodates Codex's Ink renderer.
- ●Retry on silence — If Codex does not produce output after your input, Remocode retries the Enter keypress at 8, 18, and 28 seconds.
Connecting to a Codex Session
Start Codex CLI in a named Remocode terminal, then connect from Telegram:
via codexTerminal output begins streaming to your Telegram chat immediately. You see what Codex is displaying, minus the visual formatting that only makes sense in a full terminal.
Codex's Interaction Patterns
Codex CLI has its own approach to user interaction. It may present options, ask for confirmation, or request additional context. Via mode handles all of these through direct text input.
When Codex presents options, type the number or text of your selection. When it asks yes/no questions, type your answer. For complex instructions, type the full request and let Remocode's smart typing deliver it properly.
Working With Codex Remotely
A practical session might look like this:
- ●Start Codex CLI with a task: generate a GraphQL schema and resolvers for a user management API.
- ●Leave your machine and connect from your phone:
via codex - ●Codex begins generating the schema. It asks about authentication strategy. Type: "JWT with refresh tokens, store refresh tokens in Redis."
- ●Codex continues generating resolvers. You see the output streaming. It asks about pagination: "cursor-based or offset?" Type: "cursor-based."
- ●Codex generates test files. A test depends on a mock that does not exist yet. You see the error in the stream. Type: "create the mock file at src/mocks/redis.ts with a basic in-memory implementation."
- ●Codex generates the mock and reruns tests. Everything passes.
- ●
!exitto disconnect.
Monitoring Without Interaction
Not every Codex session requires active via mode. For tasks where Codex is unlikely to need input, use passive monitoring:
- ●Question detection automatically forwards any questions Codex asks, with appropriate buttons.
- ●Error alerts notify you if Codex encounters runtime errors, test failures, or build problems.
- ●Status checks via
status codexgive you AI-generated progress summaries on demand.
Reserve via mode for sessions where you expect interactive input needs, or when an alert or question notification prompts you to investigate.
Using Escape Commands
While connected to Codex via via mode, escape commands let you interact with Remocode without sending text to Codex:
!status — Progress summary
!peek — Check for unsubmitted input
!submit — Send Enter keypress
!reply_5 — Last 5 AI responses
!exit — Disconnect from via modeThese are essential for maintaining awareness of the session state without disrupting Codex's workflow.
Codex-Specific Considerations
Codex CLI's response timing can vary based on the complexity of the generation task and the model being used. Simple completions return quickly. Complex multi-file generation tasks may take longer, with periods of apparent inactivity while the model processes.
During these quiet periods, the via mode stream will be silent. This is normal. Do not assume your input was lost — check with !peek if you sent something and are not seeing a response after 30 seconds.
Combining Codex With Other Agents
A powerful workflow uses multiple AI agents in parallel, each in their own Remocode terminal:
- ●Codex generating new code in terminal "codex"
- ●Claude Code reviewing and refactoring in terminal "claude"
- ●Gemini CLI writing documentation in terminal "gemini"
From Telegram, you manage all three using terminal names, switching between via sessions and using status commands to keep track of each agent's progress. Remocode's question detection and error alerts keep you informed across all sessions simultaneously.
This multi-agent approach maximizes the benefits of remote terminal control. While any single agent might need your input every few minutes, the combination keeps all of them productive with minimal phone interaction time.
Ready to try Remocode?
Start with a 7-day Pro trial — no credit card required. Download now and start coding with AI from anywhere.
Download Remocodefor macOS