@iola_adm/iola-cli 0.2.22 → 0.2.23
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/package.json +1 -1
- package/src/cli.js +24 -3
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -6434,12 +6434,33 @@ async function listAiModels(provider) {
|
|
|
6434
6434
|
];
|
|
6435
6435
|
}
|
|
6436
6436
|
|
|
6437
|
+
return listCodexModels();
|
|
6438
|
+
}
|
|
6439
|
+
|
|
6440
|
+
async function listCodexModels() {
|
|
6437
6441
|
const version = await getCommandVersion("codex", ["--version"]);
|
|
6442
|
+
const cacheFile = path.join(os.homedir(), ".codex", "models_cache.json");
|
|
6443
|
+
try {
|
|
6444
|
+
const cache = JSON.parse(await readFile(cacheFile, "utf8"));
|
|
6445
|
+
const models = (cache.models || [])
|
|
6446
|
+
.filter((model) => model?.slug && (model.visibility === "list" || model.visibility === undefined))
|
|
6447
|
+
.sort((left, right) => Number(right.priority || 0) - Number(left.priority || 0))
|
|
6448
|
+
.map((model) => ({
|
|
6449
|
+
id: model.slug,
|
|
6450
|
+
provider: "codex",
|
|
6451
|
+
note: `${model.display_name || model.slug} - ${version}`,
|
|
6452
|
+
priority: Number(model.priority || 0),
|
|
6453
|
+
contextWindow: model.context_window || model.max_context_window || null,
|
|
6454
|
+
}));
|
|
6455
|
+
if (models.length > 0) return models;
|
|
6456
|
+
} catch {
|
|
6457
|
+
// Fallback below covers fresh installs before Codex creates models_cache.json.
|
|
6458
|
+
}
|
|
6438
6459
|
return [
|
|
6439
6460
|
{ id: "gpt-5.5", provider: "codex", note: version },
|
|
6440
|
-
{ id: "gpt-5", provider: "codex", note: version },
|
|
6441
|
-
{ id: "gpt-5-
|
|
6442
|
-
{ id: "gpt-5-
|
|
6461
|
+
{ id: "gpt-5.4", provider: "codex", note: version },
|
|
6462
|
+
{ id: "gpt-5.4-mini", provider: "codex", note: version },
|
|
6463
|
+
{ id: "gpt-5.3-codex-spark", provider: "codex", note: version },
|
|
6443
6464
|
];
|
|
6444
6465
|
}
|
|
6445
6466
|
|