Commands and Workflows - Entry Points for Skills and Automation
Codex commands include built-in controls and entry points for reusable or automated work. Separate them by purpose.
Four Entry Points
| Entry point | Purpose | Example |
|---|---|---|
| Built-in command | Control a CLI session or feature | /agent, /skills, /plugins |
| Skill | Reuse procedures, references, and scripts | $docs-content |
codex exec | Run non-interactively from a local script or CI | Scheduled review, report generation |
| Codex GitHub Action | Run with bounded permissions in GitHub Actions | PR review, release checks |
Built-in commands control the Codex CLI itself.[1] Put project procedures in Skills, use codex exec for repeatable script execution, and use the Codex GitHub Action for GitHub Actions workflows.[2][3][4]
Design an automation prompt
When the inputs change but the review criteria stay the same, keep the prompt text in the repository and pass it as a codex exec argument or as the GitHub Action’s prompt-file.[3][4]
# Pull request review
Compare this branch with main.
Report bugs, security risks, regressions, and missing tests.
List findings first with file and line references.
Do not edit files.An automation prompt should define the goal, input scope, restrictions, output format, and completion condition. Keep repository-wide permanent rules in AGENTS.md instead of duplicating them.
Custom Prompts under ~/.codex/prompts are deprecated. Use Skills for reusable interactive procedures and use codex exec or the Action prompt for automation input.[5]
codex exec and the GitHub Action
codex exec runs from scripts or CI without opening the interactive TUI.[3] The Codex GitHub Action can invoke it with a prompt file, model, sandbox, and output file.[4] Before automation, decide whether the task is read-only or can write patches, what network or secrets are available, how failures affect the job, and whether reruns are safe.
When to Move a Workflow into a Skill
A one-off short instruction can remain in the conversation or automation prompt. Move it into a Skill when it should be reusable during interactive work and needs multiple steps, supporting references, helper scripts, or explicit trigger rules.[2]
Next, Skills design patterns explains progressive loading of task-specific procedures.
Summary
Use built-in commands for interactive controls, Skills for reusable procedures, codex exec for non-interactive local automation, and the Codex GitHub Action for GitHub Actions workflows.
See the references for the external specifications and background sources used on this page.[1][2][3][4][5]
This article is a general information summary and is not legal advice. Confirm practical decisions with a qualified specialist.
References
- OpenAI, Slash commands in Codex CLI
- OpenAI, Build skills
- OpenAI, Non-interactive mode
- OpenAI, Codex GitHub Action
- OpenAI, Custom Prompts