apply command takes the most recent diff generated by the Codex agent and applies it to your local working tree using git apply.
Usage
Description
When Codex generates code changes during an interactive session, it produces a diff that can be applied to your files. Theapply command:
- Finds the latest diff from your most recent Codex session
- Applies it to your local working tree using
git apply - Reports any conflicts or issues
- Apply changes after reviewing them in the TUI
- Quickly accept Codex’s proposed changes
- Integrate Codex changes into your current work
Examples
Basic Usage
Apply the latest diff from your most recent session:Exit Codes
0- Diff applied successfully1- Error applying diff (conflicts, file not found, etc.)
Related Commands
codex
Run interactive Codex session
codex exec
Run non-interactive execution