Skip to content

Commit

Permalink
[scripts] ayo: convert ayo to a script and add templates
Browse files Browse the repository at this point in the history
  • Loading branch information
meain committed Aug 8, 2024
1 parent 5781596 commit 78dda94
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
30 changes: 30 additions & 0 deletions scripts/.local/bin/random/ayo
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh

set -e

chatgpt --clear-history >/dev/null

# get the input text from stdin else ask for input
if [ -p /dev/stdin ]; then
input=$(cat)
else
printf "Content: " >&2
read -r input
fi

if [ -n "$2" ]; then
chatgpt "$*"
else
echo "$input" |
case "$1" in
"professional")
chatgpt "Make this message sound more professional but not lame. This is a chat message and so no need for signing like in an email."
;;
"lame")
chatgpt "Make this into a dead serious corporate sounding message. This is a chat message and so no need for signing like in an email."
;;
"email")
chatgpt "Make this into a casual business email."
;;
esac
fi
5 changes: 0 additions & 5 deletions zsh/.config/zsh/functions
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,4 @@ er() {
fi

cd "$tmp" || return 1
}

ayo(){
chatgpt --clear-history >/dev/null
chatgpt "$*"
}

0 comments on commit 78dda94

Please sign in to comment.