Pin that one override still asks, and say where the catalog and the entry go

This commit is contained in:
2026-09-26 19:59:43 +02:00
parent d4ae61a685
commit 413aa2f638
3 changed files with 7 additions and 4 deletions
+2 -2
View File
@@ -276,14 +276,14 @@ def read_models(saved):
def ask_model(name, saved):
if not (sys.stdin.isatty() and sys.stdout.isatty()):
print(f"{name} has no model in {saved}, and stdin or stdout is not a terminal to ask on; run it on a terminal or add \"{name}\": \"<model>\" to {saved}", file=sys.stderr)
print(f"{name} has no model in {saved}, and stdin or stdout is not a terminal to ask on; run it on a terminal or add \"{name}\": \"<model>\" to the JSON object in {saved}", file=sys.stderr)
sys.exit(2)
offered = catalog()
print(f"\nThe model to run {name} on, saved in {saved}:", file=sys.stderr)
for number, (model_id, label) in enumerate(offered, 1):
print(f" {number}. {label} ({model_id})", file=sys.stderr)
if not offered:
print(" no model catalog cached; running claude once fills it", file=sys.stderr)
print(" no model catalog cached in ~/.claude/cache/model-catalog", file=sys.stderr)
while True:
try:
answer = input(f"{'A number, or any' if offered else 'A'} name claude --model takes: ").strip()