Skip to content

Support Slash Commands in codex exec Mode #3641

@jtele2

Description

@jtele2

What feature would you like to see?

Slash commands do not work in exec mode (or do not work in the way users expect).

For example, say I have a custom COMMIT slash command. In Claude Code, I'm able to run the equivalent of this easily: codex e "/COMMIT" - and it will run my slash command. Codex CLI does not seem to parse that as a slash command (and inject my prompt), but rather just interpret the raw text.


Proposal

Enable alias-slash commands (or a subset thereof) within the codex exec / codex e mode. That is, allow the user to prefix the prompt or combine slash commands with the prompt so that non-interactive runs can:

  • Adjust or set the approval mode (e.g. --auto-edit, --full-auto), OR via slash command semantics
  • Inspect status (e.g. /status)
  • Possibly change model or reasoning level (via /model)
  • Apply other interactive commands that should logically function even without full TUI
Examples
codex exec "/mode full-auto; fix the CI failure" (builtin)
codex exec "/approvals suggest; lint and format code" (builtin)
codex e "/status; run all tests" (builtin)
codex e "/COMMIT" (custom)

Motivation

  • Make codex exec mode more powerful and flexible without needing to drop into interactive mode.
  • Enable scripting or automation workflows that depend on triggering different contexts (mode, permissions, model) in a single command.
  • Reduce friction for users who know what they want and don't need interactive prompts.

Are you interested in implementing this feature?

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestexecIssues related to the `codex exec` subcommand

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions