Skip to content

Commit e8c6b64

Browse files
authored
Recommends kimi (#93)
1 parent dbef033 commit e8c6b64

18 files changed

Lines changed: 88 additions & 673 deletions

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ https://raw.githubusercontent.com/alvinunreal/oh-my-opencode-slim/refs/heads/mas
6363
</tr>
6464
<tr>
6565
<td colspan="2">
66-
<b>Recommended Models:</b> <code>cliproxy/gemini-claude-opus-4-5-thinking</code> <code>openai/gpt-5.2-codex</code>
66+
<b>Recommended Models:</b> <code>kimi-for-coding/k2p5</code> <code>openai/gpt-5.2-codex</code>
6767
</td>
6868
</tr>
6969
</table>
@@ -125,7 +125,7 @@ https://raw.githubusercontent.com/alvinunreal/oh-my-opencode-slim/refs/heads/mas
125125
</tr>
126126
<tr>
127127
<td colspan="2">
128-
<b>Recommended Models:</b> <code>openai/gpt-5.2-codex</code> <code>cliproxy/gemini-3-pro-high</code>
128+
<b>Recommended Models:</b> <code>openai/gpt-5.2-codex</code> <code>kimi-for-coding/k2p5</code>
129129
</td>
130130
</tr>
131131
</table>
@@ -232,12 +232,6 @@ https://raw.githubusercontent.com/alvinunreal/oh-my-opencode-slim/refs/heads/mas
232232

233233
---
234234

235-
## 🙏 Credits
236-
237-
This is a slimmed-down fork of [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) by [@code-yeongyu](https://github.com/code-yeongyu).
238-
239-
---
240-
241235
## 📄 License
242236

243237
MIT

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "oh-my-opencode-slim",
3-
"version": "0.6.2",
3+
"version": "0.6.3",
44
"description": "Lightweight agent orchestration plugin for OpenCode - a slimmed-down fork of oh-my-opencode",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/background/background-manager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ export class BackgroundTaskManager {
159159
this.activeStarts < this.maxConcurrentStarts &&
160160
this.startQueue.length > 0
161161
) {
162-
const task = this.startQueue.shift()!;
162+
const task = this.startQueue.shift();
163+
if (!task) break;
163164
this.startTask(task);
164165
}
165166
}

src/cli/config-io.test.ts

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { tmpdir } from 'node:os';
1212
import { join } from 'node:path';
1313
import {
1414
addPluginToOpenCodeConfig,
15-
addProviderConfig,
1615
detectCurrentConfig,
1716
disableDefaultAgents,
1817
parseConfig,
@@ -120,40 +119,23 @@ describe('config-io', () => {
120119
expect(saved.plugin.length).toBe(2);
121120
});
122121

123-
// Removed: addAuthPlugins test - auth plugin no longer used with cliproxy
124-
125-
test('addProviderConfig adds cliproxy provider config', () => {
126-
const configPath = join(tmpDir, 'opencode', 'opencode.json');
127-
paths.ensureConfigDir();
128-
writeFileSync(configPath, JSON.stringify({}));
129-
130-
const result = addProviderConfig({
131-
hasAntigravity: true,
132-
hasOpenAI: false,
133-
hasOpencodeZen: false,
134-
hasTmux: false,
135-
});
136-
expect(result.success).toBe(true);
137-
138-
const saved = JSON.parse(readFileSync(configPath, 'utf-8'));
139-
expect(saved.provider.cliproxy).toBeDefined();
140-
});
141-
142122
test('writeLiteConfig writes lite config', () => {
143123
const litePath = join(tmpDir, 'opencode', 'oh-my-opencode-slim.json');
144124
paths.ensureConfigDir();
145125

146126
const result = writeLiteConfig({
147-
hasAntigravity: true,
127+
hasKimi: true,
148128
hasOpenAI: false,
149129
hasOpencodeZen: false,
150130
hasTmux: true,
131+
installSkills: false,
132+
installCustomSkills: false,
151133
});
152134
expect(result.success).toBe(true);
153135

154136
const saved = JSON.parse(readFileSync(litePath, 'utf-8'));
155-
expect(saved.preset).toBe('cliproxy');
156-
expect(saved.presets.cliproxy).toBeDefined();
137+
expect(saved.preset).toBe('kimi');
138+
expect(saved.presets.kimi).toBeDefined();
157139
expect(saved.tmux.enabled).toBe(true);
158140
});
159141

@@ -180,7 +162,7 @@ describe('config-io', () => {
180162
JSON.stringify({
181163
plugin: ['oh-my-opencode-slim'],
182164
provider: {
183-
cliproxy: {
165+
kimi: {
184166
npm: '@ai-sdk/openai-compatible',
185167
},
186168
},
@@ -201,7 +183,7 @@ describe('config-io', () => {
201183

202184
const detected = detectCurrentConfig();
203185
expect(detected.isInstalled).toBe(true);
204-
expect(detected.hasAntigravity).toBe(true);
186+
expect(detected.hasKimi).toBe(true);
205187
expect(detected.hasOpenAI).toBe(true);
206188
expect(detected.hasTmux).toBe(true);
207189
});

src/cli/config-io.ts

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
getExistingConfigPath,
1313
getLiteConfig,
1414
} from './paths';
15-
import { CLIPROXY_PROVIDER_CONFIG, generateLiteConfig } from './providers';
15+
import { generateLiteConfig } from './providers';
1616
import type {
1717
ConfigMergeResult,
1818
DetectedConfig,
@@ -138,40 +138,7 @@ export async function addPluginToOpenCodeConfig(): Promise<ConfigMergeResult> {
138138
}
139139

140140
// Removed: addAuthPlugins - no longer needed with cliproxy
141-
142-
export function addProviderConfig(
143-
installConfig: InstallConfig,
144-
): ConfigMergeResult {
145-
const configPath = getExistingConfigPath();
146-
147-
try {
148-
ensureConfigDir();
149-
const { config: parsedConfig, error } = parseConfig(configPath);
150-
if (error) {
151-
return {
152-
success: false,
153-
configPath,
154-
error: `Failed to parse config: ${error}`,
155-
};
156-
}
157-
const config = parsedConfig ?? {};
158-
159-
if (installConfig.hasAntigravity) {
160-
const providers = (config.provider ?? {}) as Record<string, unknown>;
161-
providers.cliproxy = CLIPROXY_PROVIDER_CONFIG.cliproxy;
162-
config.provider = providers;
163-
}
164-
165-
writeConfig(configPath, config);
166-
return { success: true, configPath };
167-
} catch (err) {
168-
return {
169-
success: false,
170-
configPath,
171-
error: `Failed to add provider config: ${err}`,
172-
};
173-
}
174-
}
141+
// Removed: addProviderConfig - default opencode now has kimi provider config
175142

176143
export function writeLiteConfig(
177144
installConfig: InstallConfig,
@@ -239,7 +206,7 @@ export function disableDefaultAgents(): ConfigMergeResult {
239206
export function detectCurrentConfig(): DetectedConfig {
240207
const result: DetectedConfig = {
241208
isInstalled: false,
242-
hasAntigravity: false,
209+
hasKimi: false,
243210
hasOpenAI: false,
244211
hasOpencodeZen: false,
245212
hasTmux: false,
@@ -251,9 +218,9 @@ export function detectCurrentConfig(): DetectedConfig {
251218
const plugins = config.plugin ?? [];
252219
result.isInstalled = plugins.some((p) => p.startsWith(PACKAGE_NAME));
253220

254-
// Check for cliproxy provider instead of auth plugin
221+
// Check for kimi provider
255222
const providers = config.provider as Record<string, unknown> | undefined;
256-
result.hasAntigravity = !!providers?.cliproxy;
223+
result.hasKimi = !!providers?.kimi;
257224

258225
// Try to detect from lite config
259226
const { config: liteConfig } = parseConfig(getLiteConfig());

src/cli/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ function parseArgs(args: string[]): InstallArgs {
1010
for (const arg of args) {
1111
if (arg === '--no-tui') {
1212
result.tui = false;
13-
} else if (arg.startsWith('--antigravity=')) {
14-
result.antigravity = arg.split('=')[1] as BooleanArg;
13+
} else if (arg.startsWith('--kimi=')) {
14+
result.kimi = arg.split('=')[1] as BooleanArg;
1515
} else if (arg.startsWith('--openai=')) {
1616
result.openai = arg.split('=')[1] as BooleanArg;
1717
} else if (arg.startsWith('--tmux=')) {
@@ -32,15 +32,15 @@ oh-my-opencode-slim installer
3232
Usage: bunx oh-my-opencode-slim install [OPTIONS]
3333
3434
Options:
35-
--antigravity=yes|no Antigravity subscription (yes/no)
35+
--kimi=yes|no Kimi API access (yes/no)
3636
--openai=yes|no OpenAI API access (yes/no)
3737
--tmux=yes|no Enable tmux integration (yes/no)
3838
--no-tui Non-interactive mode (requires all flags)
3939
-h, --help Show this help message
4040
4141
Examples:
4242
bunx oh-my-opencode-slim install
43-
bunx oh-my-opencode-slim install --no-tui --antigravity=yes --openai=yes --tmux=no
43+
bunx oh-my-opencode-slim install --no-tui --kimi=yes --openai=yes --tmux=no
4444
`);
4545
}
4646

src/cli/install.ts

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as readline from 'node:readline/promises';
22
import {
33
addPluginToOpenCodeConfig,
4-
addProviderConfig,
54
detectCurrentConfig,
65
disableDefaultAgents,
76
generateLiteConfig,
@@ -107,9 +106,7 @@ function formatConfigSummary(config: InstallConfig): string {
107106
lines.push(`${BOLD}Configuration Summary${RESET}`);
108107
lines.push('');
109108
lines.push(` ${BOLD}Preset:${RESET} ${BLUE}${preset}${RESET}`);
110-
lines.push(
111-
` ${config.hasAntigravity ? SYMBOLS.check : `${DIM}${RESET}`} Antigravity`,
112-
);
109+
lines.push(` ${config.hasKimi ? SYMBOLS.check : `${DIM}${RESET}`} Kimi`);
113110
lines.push(
114111
` ${config.hasOpenAI ? SYMBOLS.check : `${DIM}${RESET}`} OpenAI`,
115112
);
@@ -153,7 +150,7 @@ function printAgentModels(config: InstallConfig): void {
153150

154151
function argsToConfig(args: InstallArgs): InstallConfig {
155152
return {
156-
hasAntigravity: args.antigravity === 'yes',
153+
hasKimi: args.kimi === 'yes',
157154
hasOpenAI: args.openai === 'yes',
158155
hasOpencodeZen: true, // Always enabled - free models available to all users
159156
hasTmux: args.tmux === 'yes',
@@ -192,10 +189,10 @@ async function runInteractiveMode(
192189

193190
try {
194191
console.log(`${BOLD}Question 1/${totalQuestions}:${RESET}`);
195-
const antigravity = await askYesNo(
192+
const kimi = await askYesNo(
196193
rl,
197-
'Do you have an Antigravity subscription (via cliproxy)?',
198-
'yes',
194+
'Do you want to use Kimi For Coding?',
195+
detected.hasKimi ? 'yes' : 'no',
199196
);
200197
console.log();
201198

@@ -240,7 +237,7 @@ async function runInteractiveMode(
240237
console.log();
241238

242239
return {
243-
hasAntigravity: antigravity === 'yes',
240+
hasKimi: kimi === 'yes',
244241
hasOpenAI: openai === 'yes',
245242
hasOpencodeZen: true,
246243
hasTmux: false,
@@ -260,7 +257,6 @@ async function runInstall(config: InstallConfig): Promise<number> {
260257

261258
// Calculate total steps dynamically
262259
let totalSteps = 4; // Base: check opencode, add plugin, disable default agents, write lite config
263-
if (config.hasAntigravity) totalSteps += 1; // provider config only (no auth plugin needed)
264260
if (config.installSkills) totalSteps += 1; // skills installation
265261
if (config.installCustomSkills) totalSteps += 1; // custom skills installation
266262

@@ -278,13 +274,6 @@ async function runInstall(config: InstallConfig): Promise<number> {
278274
const agentResult = disableDefaultAgents();
279275
if (!handleStepResult(agentResult, 'Default agents disabled')) return 1;
280276

281-
if (config.hasAntigravity) {
282-
printStep(step++, totalSteps, 'Adding cliproxy provider configuration...');
283-
const providerResult = addProviderConfig(config);
284-
if (!handleStepResult(providerResult, 'Cliproxy provider configured'))
285-
return 1;
286-
}
287-
288277
printStep(step++, totalSteps, 'Writing oh-my-opencode-slim configuration...');
289278
const liteResult = writeLiteConfig(config);
290279
if (!handleStepResult(liteResult, 'Config written')) return 1;
@@ -332,7 +321,7 @@ async function runInstall(config: InstallConfig): Promise<number> {
332321

333322
printAgentModels(config);
334323

335-
if (!config.hasAntigravity && !config.hasOpenAI) {
324+
if (!config.hasKimi && !config.hasOpenAI) {
336325
printWarning(
337326
'No providers configured. Zen Big Pickle models will be used as fallback.',
338327
);
@@ -347,27 +336,13 @@ async function runInstall(config: InstallConfig): Promise<number> {
347336

348337
let nextStep = 1;
349338

350-
if (config.hasAntigravity) {
351-
console.log(` ${nextStep++}. Install cliproxy:`);
352-
console.log(` ${DIM}macOS:${RESET}`);
353-
console.log(` ${BLUE}$ brew install cliproxyapi${RESET}`);
354-
console.log(` ${BLUE}$ brew services start cliproxyapi${RESET}`);
355-
console.log(` ${DIM}Linux:${RESET}`);
356-
console.log(
357-
` ${BLUE}$ curl -fsSL https://raw.githubusercontent.com/brokechubb/cliproxyapi-installer/refs/heads/master/cliproxyapi-installer | bash${RESET}`,
358-
);
359-
console.log();
360-
console.log(` ${nextStep++}. Authenticate with Antigravity via OAuth:`);
361-
console.log(` ${BLUE}$ ./cli-proxy-api --antigravity-login${RESET}`);
362-
console.log(
363-
` ${DIM}(Add --no-browser to print login URL instead of opening browser)${RESET}`,
364-
);
365-
console.log();
366-
}
367-
368-
if (config.hasOpenAI || !config.hasAntigravity) {
339+
if (config.hasKimi || config.hasOpenAI) {
369340
console.log(` ${nextStep++}. Authenticate with your providers:`);
370341
console.log(` ${BLUE}$ opencode auth login${RESET}`);
342+
if (config.hasKimi) {
343+
console.log();
344+
console.log(` Then select ${BOLD}Kimi For Coding${RESET} provider.`);
345+
}
371346
console.log();
372347
}
373348

@@ -388,7 +363,7 @@ async function runInstall(config: InstallConfig): Promise<number> {
388363
export async function install(args: InstallArgs): Promise<number> {
389364
// Non-interactive mode: all args must be provided
390365
if (!args.tui) {
391-
const requiredArgs = ['antigravity', 'openai', 'tmux'] as const;
366+
const requiredArgs = ['kimi', 'openai', 'tmux'] as const;
392367
const errors = requiredArgs.filter((key) => {
393368
const value = args[key];
394369
return value === undefined || !['yes', 'no'].includes(value);
@@ -402,7 +377,7 @@ export async function install(args: InstallArgs): Promise<number> {
402377
}
403378
console.log();
404379
printInfo(
405-
'Usage: bunx oh-my-opencode-slim install --no-tui --antigravity=<yes|no> --openai=<yes|no> --tmux=<yes|no>',
380+
'Usage: bunx oh-my-opencode-slim install --no-tui --kimi=<yes|no> --openai=<yes|no> --tmux=<yes|no>',
406381
);
407382
console.log();
408383
return 1;

0 commit comments

Comments
 (0)