@naram/codex-switch 0.1.0 → 0.1.2
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 +18 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1202,7 +1202,7 @@ function buildConfigToml(spec) {
|
|
|
1202
1202
|
lines.push(`[model_providers.${tomlKeyPath(providerId)}]`);
|
|
1203
1203
|
lines.push(`name = ${tomlString(providerId)}`);
|
|
1204
1204
|
lines.push(`base_url = ${tomlString(spec.baseUrl)}`);
|
|
1205
|
-
lines.push(`wire_api = ${tomlString(spec.wireApi ?? "
|
|
1205
|
+
lines.push(`wire_api = ${tomlString(spec.wireApi ?? "responses")}`);
|
|
1206
1206
|
if (authMethod === "envKey") {
|
|
1207
1207
|
if (!spec.envVar) throw new Error("env_key authentication requires an env var name.");
|
|
1208
1208
|
lines.push(`env_key = ${tomlString(spec.envVar)}`);
|
|
@@ -1244,7 +1244,7 @@ function applyProfile(spec) {
|
|
|
1244
1244
|
const codexHome = codexHomeFor(spec.alias);
|
|
1245
1245
|
ensureDir(codexHome, 448);
|
|
1246
1246
|
const authMethod = spec.custom ? spec.authMethod ?? "envKey" : spec.authMethod;
|
|
1247
|
-
const wireApi = spec.custom ? spec.wireApi ?? "
|
|
1247
|
+
const wireApi = spec.custom ? spec.wireApi ?? "responses" : void 0;
|
|
1248
1248
|
const profileFiles = writeProfileSettings(spec.alias, {
|
|
1249
1249
|
custom: spec.custom,
|
|
1250
1250
|
baseUrl: spec.baseUrl,
|
|
@@ -1513,10 +1513,18 @@ async function runCreate() {
|
|
|
1513
1513
|
wireApi = ensure(
|
|
1514
1514
|
await ie({
|
|
1515
1515
|
message: "Wire protocol",
|
|
1516
|
-
initialValue: "
|
|
1516
|
+
initialValue: "responses",
|
|
1517
1517
|
options: [
|
|
1518
|
-
{
|
|
1519
|
-
|
|
1518
|
+
{
|
|
1519
|
+
value: "responses",
|
|
1520
|
+
label: "Responses",
|
|
1521
|
+
hint: "required by current Codex; OpenRouter, OpenAI-native, \u2026"
|
|
1522
|
+
},
|
|
1523
|
+
{
|
|
1524
|
+
value: "chat",
|
|
1525
|
+
label: "Chat Completions",
|
|
1526
|
+
hint: "legacy \u2014 rejected by current Codex CLI"
|
|
1527
|
+
}
|
|
1520
1528
|
]
|
|
1521
1529
|
})
|
|
1522
1530
|
);
|
|
@@ -1531,7 +1539,8 @@ async function runCreate() {
|
|
|
1531
1539
|
const m2 = ensure(
|
|
1532
1540
|
await te({
|
|
1533
1541
|
message: "Default model (optional, Enter to skip)",
|
|
1534
|
-
placeholder: "anthropic/claude-sonnet-4.5"
|
|
1542
|
+
placeholder: "anthropic/claude-sonnet-4.5",
|
|
1543
|
+
defaultValue: ""
|
|
1535
1544
|
})
|
|
1536
1545
|
).trim();
|
|
1537
1546
|
model = m2 || void 0;
|
|
@@ -1546,7 +1555,8 @@ async function runCreate() {
|
|
|
1546
1555
|
const m2 = ensure(
|
|
1547
1556
|
await te({
|
|
1548
1557
|
message: "Default model",
|
|
1549
|
-
placeholder: "gpt-5.5"
|
|
1558
|
+
placeholder: "gpt-5.5",
|
|
1559
|
+
defaultValue: ""
|
|
1550
1560
|
})
|
|
1551
1561
|
).trim();
|
|
1552
1562
|
model = m2 || void 0;
|
|
@@ -1902,7 +1912,7 @@ async function runRemove(aliasArg) {
|
|
|
1902
1912
|
}
|
|
1903
1913
|
|
|
1904
1914
|
// src/index.ts
|
|
1905
|
-
var VERSION = "0.1.
|
|
1915
|
+
var VERSION = "0.1.2";
|
|
1906
1916
|
var HELP = `${color.bold("codex-switch")} \u2014 set up isolated Codex profiles
|
|
1907
1917
|
|
|
1908
1918
|
${color.bold("USAGE")}
|