Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

docs(seeder): truncate long descriptions in list text output (#16398)

Nikita Kabardin5c22c1c28e2a
diff --git a/packages/shared/scripts/seeder/cli-main.ts b/packages/shared/scripts/seeder/cli-main.ts
index d6b3487536..f2b91f73f5 100644
--- a/packages/shared/scripts/seeder/cli-main.ts
+++ b/packages/shared/scripts/seeder/cli-main.ts
@@ -64,6 +64,16 @@ const baseUrl = (process.env.NEXTAUTH_URL ?? "http://localhost:3000").replace(
"",
);
+const truncateDescription = (text: string, maxLen = 100): string => {
+ if (text.length <= maxLen) return text;
+ const cut = text.slice(0, maxLen);
+ const lastSpace = cut.lastIndexOf(" ");
+ // Keep at least 60% of the budget before bailing on the word boundary, so
+ // we don't return a useless 3-character stub if a single word is huge.
+ const wordEnd = lastSpace > maxLen * 0.6 ? lastSpace : maxLen;
+ return `${cut.slice(0, wordEnd).trimEnd()}…`;
+};
+
const usage = (): string => {
const lines = [
"Langfuse seed CLI — one-shot local test data.",
@@ -230,7 +240,9 @@ const main = async (): Promise<number> => {
} else {
for (const scenario of listed) {
const v4Marker = scenario.supportsV4 ? " [v4]" : "";
- console.log(`${scenario.name}${v4Marker}\n ${scenario.description}`);
+ console.log(
+ `${scenario.name}${v4Marker}\n ${truncateDescription(scenario.description)}`,
+ );
for (const flag of scenario.flags) {
console.log(
` --${flag.flag.padEnd(24)} default: ${String(flag.default) || '""'} ${flag.description}`,