Skip to main content

Set up Codex

Kenaz, a Kameas AI product.

The quickest way is kenaz init. It sets up Codex, ChatGPT desktop's Codex mode and Claude Code in one go.

Install Kenaz, then run:

kenaz init

kenaz init puts kenaz on your PATH, signs you in, finds the Codex CLI and the ChatGPT desktop app, and runs kenaz setup codex for you, showing its diff and asking first. See Install → Then run kenaz init for every step and option.

Restart Codex afterwards. The plugin's session hooks need you to trust them once in Codex; telemetry works without them.

Set up Codex by itself​

To set up only Codex, run setup with the kenaz you installed:

kenaz setup codex

If kenaz isn't on your PATH yet, use its full path: ~/.kenaz/install/current/bin/kenaz setup codex on macOS and Linux, or & "$env:LOCALAPPDATA\Programs\Kenaz\current\bin\kenaz.exe" setup codex on Windows.

Setup starts the local relay if it isn't running, and then does two things:

  1. It adds the plugin to Codex.

    • If you already added the kenaz marketplace from GitHub (kameas-ai/kenaz-plugin), setup uses it, and adds the plugin from it with codex plugin add kenaz@kenaz if it isn't installed yet. That plugin runs kenaz from your PATH.
    • Otherwise, setup registers the plugin from your download. It first checks every file of the installed archive against its bundle.json, and refuses a modified, incomplete or mixed-version archive. It then writes a per-user copy of the plugin under the Kenaz state directory, with the MCP server and hook commands pointing at this kenaz by its full path, and registers that copy with codex plugin marketplace add and codex plugin add kenaz@kenaz. The installed archive itself is never changed.
  2. It points Codex's telemetry at the local relay. It sets these keys in the [otel] table of your Codex config file (~/.codex/config.toml, or $CODEX_HOME/config.toml):

    [otel]
    exporter = { otlp-http = { endpoint = "http://127.0.0.1:<relay port>/v1/logs", protocol = "binary" } }
    trace_exporter = { otlp-http = { endpoint = "http://127.0.0.1:<relay port>/v1/traces", protocol = "binary" } }
    metrics_exporter = { otlp-http = { endpoint = "http://127.0.0.1:<relay port>/v1/metrics", protocol = "binary" } }
    log_user_prompt = false
    tool_result = { max_bytes = 0 }

    Nothing is sent to Kameas Fleet until you opt in.

kenaz setup claude and kenaz setup codex show you a diff of the changes to your Claude Code or Codex settings file and ask before writing it (--dry-run only shows the diff; --yes skips the question). Setup saves a backup copy next to the file. kenaz setup --undo claude (or --undo codex) removes the settings setup added and puts back the values it replaced; if you haven't edited the file since, it is restored exactly.

Before the diff, setup also lists the codex plugin commands it will run. Re-running setup changes nothing; running it from a newer installed version re-registers that one. If codex isn't on your PATH, setup uses the copy of Codex that the ChatGPT desktop app ships (macOS). Restart Codex afterwards. The plugin's session hooks need you to trust them once in Codex; telemetry works without them.

Options​

kenaz setup codex [--yes] [--dry-run] [--env E] [--bundle DIR | --no-bundle]
kenaz setup --undo codex [--yes] [--dry-run] [--env E]
OptionWhat it does
--dry-runShow the diff and change nothing.
--yesApply without asking. Without it, setup asks, and makes no changes when it isn't run in a terminal.
--env EKameas Fleet environment: prod (default), stage or dev.
--bundle DIRRegister this extracted archive's plugin, replacing the kenaz marketplace from GitHub. --undo removes it and prints the command that adds the GitHub marketplace back.
--no-bundleNever register a downloaded archive's plugin; the plugin runs kenaz from your PATH.

If setup stops or warns​

  • "Codex already has a "kenaz" plugin marketplace … that setup did not register": you added a kenaz marketplace from somewhere other than GitHub's kameas-ai/kenaz-plugin, for example a local folder. Remove it (codex plugin marketplace remove kenaz) and run setup again. The plugin is never registered twice.
  • "the Kenaz plugin (kenaz@kenaz) is installed in Codex but turned off": see Troubleshooting.
  • "the Kenaz plugin from GitHub starts kenaz from PATH, and kenaz is not on PATH": run kenaz init to put kenaz on your PATH, then restart Codex.

kenaz setup doctor checks what setup configured for each tool.

ChatGPT desktop (Codex)​

The ChatGPT desktop app's Codex mode is covered by the same setup: kenaz init or kenaz setup codex sets it up too, and needs no separate step. It runs Codex with the same ~/.codex/config.toml, plugins and marketplaces as the Codex CLI.

After kenaz init changes your PATH, quit and reopen ChatGPT so it sees the change.

From the kenaz marketplace​

These are the self-install steps shown on the Agent harnesses page in Kameas Fleet, with the kenaz program installed first, as on the Install page. The plugin installed this way runs kenaz from your PATH; kenaz init puts it there.

codex plugin marketplace add kameas-ai/kenaz-plugin
codex plugin add kenaz@kenaz
kenaz init

kenaz init signs you in and runs kenaz setup codex, which finds the marketplace you added and uses it, so the plugin isn't registered twice, and writes the [otel] settings.

For administrators: managed_config.toml​

To route every developer's Codex telemetry to the local relay, deploy this block in Codex's managed_config.toml, which overrides each user's own [otel] settings. It's the same template as on the Agent harnesses page in Kameas Fleet. To print it for your Kenaz version, run kenaz setup print-managed codex (add --raw for only the block, or --port N to pin another relay port).

  • macOS and Linux file: /etc/codex/managed_config.toml
  • macOS device management: preference domain com.openai.codex, key config_toml_base64 (the block, base64-encoded)

Merge it with any [otel] settings you already manage.

[otel]
exporter = { otlp-http = { endpoint = "http://127.0.0.1:4318/v1/logs", protocol = "binary" } }
trace_exporter = { otlp-http = { endpoint = "http://127.0.0.1:4318/v1/traces", protocol = "binary" } }
metrics_exporter = { otlp-http = { endpoint = "http://127.0.0.1:4318/v1/metrics", protocol = "binary" } }
log_user_prompt = false
tool_result = { max_bytes = 0 }

Distributing this configuration makes Kenaz available. It does not opt anyone in. You are responsible for any notice your developers are owed under the laws that apply to them, and for any works-council or employee-representative consultation those laws require. Subscription Agreement §3.7.

Notes:

  • To install the plugin for everyone, import the GitHub marketplace kameas-ai/kenaz-plugin in the ChatGPT admin console and set kenaz to Installed for the roles that should have it. Plugin hooks still need each user to trust them once in Codex; telemetry works without them.
  • The template is for Codex 0.147.0 or later.
  • Each developer still needs the kenaz program on their PATH, from a download or your device-management tool, and signs in once with kenaz login. Admin configuration never signs anyone in or turns on telemetry classes for them: nothing is sent until each member signs in and opts in.

Claude and Claude Code are trademarks of Anthropic, PBC. OpenAI and Codex are trademarks of OpenAI. Kenaz and Kameas are trademarks of Kameas AI, Inc. Kenaz for Claude Code and Codex is an independent product of Kameas AI, Inc. and is not affiliated with, endorsed or sponsored by Anthropic or OpenAI.