Files
OmniRoute/src/lib/cli-helper/config-generator/cline.ts
oyi77 2d601ea459 feat: CLI Integration Suite for issue #2016
- Add tool-detector.ts (6 CLI tools: claude, codex, opencode, cline, kilocode, continue)
- Add config-generator/ factory + 6 generators (JSON + YAML)
- Add doctor/checks.ts for CLI tool health checks
- Add log-streamer.ts for usage log streaming
- Add @omniroute/opencode-provider npm package
- Add 5 CLI commands: config, status, logs, update, provider
- Add 3 API routes: config, detect, apply
- Update bin/omniroute.mjs, bin/cli/index.mjs, package.json
- Update docs: SETUP_GUIDE.md, CLI-TOOLS.md
- All tests pass (4302/4326, 24 pre-existing failures unchanged)
2026-05-14 17:26:30 +07:00

20 lines
466 B
TypeScript

import path from "node:path";
import os from "node:os";
const CONFIG_PATH = path.join(os.homedir(), ".cline", "data", "globalState.json");
export function generateClineConfig(options: {
baseUrl: string;
apiKey: string;
model?: string;
}): string {
const base = options.baseUrl.replace(/\/+$/, "").replace(/\/v1$/, "");
const config = {
openAiBaseUrl: `${base}/v1`,
openAiApiKey: options.apiKey,
};
return JSON.stringify(config, null, 2);
}