@quikcommit/cli 13.2.0 → 13.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +24 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11636,12 +11636,32 @@ function setConfig(key, value) {
|
|
|
11636
11636
|
if (key === "model") {
|
|
11637
11637
|
updates.model = value;
|
|
11638
11638
|
} else if (key === "provider") {
|
|
11639
|
-
const
|
|
11640
|
-
if (
|
|
11641
|
-
|
|
11639
|
+
const v = value.toLowerCase();
|
|
11640
|
+
if (v === "cloud" || v === "cloudflare-saas") {
|
|
11641
|
+
const { provider: _, apiUrl: __, model: ___, ...rest } = cfg;
|
|
11642
|
+
saveConfig(rest);
|
|
11643
|
+
console.log("Switched to Cloudflare SaaS (default).");
|
|
11644
|
+
return;
|
|
11645
|
+
}
|
|
11646
|
+
const providers = {
|
|
11647
|
+
ollama: { provider: "ollama", apiUrl: "http://localhost:11434", model: "codellama" },
|
|
11648
|
+
lmstudio: { provider: "lmstudio", apiUrl: "http://localhost:1234/v1", model: "default" },
|
|
11649
|
+
openrouter: { provider: "openrouter", apiUrl: "https://openrouter.ai/api/v1", model: "google/gemini-flash-1.5-8b" },
|
|
11650
|
+
custom: { provider: "custom", apiUrl: cfg.apiUrl ?? "", model: cfg.model ?? "" },
|
|
11651
|
+
cloudflare: { provider: "cloudflare", apiUrl: cfg.apiUrl ?? "", model: "@cf/qwen/qwen2.5-coder-32b-instruct" }
|
|
11652
|
+
};
|
|
11653
|
+
const preset = providers[v];
|
|
11654
|
+
if (!preset) {
|
|
11655
|
+
console.error(`Unknown provider: ${v}`);
|
|
11656
|
+
console.error(" Options: cloud, ollama, lmstudio, openrouter, custom, cloudflare");
|
|
11642
11657
|
process.exit(1);
|
|
11643
11658
|
}
|
|
11644
|
-
|
|
11659
|
+
saveConfig({ ...cfg, ...preset });
|
|
11660
|
+
console.log(`Provider set to ${preset.provider} (${preset.apiUrl || "set api_url next"}).`);
|
|
11661
|
+
if (v === "cloudflare" && !cfg.apiUrl) {
|
|
11662
|
+
console.log(" Next: qc config set api_url https://your-worker.workers.dev");
|
|
11663
|
+
}
|
|
11664
|
+
return;
|
|
11645
11665
|
} else if (key === "api_url") {
|
|
11646
11666
|
try {
|
|
11647
11667
|
new URL(value);
|