mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
- 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)
20 lines
466 B
TypeScript
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);
|
|
}
|