Set up local Qwen Code to use GonkaGate in one npx command.
npx @gonkagate/qwen-code-setupThis repository provides the public onboarding CLI for configuring qwen to
use GonkaGate as an OpenAI-compatible provider.
The runtime is implemented. It detects Qwen Code, safely collects or reuses a
GonkaGate key, confirms the required model catalog through authenticated
/v1/models, writes managed Qwen Code settings with backups and rollback,
verifies locally inspectable durable state, reports current-session shadowing,
and supports redacted human and JSON output.
The happy path is:
- user runs
npx @gonkagate/qwen-code-setup - installer validates local
qwen - installer collects a GonkaGate
gp-...key through safe inputs - installer makes a separate authenticated
/v1/modelsrequest to GonkaGate - installer confirms all three supported GonkaGate models are available
- installer offers the public model picker
- installer writes the minimum Qwen Code settings needed for GonkaGate,
including all three models in
modelProviders.openai[] - installer verifies the durable local Qwen Code outcome and reports current-session shadowing when relevant
- user returns to plain
qwen
The compatibility baseline is @qwen-code/qwen-code 0.18.0, audited
on June 12, 2026.
The current Qwen Code integration points are:
- binary:
qwen - package:
@qwen-code/qwen-code - package engine:
>=22.0.0 - user settings:
~/.qwen/settings.json QWEN_HOMEuser settings:<QWEN_HOME>/settings.json- provider family:
modelProviders.openai[] - auth selection:
security.auth.selectedType = "openai" - active model selection:
model.name - provider key lookup:
envKey, resolved from Qwen Code environment loading - model discovery: authenticated
GET https://api.gonkagate.com/v1/modelsafter API-key collection
The audited 0.18.0 source marks modelProviders with replace merge
semantics. User-scope provider catalog writes are managed in user settings.
Project scope writes only activation settings and blocks if project
modelProviders would hide user-managed providers.
The supported v1 GonkaGate model set is:
qwen/qwen3-235b-a22b-instruct-2507-fp8moonshotai/Kimi-K2.6minimaxai/minimax-m2.7
The installer must never print a GonkaGate key and must not accept secrets
through a plain --api-key flag.
Safe secret inputs are intended to stay aligned with the OpenCode installer:
- hidden interactive prompt
GONKAGATE_API_KEY--api-key-stdin
The v1 durable secret target is user-level
settings.env.GONKAGATE_API_KEY inside the active Qwen settings file. Unlike
OpenCode, the audited Qwen Code docs describe envKey and environment loading
rather than an OpenCode-style {file:...} provider secret binding.
Default setup success is based on bounded local verification, not a live model
call. --verify-live is available only as an explicit opt-in and may spend
quota or depend on provider/network availability.
Use --dry-run to see planned managed files and blockers without writing Qwen
settings, backups, or install state.
npm install
npm run ciUseful commands:
npm run typecheck
npm run test
npm run format:check
npm run package:check