Install
openclaw skills install agent-codex-delegateUse when OpenClaw should delegate coding, repository analysis, file edits, test runs, or code review to the local Codex CLI without asking for or embedding an OpenAI API key. Invokes codex exec with existing ChatGPT/Codex CLI authentication and returns Codex's final output.
openclaw skills install agent-codex-delegateUse this skill when the user wants OpenClaw to hand a coding or repository task to Codex and receive a result back. It is meant for local, trusted operator setups where codex is already installed and signed in.
codex is installed on PATH.--cwd.exec for the wrapper script.If Codex is not authenticated, tell the operator to run codex or codex login once and complete the ChatGPT browser login. Do not request, print, copy, or inspect ~/.codex/auth.json.
Prefer the bundled wrapper:
{baseDir}/scripts/codex-delegate.sh --cwd /path/to/repo --prompt "summarize the repository and list the riskiest files"
For file creation or edits:
{baseDir}/scripts/codex-delegate.sh \
--cwd /path/to/repo \
--sandbox workspace-write \
--prompt "Create docs/architecture.md explaining the current service layout."
For machine-readable event logs while still returning the final Codex answer:
{baseDir}/scripts/codex-delegate.sh \
--cwd /path/to/repo \
--sandbox workspace-write \
--json-log .openclaw/codex-runs/last.jsonl \
--output .openclaw/codex-runs/last.md \
--prompt "Review the auth changes and fix any failing tests."
To pass CLI-style context:
npm test 2>&1 | {baseDir}/scripts/codex-delegate.sh \
--cwd /path/to/repo \
--sandbox workspace-write \
--prompt "Summarize the failing tests and make the smallest safe fix."
Use --prompt-file path when a generated prompt is already on disk. Use --stdin-file path when another tool wrote context to a file.
read-only for analysis, review, summaries, planning.workspace-write for creating or editing files in the repo.danger-full-access only on an isolated machine/container with explicit operator approval.--cwd.git diff --stat and relevant diffs before claiming files were changed.OPENAI_API_KEY, CODEX_API_KEY, or raw tokens to Codex. The wrapper unsets API-key env vars before invoking codex exec.~/.codex/auth.json.codex: command not found: ask the operator to install Codex CLI.codex login with ChatGPT sign-in, then retry.--skip-git-repo-check only for a deliberately isolated scratch workspace.--sandbox workspace-write only if file changes are intended.