15
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/resources.rb', line 15
def execute(argv, _opts)
user_id = argv.first
unless user_id
$stderr.puts "Usage: llmemory resources USER_ID [--limit N]"
exit 1
end
storage = file_based_storage(@store_type)
resources = storage.list_resources(user_id: user_id, limit: @limit)
if resources.empty?
puts "No resources found for user #{user_id}."
return
end
resources.each do |r|
id = r[:id] || r["id"]
text = (r[:text] || r["text"]).to_s
text = text[0, 150] + "..." if text.length > 150
created = r[:created_at] || r["created_at"]
puts "#{id}: #{text} (#{created})"
end
end
|