Set up Codex CLI to use GonkaGate as a custom provider in one npx command,
without shell exports, .env files, manual edits to ~/.codex/config.toml,
or direct exposure to Codex provider internals.
npx @gonkagate/codex-setupWhat the installer does today:
- checks that
codexis available and that the local Codex CLI is at least0.118.0 - prompts for a hidden GonkaGate
gp-...key - uses a curated model registry bundled with this package
- currently ships curated Codex model choices:
moonshotai/Kimi-K2.6(default) andgpt-5.4 - asks whether GonkaGate should be activated in
userorlocalscope - keeps the secret, helper command, and curated model catalog under
~/.codex/...by default, or underCODEX_HOMEwhen that env var is set - writes or updates the necessary Codex config layers
- creates backups before replacing existing managed files
user scope:
- writes provider config, model activation, and
model_catalog_jsonto~/.codex/config.toml - keeps the token file, helper command, and curated catalog under
~/.codex/...
local scope:
- still keeps the secret, helper command, and curated catalog under
~/.codex/... - writes only activation settings to
<project-root>/.codex/config.toml - writes the provider definition and
projects."<abs-path>".trust_level = "trusted"to user config - refuses to mutate
<project-root>/.codex/config.tomlwhen that file is already tracked by git; the installer offersuserscope or cancel instead - adds
.codex/config.tomland.codex/config.toml.backup-*to.git/info/excludewhen the file is local and untracked
user scope produces the equivalent of:
model_provider = "gonkagate"
model = "moonshotai/Kimi-K2.6"
model_catalog_json = "/Users/you/.codex/model-catalogs/gonkagate.json"
[model_providers.gonkagate]
name = "GonkaGate"
base_url = "https://api.gonkagate.com/v1"
wire_api = "responses"
supports_websockets = false
auth = { command = "/Users/you/.codex/bin/gonkagate-token", timeout_ms = 5000, refresh_interval_ms = 300000, cwd = "/Users/you/.codex" }For local scope, the user config keeps the provider definition and project
trust entry, while <project-root>/.codex/config.toml activates:
model_provider = "gonkagate"
model = "moonshotai/Kimi-K2.6"
model_catalog_json = "/Users/you/.codex/model-catalogs/gonkagate.json"- Codex user config lives in
~/.codex/config.toml. - Project overrides live in
.codex/config.tomland are loaded only for trusted projects. - GonkaGate uses a custom
model_provider, notopenai_base_url. - The provider must speak Codex
responseswire semantics, including streaming. - The auth path is command-backed bearer token retrieval through
model_providers.<id>.auth. - The installer never writes directly to
auth.json. - Model selection comes from a curated registry and
model_catalog_json, not raw/v1/modelsdiscovery. - v1 targets Codex CLI first. Desktop app behavior is best-effort rather than a product promise.
npm install
npm run ciUseful commands:
npm run typechecknpm run buildnpm testnpm run formatnpm run package:check
The current implementation was verified against the stable @openai/codex
release 0.118.0 on April 2, 2026. If upstream Codex changes provider auth,
trust handling, or model_catalog_json, this repository contract should be
re-audited before changing the installer behavior.