From 327d64e63f5963ef39c3ef03d386cda69dfb8e3a Mon Sep 17 00:00:00 2001 From: dingguagua996-stack Date: Tue, 24 Mar 2026 19:28:44 +0800 Subject: [PATCH] fix: exclude vector arrays from CLI --json output The --json output for list/search/stats commands included full vector arrays (768-1024 dimensional floats), making output extremely verbose and unreadable. Use a JSON replacer function in formatJson() to automatically filter out 'vector' fields. This is consistent with the export command which already strips vectors (line 888). Fixes CortexReach/memory-lancedb-pro#302 --- cli.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli.ts b/cli.ts index 99203916..fea238bf 100644 --- a/cli.ts +++ b/cli.ts @@ -406,7 +406,11 @@ function formatMemory(memory: any, index?: number): string { } function formatJson(obj: any): string { - return JSON.stringify(obj, null, 2); + return JSON.stringify(obj, (key, value) => { + // Exclude verbose vector arrays from CLI output + if (key === "vector") return undefined; + return value; + }, 2); } async function sleep(ms: number): Promise {