16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/llmemory/cli/commands/long_term/facts.rb', line 16
def execute(argv, _opts)
user_id = argv.first
unless user_id
$stderr.puts "Usage: llmemory facts USER_ID [--category CATEGORY] [--limit N]"
exit 1
end
storage = file_based_storage(@store_type)
items = storage.list_items(user_id: user_id, category: @category, limit: @limit)
if items.empty?
puts "No facts found for user #{user_id}."
return
end
items.each do |i|
cat = i[:category] || i["category"]
content = (i[:content] || i["content"]).to_s
created = i[:created_at] || i["created_at"]
puts "[#{cat}] #{content} (#{created})"
end
end
|