Files
workspace/arch-user/bin/ai
2026-03-01 18:09:50 +00:00

22 lines
285 B
Bash
Executable File

#!/bin/bash
session_ts="$(date +%s)"
role="$1"
shift
work() {
aichat --save-session --session "$session_ts" --role "$role" "$*"
}
if [ -n "$1" ]; then
work "$@"
fi
while true; do
read -e -r -p "> " input
if [ -z "$input" ]; then
input="$(rlwrap cat)"
fi
work "$input"
done