@gonkagate/openclaw
v0.2.0
Published
CLI installer and verifier for using OpenClaw with GonkaGate as the primary OpenAI-compatible provider.
Downloads
207
Maintainers
Readme
@gonkagate/openclaw
Set up OpenClaw to use GonkaGate as its primary OpenAI-compatible provider in one npx command, and verify both the resulting config and local runtime later with the same CLI.
This CLI is for developers who already have local OpenClaw and want a working OpenClaw config at the active path OpenClaw will load, without hand-editing JSON5, exporting secrets into shell profiles, guessing which models.providers.openai fields must change together, or first running the full OpenClaw onboarding wizard.
Under the hood it configures OpenClaw's built-in openai provider to talk to GonkaGate at https://api.gonkagate.com/v1 with api: "openai-completions".
It does not install OpenClaw itself. It configures an existing local OpenClaw install and can bootstrap the base OpenClaw config automatically when needed.
This package resolves the target config path locally with the same active-config selection order stable OpenClaw 2026.4.1 uses:
OPENCLAW_CONFIG_PATH, when set- else, inside
OPENCLAW_STATE_DIR, prefer an existingopenclaw.jsonorclawdbot.json, and fall back toOPENCLAW_STATE_DIR/openclaw.json - else, under
OPENCLAW_HOMEor~, prefer the first existing config candidate in this order:.openclaw/openclaw.json,.openclaw/clawdbot.json,.clawdbot/openclaw.json,.clawdbot/clawdbot.json - if none of those candidates exist, fall back to canonical
.openclaw/openclaw.json
It does not parse openclaw config file to determine the target path.
Quick Start
npx @gonkagate/openclawYou will be asked for:
- your GonkaGate API key (
gp-...) in a hidden interactive prompt - a model from the curated GonkaGate registry after the installer confirms the live catalog through
GET /v1/models
If the active OpenClaw config path does not exist yet, the installer will run openclaw setup automatically, ensure a minimal local Gateway mode, and then apply the GonkaGate-specific provider settings.
You need:
- local
OpenClaw - Node.js 22.14+ to run this package
- current OpenClaw install docs recommend Node 24, with Node 22.14+ supported for compatibility
- a GonkaGate API key
Verify With This CLI
After setup, you can run a read-only verification pass at any time:
npx @gonkagate/openclaw verifyThis command checks:
- that
openclawis installed and callable fromPATH - that the active OpenClaw config exists and parses cleanly as JSON5
- that
openclaw config validate --jsonaccepts the current config - that
models.providers.openai.baseUrlishttps://api.gonkagate.com/v1 - that
models.providers.openai.apiisopenai-completions - that
models.providers.openai.apiKeyexists and still looks like agp-...key - that
models.providers.openai.modelsincludes the curated GonkaGate model catalog entries needed by OpenClaw - that
agents.defaults.model.primarypoints at a curated GonkaGate model - that
agents.defaults.modelscontains the curated GonkaGate switcher allowlist used by OpenClaw/models - that the config file still uses owner-only permissions
- that the local OpenClaw Gateway RPC is reachable through
openclaw gateway status --require-rpc --json - that
openclaw health --jsonreports a healthy runtime - that
openclaw models status --plainresolves the same primary model that this package wrote
verify is still read-only, but it now expects the local OpenClaw Gateway to be running so it can prove the saved config is actually active.
Supported Models
Current curated registry in this package:
qwen3-235b->qwen/qwen3-235b-a22b-instruct-2507-fp8kimi-k2.6->moonshotai/Kimi-K2.6(default)
What It Does
The tool writes directly to the active OpenClaw config path resolved from:
OPENCLAW_CONFIG_PATH, when set- else, inside
OPENCLAW_STATE_DIR, the first existing ofopenclaw.jsonandclawdbot.json, falling back toOPENCLAW_STATE_DIR/openclaw.json - else, under
OPENCLAW_HOMEor~, the first existing of.openclaw/openclaw.json,.openclaw/clawdbot.json,.clawdbot/openclaw.json,.clawdbot/clawdbot.json - if no config candidate exists, canonical
.openclaw/openclaw.json
It also:
- honors
OPENCLAW_CONFIG_PATH,OPENCLAW_STATE_DIR, andOPENCLAW_HOMEwith the same active-config selection order stable OpenClaw uses - checks that the
openclawCLI is installed before asking for secrets - runs
openclaw setupautomatically when the base OpenClaw config does not exist yet - bootstraps
gateway.mode: "local"on true first-run installs when OpenClaw has not already set a gateway mode - refuses to overwrite an invalid JSON5 config
- refuses to overwrite a config that fails current OpenClaw schema validation
- fetches
GET /v1/modelswith the entered GonkaGate API key, requires every curated model to be present, and keeps model selection inside the code-owned curated registry - creates a backup before overwriting an existing config
- preserves unrelated top-level config keys
- preserves other provider entries under
models.providers - overwrites only the managed
models.providers.openaifields - merges live curated GonkaGate entries into
models.providers.openai.modelswhile preserving unrelated existing entries - sets
agents.defaults.model.primaryto the chosen curated model - creates or updates
agents.defaults.modelswith the curated GonkaGate switcher allowlist so/modelscan switch between supported models - validates the generated config with
openclaw config validate --jsonbefore replacing the live file - writes the config atomically with owner-only permissions
- writes backup files with owner-only permissions
- exposes
npx @gonkagate/openclaw verifyas a read-only validation command for the resulting config and active local runtime - treats a not-yet-running local Gateway as a successful install outcome and prints one exact next step:
openclaw gateway
Managed OpenClaw Fields
This installer manages only these OpenClaw surfaces:
models.providers.openai.baseUrlmodels.providers.openai.apiKeymodels.providers.openai.apimodels.providers.openai.modelsas a valid array containing the live curated GonkaGate model catalog, while preserving unrelated existing entriesagents.defaults.model.primaryagents.defaults.models["openai/<model-id>"].aliasfor curated GonkaGate models
Everything else is left intact.
Fixed GonkaGate Setup
These parts are intentionally fixed in the public onboarding flow:
- Provider id:
openai - Base URL:
https://api.gonkagate.com/v1 - API adapter:
openai-completions - API key entry: interactive only
This tool does not ask for a custom base URL and does not accept arbitrary model IDs.
Verify
After setup:
- Run
npx @gonkagate/openclaw verify - If the installer tells you the local Gateway is not running yet, run
openclaw gateway - Run
openclaw status --deepif you want the broader local diagnosis - In OpenClaw chat, run
/status - If the change does not appear, run
openclaw gateway restart
If you install the package globally instead of using npx, the same check is available as:
gonkagate-openclaw verifyWhat This Tool Does Not Do
- It does not install
OpenClaw - It does not configure Anthropic
- It does not edit
.zshrc,.bashrc, PowerShell profiles, or other shell startup files - It does not write
.envfiles or depend on shell exports - It does not support arbitrary custom base URL overrides
- It does not add any path configuration beyond the OpenClaw env vars that OpenClaw already supports
- It does not support project-local scope in v1
Sources
Implementation choices in this repository were aligned to these primary sources:
- OpenClaw Configuration
- OpenClaw Configuration Reference
- GonkaGate OpenClaw Integration Guide
- GonkaGate Model Selection Guide
- GonkaGate GET /v1/models API Reference
Development
npm install
npm run devUseful commands:
npm run buildnpm testnpm run ci
