@quikcommit/cli 13.1.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 +30 -6
- 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);
|
|
@@ -11951,6 +11971,11 @@ async function runCommit(args) {
|
|
|
11951
11971
|
}
|
|
11952
11972
|
process.exit(1);
|
|
11953
11973
|
}
|
|
11974
|
+
const { getLocalProviderConfig: getLocalProviderConfig2, runLocalCommit: runLocalCommit2 } = await Promise.resolve().then(() => (init_local(), local_exports));
|
|
11975
|
+
if (getLocalProviderConfig2()) {
|
|
11976
|
+
await runLocalCommit2(args);
|
|
11977
|
+
return;
|
|
11978
|
+
}
|
|
11954
11979
|
const apiKey = apiKeyFlag ?? getApiKey();
|
|
11955
11980
|
if (!apiKey) {
|
|
11956
11981
|
log.error("Not authenticated. Run `qc login` first.");
|
|
@@ -12723,8 +12748,7 @@ async function main() {
|
|
|
12723
12748
|
await runLocalCommit2(values);
|
|
12724
12749
|
return;
|
|
12725
12750
|
}
|
|
12726
|
-
|
|
12727
|
-
if (!apiKeyToUse) {
|
|
12751
|
+
{
|
|
12728
12752
|
const { getLocalProviderConfig: getLocalProviderConfig2 } = await Promise.resolve().then(() => (init_local(), local_exports));
|
|
12729
12753
|
if (getLocalProviderConfig2()) {
|
|
12730
12754
|
const { runLocalCommit: runLocalCommit2 } = await Promise.resolve().then(() => (init_local(), local_exports));
|