File tree 1 file changed +20
-8
lines changed
scripts/.local/bin/random
1 file changed +20
-8
lines changed Original file line number Diff line number Diff line change 4
4
5
5
chatgpt --clear-history > /dev/null
6
6
7
- # get the input text from stdin else ask for input
8
- if [ -p /dev/stdin ]; then
9
- input=$( cat)
10
- else
11
- printf " Content: " >&2
12
- read -r input
13
- fi
14
-
15
7
if [ -n " $2 " ]; then
16
8
chatgpt " $* "
17
9
else
10
+ # get the input text from stdin else ask for input
11
+ if [ -p /dev/stdin ]; then
12
+ input=$( cat)
13
+ else
14
+ printf " Content: " >&2
15
+ read -r input
16
+ fi
17
+
18
18
echo " $input " |
19
19
case " $1 " in
20
20
" professional" )
26
26
" email" )
27
27
chatgpt " Make this into a casual business email."
28
28
;;
29
+ " summarize" )
30
+ chatgpt " Can you summarize this message?"
31
+ ;;
32
+ " summary" )
33
+ chatgpt " Can you summarize this message?"
34
+ ;;
35
+ " keypoints" )
36
+ chatgpt " List the key points of this message."
37
+ ;;
38
+ * )
39
+ chatgpt " $1 "
40
+ ;;
29
41
esac
30
42
fi
You can’t perform that action at this time.
0 commit comments