← 返回 Skills 市场
minchocoin

codex-cli-exec

作者 minchoCoin · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
109
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install codex-cli-exec
功能描述
Explain how Openclaw should use Codex CLI as a non-interactive coding engine. Use when Codex needs to document or answer questions about installing Codex CLI...
使用说明 (SKILL.md)

Openclaw Codex CLI

Overview

Use this skill to give short, practical instructions for codex-cli in Openclaw contexts. Keep answers concise and command-focused. For Openclaw integrations, prefer codex exec because Openclaw should call Codex non-interactively rather than trying to type into the interactive TUI.

Core Commands

Use these as the default examples:

npm install -g @openai/codex
codex --version
codex login
codex login --device-auth
codex exec "\x3Cprompt>"

Mention codex "\x3Cprompt>" only when the user explicitly wants a human-driven interactive session.

Install and Update

When asked about installation or update:

  • Install with npm install -g @openai/codex.
  • Check the version with codex --version.
  • Update with the same package manager used for installation.
  • If codex is not found, tell the user to check PATH and restart the terminal.

Login

When asked about login:

  • Use codex login for the standard login flow.
  • Use codex login --device-auth when device authentication is preferred.
  • If needed, API key auth can be used with OPENAI_API_KEY.
  • The user must complete the sign-in flow.
  • If login succeeds and codex works normally, the user does not need to log in again on every launch.
  • Log in again only if the session expires, credentials are cleared, or the CLI asks for authentication.

Examples:

codex login
codex login --device-auth
printenv OPENAI_API_KEY | codex login --with-api-key
codex login status

Authentication Errors

If codex exec returns 401 unauthorized or 500 internal server error, tell the user to reset authentication and log in again.

Use this recovery flow:

codex logout
codex login --device-auth

After login, run the codex exec command again.

Openclaw Integration Style

Use this distinction clearly:

  • Preferred for Openclaw integration: codex exec "\x3Cprompt>"
  • Interactive only when a human wants to work directly in the Codex UI: codex "\x3Cprompt>"

For Openclaw, prefer codex exec because the default Codex CLI interface is interactive and not ideal for another tool to control by typing into the chat window.

Use codex exec when Openclaw needs to send a task programmatically as a one-off run.

Workspace Folder

Recommend creating a dedicated workspace folder for each Openclaw task or project.

Use this guidance:

  • Run Codex inside a dedicated workspace directory.
  • Keep project files, generated files, and temporary outputs inside that workspace.
  • Prefer workspace-write style execution in that workspace.
  • If the workspace is not a git repository, add --skip-git-repo-check.
  • Use --cd to point Codex at the intended working directory.
  • Use --add-dir when Openclaw must allow writes in additional directories.

This makes file scope clearer and reduces the risk of changing unrelated files.

Examples:

codex exec --cd /path/to/workspace "\x3Cprompt>"
codex exec --cd /path/to/app --add-dir /path/to/shared "\x3Cprompt>"

Git Repository Check

If the target directory is not a git repository, mention --skip-git-repo-check.

Use this when Openclaw needs to run Codex in a folder that does not contain a .git directory.

Example:

codex exec --skip-git-repo-check "\x3Cprompt>"

Trust and Approvals

Explain these briefly:

  • Trust this folder: use for a known safe Openclaw workspace.
  • Allow once: use when the user wants one-time approval.
  • Always allow: use only for safe, repeatable command patterns.

Preferred guidance:

  • Trust only known folders.
  • Prefer Allow once when unsure.
  • Use Always allow carefully.

Approval and Sandbox Options

Mention these options when the user asks how Codex should run commands:

  • -a, --ask-for-approval: controls when Codex asks for approval before running commands.
  • -s, --sandbox: controls how restricted command execution is.
  • --full-auto: convenience mode for lower-friction automatic execution.
  • --skip-git-repo-check: skips the git repository check when the folder is not tracked by git.

Use this practical guidance:

  • For Openclaw, prefer safer settings first.
  • Use -a on-request when approvals should be requested as needed.
  • Use -a never only when the environment is already controlled and non-interactive execution is intended.
  • Use -s workspace-write as the normal default when Codex needs to edit files in the workspace.
  • --full-auto is a shortcut for a lower-friction setup and is useful when the user wants more automation with workspace-limited writes.
  • Add --skip-git-repo-check when the working folder is not a git repository.
  • Avoid --dangerously-bypass-approvals-and-sandbox.
  • Avoid --sandbox danger-full-access unless the user explicitly wants that risk.

