OpenAI Codex
OpenAI Codex is an AI coding assistant available as both a CLI tool and a VS Code extension in Datacoves.
Prerequisites
- A ChatGPT account
- OpenAI Codex enabled in your Datacoves environment. An administrator enables OpenAI Codex under Admin > Environments > your environment > AI Tools > AI Extensions, and OpenAI Codex CLI under AI Tools.
Enable device code login
Before logging in from Datacoves, enable device code login in your ChatGPT account.
Personal accounts: go to your ChatGPT security settings and enable device code login.
Workspace / Enterprise accounts: a workspace admin must enable device code authentication in the admin permissions page.
For more details, see OpenAI's authentication docs.
Login
-
Open a terminal in your Datacoves VS Code workspace, with OpenAI Codex CLI enabled.
-
Run:
codex login --device-auth -
The CLI will display a URL and a one-time code
-
Open the URL in any browser, enter the code, and sign in with your ChatGPT account
The CLI is now signed in. The CLI and the extension share the same Codex login.
With OpenAI Codex enabled, you can also sign in from the Codex view with Sign in with ChatGPT. It asks for confirmation, opens the OpenAI page, and signs the extension in.
The view also offers Use device code, which shows a one-time code. Enter that code on the OpenAI device login page.
You may need to reload your browser tab after CLI login for the VS Code extension to pick up the credentials.