feat: Integrate Ollama and Fabric with Docker setup and testing scripts

This commit is contained in:
Peter Wood
2025-05-29 16:59:32 -04:00
parent f022215ac1
commit a05f5c6d9d
5 changed files with 547 additions and 3 deletions

View File

@@ -117,7 +117,7 @@ load-nvmrc() {
add-zsh-hook chpwd load-nvmrc
load-nvmrc
[[ -s /home/acedanger/.autojump/etc/profile.d/autojump.sh ]] && source /home/acedanger/.autojump/etc/profile.d/autojump.sh
[[ -s /home/acedanger/.autojump/etc/profile.d/autojump.sh ]] && source /home/acedanger/.autojump/etc/profile.d/autojump.sh
# Enable bash completion compatibility in zsh
autoload -U +X bashcompinit && bashcompinit
@@ -127,3 +127,45 @@ autoload -U compinit && compinit -u
if [ -f "$HOME/shell/completions/backup-scripts-completion.bash" ]; then
source "$HOME/shell/completions/backup-scripts-completion.bash"
fi
# Go environment variables (required for Fabric and other Go tools)
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
# Fabric AI - Pattern aliases and helper functions
if command -v fabric &> /dev/null; then
# Loop through all directories in the ~/.config/fabric/patterns directory to create aliases
if [ -d "$HOME/.config/fabric/patterns" ]; then
for pattern_dir in $HOME/.config/fabric/patterns/*/; do
if [ -d "$pattern_dir" ]; then
# Get the base name of the directory (i.e., remove the directory path)
pattern_name=$(basename "$pattern_dir")
# Create an alias in the form: alias pattern_name="fabric --pattern pattern_name"
alias_command="alias $pattern_name='fabric --pattern $pattern_name'"
# Evaluate the alias command to add it to the current shell
eval "$alias_command"
fi
done
fi
# YouTube transcript helper function
yt() {
if [ "$#" -eq 0 ] || [ "$#" -gt 2 ]; then
echo "Usage: yt [-t | --timestamps] youtube-link"
echo "Use the '-t' flag to get the transcript with timestamps."
return 1
fi
transcript_flag="--transcript"
if [ "$1" = "-t" ] || [ "$1" = "--timestamps" ]; then
transcript_flag="--transcript-with-timestamps"
shift
fi
local video_link="$1"
fabric -y "$video_link" $transcript_flag
}
fi