Examples:

codex exec -a on-request -s workspace-write "\x3Cprompt>"
codex exec --full-auto "\x3Cprompt>"
codex exec --skip-git-repo-check "\x3Cprompt>"

Useful Exec Options

Mention these when relevant:

  • --json: use when Openclaw needs machine-readable output.
  • -i, --image: attach image inputs for UI or design tasks.
  • -m, --model: override the model when the user specifies one.
  • --search: enable web search when current information is needed.

Examples:

codex exec --json "\x3Cprompt>"
codex exec -i screenshot.png "Match this UI design."
codex exec -m gpt-5.4 "\x3Cprompt>"

Prompt Examples

Use short examples like these:

codex exec "Add a README section for local development."
codex exec "Implement a login retry feature with exponential backoff in the Openclaw client."
codex exec "Write a Python script that reads a CSV file and outputs a JSON summary by category."
codex exec "Modify the file upload endpoint to reject files larger than 10 MB and add a test for it."
codex exec --json "List all API endpoints in this workspace."

If the user explicitly wants an interactive chat, use:

codex "\x3Cprompt>"

Prompting Rule

Prefer prompts that include:

  • The exact outcome
  • The target file or component when known
  • Important constraints
  • Optional verification requests
安全使用建议
This skill is essentially documentation for running the Codex CLI non-interactively and appears internally consistent. Before installing/using: (1) ensure you only run codex exec inside workspaces you trust and avoid granting broad write access with --add-dir unless necessary; (2) prefer approval/sandbox flags (e.g., -a on-request, -s workspace-write) instead of --full-auto or Always allow unless you fully trust the environment; (3) only provide your OPENAI_API_KEY when you understand the CLI will use it; (4) install the CLI from the official npm package (@openai/codex) to avoid supply-chain risk; and (5) verify your Openclaw policies for autonomous invocation if you plan to allow automatic runs. The skill is coherent but exercise normal caution around filesystem scope and credentials.
能力评估
Purpose & Capability
The name/description are to teach Openclaw how to use Codex CLI non-interactively; the SKILL.md contains only CLI usage guidance, workspace and auth guidance, and flags relevant to that purpose. No unrelated credentials, binaries, or installs are requested.
Instruction Scope
Instructions include commands that change working directories, add writable directories (via --add-dir), skip git checks, and recommend sandbox/approval flags. These are appropriate for automating CLI runs but do grant the agent guidance to operate on filesystem paths—the doc also advises sandboxing and approvals. The SKILL.md does not instruct the agent to read unrelated system files or secrets.
Install Mechanism
This is an instruction-only skill with no install spec and no downloads. Low install risk.
Credentials
The document shows example usage with OPENAI_API_KEY and model override flags (e.g., -m gpt-5.4) but the skill metadata lists no required env vars. Mentioning OPENAI_API_KEY is reasonable for a CLI that supports API-key auth, but the metadata could declare it if the skill expected to require it in practice.
Persistence & Privilege
always is false and the skill is user-invocable; it does not request permanent platform presence or system-wide configuration changes.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install codex-cli-exec
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /codex-cli-exec 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of codex-cli-exec skill for Openclaw integration. - Provides practical, command-focused instructions for installing, authenticating, and using Codex CLI with Openclaw. - Recommends non-interactive `codex exec` commands as default for Openclaw automation. - Details workspace, authentication, approval, and sandboxing best practices. - Includes troubleshooting steps for authentication errors and non-git workspaces. - Offers concise example commands and prompting guidelines for task automation.
元数据
Slug codex-cli-exec
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

codex-cli-exec 是什么?

Explain how Openclaw should use Codex CLI as a non-interactive coding engine. Use when Codex needs to document or answer questions about installing Codex CLI... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 109 次。

如何安装 codex-cli-exec?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install codex-cli-exec」即可一键安装,无需额外配置。

codex-cli-exec 是免费的吗?

是的,codex-cli-exec 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

codex-cli-exec 支持哪些平台?

codex-cli-exec 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 codex-cli-exec?

由 minchoCoin(@minchocoin)开发并维护,当前版本 v1.0.0。

💬 留言讨论