Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Narrow setup wizard change to Kimi, Gemini and DeepSeek in cli-setup

milind-soni7fd866c98650
diff --cc server/cli-setup.test.ts
index 47cfcbba51,d003e3f35a..ac52cfc2b4
--- a/server/cli-setup.test.ts
+++ b/server/cli-setup.test.ts
@@@ -6,6 -6,6 +6,8 @@@ import { DATA_DIR, instanceConfigs, loa
import { acquireDataDirLease } from "./data-dir-lease.ts";
import { SetupCancelled, type SetupIo } from "./cli-prompts.ts";
import { isSetupComplete, readCliStartup, runSetup, saveCliStartup } from "./cli-setup.ts";
++import { hasDeepSeekKey } from "./drivers/acp/deepseek.ts";
++import { geminiIsAuthenticated } from "./drivers/acp/gemini.ts";
import { OpenAICompatDriver } from "./drivers/openai-compat.ts";
const options = { dataDir: DATA_DIR, port: 8799 };
@@@ -212,62 -212,6 +214,77 @@@ describe("native provider onboarding",
expectLeaseReleased();
});
+ it("offers Kimi, Gemini and DeepSeek after Codex and Claude, before the API key route", async () => {
+ const ui = prompts({ choices: [0, 0], confirms: [true] });
+ expect(await runSetup(options, ui.io, dependencies())).toBe(true);
+ expect(ui.io.choose.mock.calls[0]?.[1].slice(0, 6)).toEqual([
+ "ChatGPT / Codex — sign in with your account",
+ "Claude Code — sign in with your account",
+ "Kimi Code — sign in with your Kimi account",
+ "Gemini CLI — Gemini API key",
+ "DeepSeek Harness — DeepSeek API key",
+ "API key — OpenAI, OpenRouter, Groq or a compatible service (chat only)",
+ ]);
+ });
+
+ it("installs Kimi on confirmation and runs its device-code login", async () => {
+ const deps = dependencies();
+ deps.inspect
+ .mockResolvedValueOnce({ snapshot: { state: "unavailable", reason: "missing fixture CLI" }, models })
+ .mockResolvedValueOnce({ snapshot: { state: "available", authenticated: false }, models });
+ const ui = prompts({ choices: [2, 0], confirms: [true, true] });
+ expect(await runSetup(options, ui.io, deps)).toBe(true);
+ expect(deps.runCli.mock.calls).toEqual([
+ ["npm", ["install", "-g", "@moonshot-ai/kimi-code"]],
+ ["kimi", ["login"], undefined],
+ ]);
+ expect(loadConfig().instances?.kimi).toEqual({ driver: "kimiAgent", enabled: true });
+ expect(loadConfig().defaultModelSelection).toEqual({ instanceId: "kimi", model: "fixture-default" });
+ ui.assertConsumed();
+ });
+
+ it.each([
+ { choice: 3, id: "gemini", driver: "geminiAgent", env: "GEMINI_API_KEY" },
+ { choice: 4, id: "deepseek", driver: "deepseekAgent", env: "DEEPSEEK_API_KEY" },
+ ])("saves a $id API key on its own instance without starting a login", async ({ choice, id, driver, env }) => {
+ const deps = dependencies();
+ deps.inspect.mockResolvedValueOnce({ snapshot: { state: "available", authenticated: false }, models });
+ const ui = prompts({ choices: [choice, 0], secrets: [" fixture-engine-key "], confirms: [true] });
+ expect(await runSetup(options, ui.io, deps)).toBe(true);
+ expect(deps.runCli).not.toHaveBeenCalled();
+ expect(deps.inspect).toHaveBeenLastCalledWith(id, { driver, enabled: true, environment: { [env]: "fixture-engine-key" } });
+ expect(loadConfig().instances?.[id]).toEqual({ driver, enabled: true, environment: { [env]: "fixture-engine-key" } });
+ expect(loadConfig().defaultModelSelection).toEqual({ instanceId: id, model: "fixture-default" });
+ expect(ui.lines.join("\n")).not.toContain("fixture-engine-key");
+ ui.assertConsumed();
+ });
+
++ it("hands a key saved by setup to its engine at run time, ahead of a workspace key", async () => {
++ persist({ deepseek: { key: "fixture-workspace-key" }, tts: { geminiKey: "fixture-speech-key" } });
++ for (const [choice, id, env] of [[3, "gemini", "GEMINI_API_KEY"], [4, "deepseek", "DEEPSEEK_API_KEY"]] as const) {
++ const deps = dependencies();
++ deps.inspect.mockResolvedValueOnce({ snapshot: { state: "available", authenticated: false }, models });
++ const ui = prompts({ choices: [choice, 0], secrets: [`fixture-${id}-key`], confirms: [true] });
++ expect(await runSetup(options, ui.io, deps)).toBe(true);
++ const saved = loadConfig();
++ expect(instanceConfigs(saved)[id]?.environment?.[env]).toBe(`fixture-${id}-key`);
++ expect(saved.tts?.geminiKey, "the speech key stays its own").toBe("fixture-speech-key");
++ }
++ expect(geminiIsAuthenticated({ GEMINI_API_KEY: instanceConfigs(loadConfig()).gemini?.environment?.GEMINI_API_KEY })).toBe(true);
++ expect(hasDeepSeekKey({ DEEPSEEK_API_KEY: instanceConfigs(loadConfig()).deepseek?.environment?.DEEPSEEK_API_KEY })).toBe(true);
++ });
++
+ it("saves nothing when an engine API key is left empty", async () => {
+ const original = persist({ profile: { name: "Keep" } });
+ const deps = dependencies();
+ deps.inspect.mockResolvedValue({ snapshot: { state: "available", authenticated: false }, models });
+ const ui = prompts({ choices: [4, 2], secrets: [" "] });
+ expect(await runSetup(options, ui.io, deps)).toBe(false);
+ expect(ui.lines.join("\n")).toContain("An API key is required");
+ expect(readFileSync(configPath, "utf8")).toBe(original);
+ expectLeaseReleased();
+ });
+
it("does not overwrite an instance that repurposed a native provider ID", async () => {
const existing = { driver: "customAcp", displayName: "Keep this connection", config: { cli: "/fixture/other" } };
persist({ instances: { codex: existing } });
diff --cc server/drivers/acp/gemini.ts
index 92269914b1,90a44cead2..37471d8c74
--- a/server/drivers/acp/gemini.ts
+++ b/server/drivers/acp/gemini.ts
@@@ -59,16 -61,7 +61,16 @@@ const support: AcpSupport =
defaultCli: "gemini",
nativeSource: "gemini.acp",
loginNote:
- "Gemini CLI needs a Gemini API key — paste one under Settings → Connections → Model providers, or set GEMINI_API_KEY. Personal Google sign-ins stopped working on 2026-06-18 (use the Antigravity engine for those accounts)",
+ "Gemini CLI needs a GEMINI_API_KEY, a Vertex AI setup, or an enterprise Code Assist login — consumer Google logins stopped working on 2026-06-18 (use the Antigravity engine for those accounts)",
+ install: {
+ command: {
+ darwin: "npm install -g @google/gemini-cli",
+ linux: "npm install -g @google/gemini-cli",
+ win32: "npm install -g @google/gemini-cli",
+ },
+ npmPackage: "@google/gemini-cli",
+ docsUrl: "https://github.com/google-gemini/gemini-cli",
+ },
// --acp is stable; --experimental-acp still works but warns.
spawnArgs: (config, turn) => ["--acp", ...geminiApprovalArgs(config.fullAuto, turn.approvalMode), ...(turn.model ? ["-m", turn.model] : [])],