-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunicornsh.source
27 lines (22 loc) · 1.6 KB
/
unicornsh.source
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# If AI enabled, add a unicorn in front of the prompt
PS1="$(if [[ -n $SCRIPT ]]; then echo '\n🦄'; fi)$PS1"
export PATH=$PATH:~/.unicornsh/scripts:~/.unicornsh/bin
# Pipe the context into the sgpt command
# ai = sgpt
# s = shell mode
# r = repl mode
# f = function calling
# l = Use last 500 lines of output from the shell instead of the default 50
### Model variables
alias ai='~/.unicornsh/scripts/aicontext.sh | sgpt --no-functions $(if [[ -n $AISESSION ]]; then echo "--chat $AISESSION"; fi)'
alias ail='~/.unicornsh/scripts/aicontext.sh 500 | sgpt --no-functions $(if [[ -n $AISESSION ]]; then echo "--chat $AISESSION"; fi)'
alias ais='~/.unicornsh/scripts/aicontext.sh | sgpt --no-functions --shell $(if [[ -n $AISESSION ]]; then echo "--chat $AISESSION"; fi)'
alias aisl='~/.unicornsh/scripts/aicontext.sh 500 | sgpt --no-functions --shell $(if [[ -n $AISESSION ]]; then echo "--chat $AISESSION"; fi)'
alias air='~/.unicornsh/scripts/aicontext.sh | sgpt --no-functions --repl $(if [[ -n $AISESSION ]]; then echo "$AISESSION"; else echo "temp"; fi)'
alias aif='~/.unicornsh/scripts/aicontext.sh | sgpt $(if [[ -n $AISESSION ]]; then echo "--chat $AISESSION"; fi)'
alias airf='~/.unicornsh/scripts/aicontext.sh | sgpt --repl $(if [[ -n $AISESSION ]]; then echo "$AISESSION"; else echo "temp"; fi)'
alias airfl='~/.unicornsh/scripts/aicontext.sh 500 | sgpt --repl $(if [[ -n $AISESSION ]]; then echo "$AISESSION"; else echo "temp"; fi)'
### Other tools
alias aiStartSession='export AISESSION=$(date -u +"%Y-%m-%dT%H:%M:%SZ")'
alias aiStopSession='unset AISESSION'
alias aiShowSession='echo "AISESSION is set to $AISESSION"'