fix: config improvements

This commit is contained in:
mitchell 2026-05-07 21:04:36 -04:00
parent a6422c51aa
commit e91a8a20a1

View file

@ -24,9 +24,15 @@ export async function initConfig(old: AppConfig | null): Promise<AppConfig> {
const models = await getModels(baseURL);
const model = await autocomplete({
message: "Choose a default model:",
initialValue: old?.model,
placeholder: old?.model,
initialValue: old?.model ?? models[0]?.value,
placeholder: old?.model ?? models[0]?.value,
options: models,
validate: (value) =>
models
.map((model) => model.value)
.includes(typeof value === "string" ? value : "")
? undefined
: `Unable to find model "${value}"`,
});
if (isCancel(model)) process.exit(1);