Loading...
Loading...
Run Codex CLI /review via tmux to review uncommitted changes. Launches Codex in isolated tmux session, sends /review command, selects option 2, captures output. Use when you want a second opinion on uncommitted code changes.
npx skill4agent add alexatmtit/custom-skills codex-review/reviewtmuxcodexSOCKET="${TMPDIR:-/tmp}/codex-review-$$.sock"
SESSION="codex-review-$$"
tmux -S "$SOCKET" new-session -d -s "$SESSION"# Launch codex
tmux -S "$SOCKET" send-keys -t "$SESSION" "codex" Enter
# Wait for codex to initialize
sleep 5
# Type /review command
tmux -S "$SOCKET" send-keys -t "$SESSION" -l "/review"
# Press Enter to execute the /review command
tmux -S "$SOCKET" send-keys -t "$SESSION" Enter
# Wait for menu to appear
sleep 2
# Select option 2: Review uncommitted changes (no Enter needed)
tmux -S "$SOCKET" send-keys -t "$SESSION" -l "2"wait_for_completion() {
local timeout=3600 interval=60 elapsed=0
while [ $elapsed -lt $timeout ]; do
output=$(tmux -S "$SOCKET" capture-pane -p -t "$SESSION" -S -100)
# Check for completion (shell prompt returned)
if echo "$output" | grep -qE '(❯|\$|>>>)\s*$'; then
return 0
fi
sleep $interval
elapsed=$((elapsed + interval))
done
return 1
}
wait_for_completion# Capture full pane output (last 500 lines)
tmux -S "$SOCKET" capture-pane -p -t "$SESSION" -S -500tmux -S "$SOCKET" kill-session -t "$SESSION"
rm -f "$SOCKET"tmux -S "$SOCKET" attach -t "$SESSION"Ctrl+b d