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:

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'"