OpenAI Codex CLI Automation with it2
it2 allows you to manage and drive OpenAI Codex CLI (@openai/codex) sessions in dedicated iTerm2 panes.
Overview
Running Codex CLI inside it2-managed split panes enables:
- Dedicated Worker Panes: Keep Codex active in a side-by-side pane for code generation or test writing.
- Session Identification: Label sessions with
it2 session badge setandit2 session title set. - Programmatic Task Dispatch: Dispatch interactive or non-interactive (
codex exec) commands viait2 session send-text.
Quick Start
Launch Codex in a dedicated split pane:
#!/usr/bin/env bash
# Illustrative Fragment: Launch Codex CLI in a split pane
# 1. Create a vertical split pane
SESSION_ID=$(it2 session split --vertical --quiet)
# 2. Set a badge on the new session
it2 session badge set "Codex" "$SESSION_ID"
# 3. Launch Codex CLI in the pane
it2 session send-text "$SESSION_ID" "codex 'Add unit tests for auth package'"
Non-Interactive Task Dispatch (codex exec)
Execute a non-interactive task in a background split pane:
#!/usr/bin/env bash
# Illustrative Fragment: Non-interactive codex exec
SESSION_ID=$(it2 session split --horizontal --quiet)
it2 session send-text "$SESSION_ID" "codex exec 'Generate SQL migration for users table'"
Related Documentation
- Quick Start — Core
it2CLI commands. - Automate Claude Code — Claude Code integration details.
- Automate Gemini CLI — Google Gemini CLI integration details.