Codex cli

From samirpatil2000/skills · View interactive version

Codex cli is an AI agent skill from the GitHub repository samirpatil2000/skills. Delegate tasks to the locally installed Codex CLI (`codex exec`). Supports reasoning tiers (low to ultra), native image generation, vision input (-i), structured JSON output, and sandboxed execution.

How to use this skill

Skill file

Codex CLI Delegation

Delegate execution to OpenAI Codex CLI (codex exec). Non-interactive only.

1. Execution Tiers

| Tier | Task | Model | Effort Flag |

|---|---|---|---|

| Fast | Quick scripts, syntax, small edits | gpt-6-astra | -c model_reasoning_effort="low" |

| Standard | Everyday features, debugging | gpt-6-astra | -c model_reasoning_effort="medium" |

| Ultra | Complex architecture, multi-agent logic | gpt-6-astra | -c model_reasoning_effort="ultra" |

2. Recipes

Plain Query / Code Gen (Clean Output to File)

codex exec "PROMPT" --skip-git-repo-check --ephemeral --color never -s read-only -o output.txt

For deep/ultra reasoning runs or background logging, pipe through tee to avoid block-buffering:

codex exec "PROMPT" -c model_reasoning_effort="ultra" --skip-git-repo-check --ephemeral --color never -s read-only | tee output.txt

Structured JSON Output (Strict Schema)

Outputs clean JSON directly to stdout (metadata headers route to stderr).

Note: OpenAI Strict Outputs require "additionalProperties": false on objects.

codex exec "PROMPT" --output-schema schema.json --skip-git-repo-check --ephemeral -s read-only

Parse JSON Output Inline

codex exec "PROMPT" --output-schema schema.json --skip-git-repo-check --ephemeral -s read-only \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['key'])"

Apply Edits Directly to Project

codex exec "PROMPT" --skip-git-repo-check --ephemeral -s workspace-write --cd /path/to/project

Generate Image (Native Image Tool / ChatGPT)

codex exec "Generate an image of [DESCRIPTION] and save it as [PATH/TO/IMAGE.png]" \
  --skip-git-repo-check --ephemeral -s workspace-write --cd "$(pwd)"

Vision Input (Analyze Screenshot / Image)

codex exec "Review this UI screenshot and implement the HTML/CSS" \
  -i /path/to/screenshot.png --skip-git-repo-check --ephemeral -s read-only

Stdin Pipe

cat file.py | codex exec "Review this code" --skip-git-repo-check --ephemeral -s read-only -

3. Rules & Handling

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.