chatgpt-cli/run.sh

18 lines
313 B
Bash
Raw Permalink Normal View History

2023-03-14 11:57:05 -05:00
#!/bin/sh
prompt=${1:-}
cd /opt/app/chatgpt-cli || exit
sh .env/bin/activate
if [ -n "$prompt" ]; then
context="/opt/app/prompts/$prompt.txt"
if [ ! -f "$context" ]; then
echo "Prompt file does not exist [$context]."
exit 1
fi
python chatgpt.py --context "$context"
else
python chatgpt.py
fi