Cli Zai authetincation doens't work
Plugin Type
Kilo Code CLI
App Version
1.0.0
Description
when i launch the cli and i select Zai i paste my api keys and it doesn't work Welcome to the Kilo Code CLI! 🎉
To get you started, please fill out these following questions. ✔ Please select which provider you would like to use: zAI ✔ Please enter your zAI token: node:internal/process/promises:391 triggerUncaughtException(err, true /* fromPromise */); ^
Error: Invalid config: zaiApiLine is required and cannot be empty for selected provider, apiModelId is required and cannot be empty for selected provider
at saveConfig (file:///home/filippo/.nvm/versions/node/v20.19.5/lib/node_modules/@kilocode/cli/index.js:12107:15)
at async authWizard (file:///home/filippo/.nvm/versions/node/v20.19.5/lib/node_modules/@kilocode/cli/index.js:57664:3)
at async Command.
Node.js v20.19.5
Reproduction steps
launch kilocode from the cli paste the zai api
Provider
No response
Model
No response
System Information
No response
If you need a temporary fix, you can check out the ZAi Config Docs. That’s what I did, and it worked for me.
Same problem for me, installed it fresh today (after the fix i see in the reply above) .. so still not working
LE: You have to type kilo config in terminal. it will provide the json config where you swap the first lines with what you get in the ZAi Config Docs (see url above)
We're now properly supporting zAI. Let me know if the issue still persists!
this isse still persists when installing the KiloCode CLI however it can be fixed by the workaround @kanishka-sahoo provided , thanks for that!
I concur with @misterdojo777 ; This issue still exists, when selecting the option "zAI" and providing key.
Upon inspection of the config.json, kilo code CLI appears to write a generic config.json, specifically noting the header section (Trimmed for berevity):
{ "version": "1.0.0", "mode": "code", "telemetry": true, "provider": "default", "providers": [ { "id": "default", "provider": "kilocode", "kilocodeToken": "", "kilocodeModel": "x-ai/grok-code-fast-1" } ] }
Does not appear to save out, nor use the key provided when launching for first time.
As with @misterdojo777 , @kanishka-sahoo fix works by manually manipulating your own config.json.
The outcome is the same when providing zaiApiLine directly in the kilocode cli config. It gets an error 401 no matter what URL is in zaiApiLine.
{
"id": "default",
"provider": "zai",
"zaiApiKey": "
{ "id": "default", "provider": "zai", "zaiApiKey": "", "zaiApiLine": "https://api.z.ai/api/coding/paas/v4/", "apiModelId": "glm-4.6" }
zaiApiLine should be "zaiApiLine": "international_coding",
Your options are: international international_coding china china_coding
{ "id": "default", "provider": "zai", "zaiApiKey": "", "zaiApiLine": "https://api.z.ai/api/coding/paas/v4/", "apiModelId": "glm-4.6" }
zaiApiLine should be "zaiApiLine": "international_coding",
Your options are: international international_coding china china_coding
Thank you. I updated it to "international_coding" and that corrects it.