How to open and resume Codex Cloud chats from the CLI with --cloud
Starting with Codex CLI 0.174.0 (December 4), you can work in a Codex Cloud chat right in the terminal UI. Each cloud chat gets its own remote workspace and keeps going after you close your laptop. Before, the terminal could only submit a task with codex cloud exec, and you had to continue the conversation on the web or in the app.
- Update to the new version.
npm install -g @openai/codex@0.174.0
- Open a new cloud chat.
codex --cloud
- To start in a saved cloud environment, pass its ID with
--env. You can find environment IDs in theenvironment_idfield ofcodex cloud list --json.
codex --cloud --env <ENV_ID>
- Reopen an earlier cloud chat by adding
--cloudtoresume. You can pick from the list, take the most recent chat, or pass a chat ID or name, and it keeps the environment and model saved with that chat.
codex resume --cloud
The environment you pick in the terminal is saved per project under tui.default_cloud_environments in config.toml and reused for later chats. Choosing Default clears it. Codex refuses to start if you also pass local execution overrides (such as a sandbox override) that Cloud can't enforce. If it doesn't reconnect on its own after a disconnect, press Ctrl+R. Your draft is kept.
Sources
Get notified when a new tip lands
Tip alerts only go out in the app. Install it and turn notifications on.