Run Codex CLI
1
Start Codex
Replace On first launch, choose Sign in with ChatGPT, Sign in with Device Code, or provide an API key. Browser-based sign-in happens on your host while the resulting Codex credentials are stored on the sandbox’s root disk.
./my-project with the project directory you want Codex to work on:2
Start another session
After leaving Codex, return to the same sandbox and workspace with:The sandbox root disk retains the files under
/root/.codex, including authentication, configuration, and session history.3
Verify the installation
Exit the TUI and run:The pinned example prints
codex-cli 0.148.0.4
Review or export changes
With the default writable mount, changes are already in the host checkout. Review them inside the sandbox:If you chose the isolated Copy the patch to the host:Check that it applies cleanly before applying it:
--copy-dir alternative, create a patch inside the sandbox:5
Clean up
Remove the sandbox:Removing the sandbox also removes its Codex credentials, configuration, and sessions. Changes made through the default workspace mount remain in the host checkout.