跳到主要内容
知仓学习社ZHICANG

codex-delegation

Delegates tasks to the OpenAI Codex CLI (codex exec) via delegation-core. Use when delegation-core selects Codex or OpenAI credentials are already c…

不碰外部(只输出文字)无严重或高危命中athola/claude-night-market

它会碰到什么

扫了多少1 个文本文件,4 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

Table of Contents

  • [Overview](#overview)
  • [When To Use](#when-to-use)
  • [When NOT To Use](#when-not-to-use)
  • [Prerequisites](#prerequisites)
  • [Quick Start](#quick-start)
  • [Smart Delegation](#smart-delegation)
  • [Codex-Specific Details](#codex-specific-details)
  • [Exit Criteria](#exit-criteria)

Codex CLI Delegation

Overview

OpenAI's Codex CLI ships as npm @openai/codex and installs a codex

binary. Its headless entry point is codex exec, which takes the

prompt as a positional argument and reuses saved CLI credentials.

When To Use

  • delegation-core selected codex for the task
  • OpenAI credentials are already configured on the machine
  • The work suits a second opinion from a non-Anthropic, non-Google

model

When NOT To Use

  • The host is headless and codex login has never succeeded there.

See the login caveat below

  • The job checks out untrusted repository code. OpenAI's own docs warn

against exposing the key as a job-level environment variable in that

case

Prerequisites

Installation

npm install -g @openai/codex

Homebrew and a curl installer are also documented upstream.

Authentication

Either persist an API key or log in interactively:

printenv OPENAI_API_KEY | codex login --with-api-key

Verification runs codex login status, which reports one of "Logged

in using an API key", "Logged in using ChatGPT", "Logged in using

Agent Identity", or "Not logged in". The service uses that probe

rather than checking a single variable, because either credential

path is valid and only the probe sees both.

CODEX_API_KEY scopes a credential to a single codex exec run.

Quick Start

Using the shared delegation executor

uv run python scripts/delegation_executor.py codex "Explain this module" \
  --files src/

Through the Makefile

make -C plugins/conjure delegate-codex PROMPT='Explain this module'

Direct CLI usage

codex exec "Explain the retry logic in this package"

Smart Delegation

codex declares the code_execution strength and ranks behind gemini,

qwen, minimax, glm and muse in the candidate order. It declares no

model ids, so smart_delegate leaves model selection to the CLI.

Codex-Specific Details

| Property | Value |

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

| Binary | codex |

| Package | @openai/codex |

| Headless form | codex exec <prompt> |

| Prompt delivery | positional, stdin also supported |

| Version probe | codex --version |

| Auth probe | codex login status |

| Structured output | codex exec --json |

Login caveat worth knowing before scripting this: an open issue

(openai/codex#9253) reports that codex login fails outright on

headless hosts, over SSH or in containers, unless a workspace

administrator has separately enabled device-code auth. That is a

single reporter's account with no maintainer confirmation, but it is

the failure mode to check first when codex exec will not run

unattended. Persisting an API key beforehand avoids it.

Exit Criteria

  • [ ] codex resolves on PATH and answers codex --version
  • [ ] codex login status reports a logged-in state rather than "Not

logged in"

  • [ ] The built command is codex exec <prompt> with the prompt last

and no prompt flag before it

  • [ ] File context was inlined into the prompt
  • [ ] Output saved to delegations/codex/YYYYMMDD_HHMMSS.md
  • [ ] This skill ran because delegation-core selected codex

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。