anycodex 0.0.16 → 0.0.17

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.
Files changed (2) hide show
  1. package/dist/bin.js +15 -3
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -22,7 +22,7 @@ import fs5 from "fs";
22
22
  import readline from "readline";
23
23
  import { fileURLToPath as fileURLToPath2 } from "url";
24
24
 
25
- // ../server/dist/chunk-YOFLJZXT.js
25
+ // ../server/dist/chunk-55FJSWGH.js
26
26
  import http from "http";
27
27
  import { fileURLToPath } from "url";
28
28
  import path3 from "path";
@@ -465,7 +465,7 @@ function loadConfig() {
465
465
  userSettings = JSON.parse(fs4.readFileSync(path3.join(ANYCODE_DIR, "settings.json"), "utf-8"));
466
466
  } catch {
467
467
  }
468
- const provider = process.env.PROVIDER ?? "";
468
+ const provider = process.env.PROVIDER ?? userSettings.PROVIDER ?? "anthropic";
469
469
  const model = process.env.MODEL ?? userSettings.MODEL ?? "claude-sonnet-4-20250514";
470
470
  const apiKey = process.env.API_KEY ?? userSettings.API_KEY ?? "";
471
471
  const baseUrl = process.env.BASE_URL ?? userSettings.BASE_URL ?? "";
@@ -1915,12 +1915,24 @@ function prompt(question) {
1915
1915
  async function ensureSettings() {
1916
1916
  const settings = loadSettings();
1917
1917
  let changed = false;
1918
- if (!settings.API_KEY) {
1918
+ if (!settings.PROVIDER) {
1919
1919
  blank();
1920
1920
  console.log(` ${c.bold}${c.white}Welcome! Let's configure your LLM provider.${c.reset}`);
1921
1921
  blank();
1922
1922
  divider();
1923
1923
  blank();
1924
+ const val = await prompt(` ${c.cyan}?${c.reset} ${c.bold}Provider${c.reset} ${c.gray}(anthropic, openai)${c.reset}: `);
1925
+ settings.PROVIDER = val || "anthropic";
1926
+ changed = true;
1927
+ }
1928
+ if (!settings.API_KEY) {
1929
+ if (!changed) {
1930
+ blank();
1931
+ console.log(` ${c.bold}${c.white}Welcome! Let's configure your LLM provider.${c.reset}`);
1932
+ blank();
1933
+ divider();
1934
+ blank();
1935
+ }
1924
1936
  settings.API_KEY = await prompt(` ${c.cyan}?${c.reset} ${c.bold}API Key${c.reset} ${c.gray}(required)${c.reset}: `);
1925
1937
  if (!settings.API_KEY) {
1926
1938
  fail("API Key is required to continue.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anycodex",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"