OpenAI Codex 的 slash commands 适合在不离开聊天输入框的情况下切换本地/云端模式、查看状态、发反馈和设置持续目标。输入 / 后选择命令即可;如果 /goal 不出现,需要在 config.toml 里启用 features.goals = true,也可以用 CLI 执行 codex features enable goals。
OpenAI Codex IDE Slash Commands 命令
OpenAI Codex 的 slash commands 让你不用离开 chat input 就能控制 Codex。常见用途包括查看状态、切换 local 和 cloud mode,或者发送反馈。
怎么使用 slash command
- 在 Codex 的 chat input 里输入
/。 - 从列表中选择一个命令,或继续输入来过滤结果,比如
/status。 - 按 Enter。
可用的 slash commands
| Slash command | Description |
|---|---|
/auto-context |
Turn Auto Context on or off to include recent files and IDE context automatically. |
/cloud |
Switch to cloud mode to run the task remotely (requires cloud access). |
/cloud-environment |
Choose the cloud environment to use (available only in cloud mode). |
/feedback |
Open the feedback dialog to submit feedback and optionally include logs. |
/goal |
Set a persistent goal for Codex to work toward. |
/local |
Switch to local mode to run the task in your workspace. |
/review |
Start code review mode to review uncommitted changes or compare against a base branch. |
/status |
Show the thread ID, context usage, and rate limits. |
如果 /goal 没有出现在 slash command 列表里,先在 config.toml 里启用 features.goals:
[features]
goals = true
你也可以在 CLI 里运行 codex features enable goals,或者让 Codex 代为执行。
常见问题
OpenAI Codex 里怎么使用 slash commands
在 Codex chat input 里输入 /,然后从弹出的列表选择命令,或者继续输入命令名筛选,比如 /status。选中后按 Enter 执行。
/goal 不显示怎么解决
先检查 config.toml 里的 [features] 配置,把 goals = true 打开。你也可以运行 codex features enable goals,或者直接让 Codex 帮你执行这条命令。
/cloud 和 /local 有什么区别
/cloud 会把任务切到远端 cloud mode 运行,前提是你有 cloud access。/local 则在你当前的 workspace 里运行任务。