summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-04-28 14:19:55 -0400
committerBen Sima <ben@bensima.com>2025-04-28 14:19:55 -0400
commit041be01116c8ab8c41d15f16b2ef71c1c949e7a9 (patch)
tree2c2e909aaee3bc3c8a390866147c0039cc236387
parenteff8592cd47b48febb3a09c3d593bb10ee310e5a (diff)
init vicar assistant prototype
-rwxr-xr-xvicar25
1 files changed, 25 insertions, 0 deletions
diff --git a/vicar b/vicar
new file mode 100755
index 0000000..0f1be17
--- /dev/null
+++ b/vicar
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+#
+# vicar assistant
+
+show_help() {
+ echo "Usage: $0 <command>"
+ echo ""
+ echo "Commands:"
+ echo " inbox summarize unread inbox for the last 7 days"
+}
+
+MODEL="local-gemma"
+
+# Check if there's exactly one argument and it's 'inbox'
+if [ $# -eq 1 ] && [ "$1" = "inbox" ]; then
+ date_fmt="+%Y-%m-%d"
+ beg=$(date -d '7 days ago' $date_fmt)
+ end=$(date $date_fmt)
+ mu find "flag:unseen date:$beg..$end" maildir:/ben@bensima.com/Inbox \
+ --format=json | jq '.[]|.":path"' | xargs mu view | llm -m $MODEL -s 'summarize these emails'
+else
+ show_help
+fi
+
+