1. OMP Studio
  2. Grenton and Codex

Grenton and Codex: OpenAI Codex CLI in your project

OMP Studio can use OpenAI's Codex CLI as its agent for Grenton Lua scripts. Codex runs locally, under your own account, in the project's working copy. Once its config allows file writes and network access, its edits appear in the editor live.

Setup

  1. Install the agent: npm install -g @openai/codex.
  2. Sign in: run codex login.
  3. Let Codex edit the project: add the settings shown below this list to ~/.codex/config.toml.
  4. Select the agent in OMP Studio: omps ai codex. This also health-checks it.
  5. Open the project: omps MyProject.omp. The AI box is in the editor's bottom panel. The omps command is available after installing; without that, use npx @omp-studio/omps instead of omps.
sandbox_mode = "workspace-write"

[sandbox_workspace_write]
network_access = true

Without write access Codex can't edit scripts, and omps commands talk to the running session on this computer, so they need network access. On Codex CLI 0.166.0 with no config of your own, codex exec can neither write files nor reach 127.0.0.1. Put sandbox_mode before the first section in square brackets.

network_access also lets Codex's commands reach the internet, not only this computer. OMP Studio passes Codex no sandbox settings, so these permissions are yours to set in its config.

Account and billing

Codex CLI can sign in with a ChatGPT account, depending on your plan. OpenAI has the details: using Codex with your ChatGPT plan and Codex authentication. An API key is billed separately at API pricing. OMP Studio is not involved in these payments.

How OMP Studio runs Codex

Each question is a codex exec --json run in the project's working folder. OMP Studio remembers the thread id, and a follow-up continues it with codex exec resume. With no id it starts a new conversation. OMP Studio passes no sandbox settings; permissions come from ~/.codex/config.toml, covered in Setup above.

Codex reads AGENTS.md, describing the project and the Lua dialect, and project-index.json, the object inventory. It has the omps commands for structural changes and checks its work with omps lint.

Example tasks

  • "Make this script turn off the living room lights after 22:00": the editor passes along which script is active.
  • "Find scripts nothing calls": the agent uses the event bindings in the index.
  • "Fix all the problems on CLU01": omps lint reports the same errors as the editor.

While Codex runs, the editor is read-only, and you send the project from Object Manager. There is more in Grenton and AI. The Grenton Lua guide covers the language rules, Grenton and ChatGPT the difference from a chat. You can also use Claude Code.

The sync scope is the same as when you work by hand. Your .omp file stays on your machine. Scripts, the project index and editor data (room layout, myGrenton screens) sync to the cloud. system.xml and the project cipher key stay local.

Common questions

Does Codex need an API key?

Not necessarily. Codex CLI can sign in with a ChatGPT account, depending on your plan; see OpenAI's docs. An API key is billed separately.

Does my ChatGPT plan include Codex?

That depends on your plan, and limits vary. OpenAI has the current information.

Will Codex deploy the project to a CLU?

No. Scripts can't be executed or sent from the working folder. You send them from Object Manager.