From e0371ccbc5552257802b8edd02218caad4b2aba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20=22Dezzy=22=20Victor?= Date: Fri, 31 Jul 2026 13:10:48 -0300 Subject: [PATCH] models list: stop truncating ids MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `padding(toLength:)` truncates when the string is longer than the target, so any id past 26 characters was printed cut off — and a cut id cannot be pasted into `parrot models download`. Size the column to the longest id instead. --- Sources/parrot/Parrot.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/parrot/Parrot.swift b/Sources/parrot/Parrot.swift index 05a69ebe..7a3614a3 100644 --- a/Sources/parrot/Parrot.swift +++ b/Sources/parrot/Parrot.swift @@ -196,9 +196,13 @@ struct Models: ParsableCommand { struct List: ParsableCommand { func run() throws { + // Column width follows the longest id: `padding(toLength:)` truncates + // when the string is longer, and a truncated id cannot be copied into + // `parrot models download`. + let width = ModelRegistry.shared.map(\.id.count).max() ?? 26 for m in ModelRegistry.shared { let star = m.recommended ? "★" : " " - let id = m.id.padding(toLength: 26, withPad: " ", startingAt: 0) + let id = m.id.padding(toLength: width, withPad: " ", startingAt: 0) let langs = "[\(m.languages.joined(separator: ","))]" .padding(toLength: 9, withPad: " ", startingAt: 0) let size = String(format: "%5d MB", m.sizeMB)