codex-cli

Install, authenticate, and run OpenAI Codex CLI non-interactively within APX runtimes.

6|1|Updated May 8, 2026
One-click install
npx skills add https://github.com/agentprojectcontext/apx --skill codex-cli-agentprojectcontext
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: codex-cli
Source: https://github.com/agentprojectcontext/apx/tree/main/src/core/runtime-skills/codex-cli
Command: npx skills add https://github.com/agentprojectcontext/apx --skill codex-cli-agentprojectcontext

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @openai/codex.

What problem does it solve? Working with the OpenAI Codex CLI requires knowing the correct install path, authentication state, and current flags, which change between versions and can break automation when outdated flags like --approval-mode are used. This Skill provides verified commands for installing Codex, checking auth, running non-interactive tasks, and dispatching Codex as an APX runtime. ## Core Features & Use Cases - Verified CLI usage: Check codex --version and codex --help before acting so you never invent or rely on deprecated flags. - Non-interactive automation: Run codex exec with sandbox and --skip-git-repo-check options for scripted task execution, JSON output, and last-message capture. - Session management and APX integration: List and resume Codex sessions via apx sessions list and codex resume, and dispatch agents with apx run <agent> --runtime codex. - Use Case: You want an APX agent to execute a coding task through Codex in a directory that is not a Git repository; the Skill tells you to use codex exec --sandbox workspace-write --skip-git-repo-check so the run succeeds. ## Quick Start Ask the assistant to run a task through the Codex runtime, for example by requesting it to execute apx run my-agent --runtime codex with your task description.

Frequently Asked Questions about codex-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I install OpenAI Codex CLI?▼

Install Codex CLI globally with npm using npm install -g @openai/codex, then verify with codex --version. You can also run codex login to authenticate and codex update to upgrade later.

How do I run Codex CLI non-interactively for automation?▼

Use codex exec instead of the interactive TUI, for example codex exec --sandbox workspace-write --skip-git-repo-check "task". Add --json for structured output or --output-last-message to save the final response to a file.

Why does Codex CLI reject flags like --approval-mode or --full-auto?▼

Current Codex CLI versions may reject older flags such as --approval-mode or --full-auto. Always run codex --help and codex exec --help first to confirm the exact flags your installed version supports.

How do I check if Codex CLI is authenticated?▼

Check for the auth file with test -f ~/.codex/auth.json, which confirms credentials exist. If missing, run codex login to authenticate before executing tasks.

How do I list and resume Codex sessions in APX?▼

List sessions with apx sessions list --engine codex --project <name> or --dir <path>. Resume with codex resume <session-id> interactively, codex exec resume <session-id> non-interactively, or codex resume --last for the most recent session.

Why does codex exec fail in directories that are not Git repositories?▼

Codex may refuse to run outside Git repositories by default. Pass --skip-git-repo-check to codex exec, which matters for APX default runtime directories like ~/.apx/projects/default that may not be Git repos.