generated from google-gemini/aistudio-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
116 lines (101 loc) · 4.13 KB
/
.bashrc
File metadata and controls
116 lines (101 loc) · 4.13 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# ~/.bashrc: Executed by bash(1) for non-login shells.
# Refactored for WSL1 Debian + Ollama Slim-Edition + 2Pi/8-Agents (NEXUS/AI)
# =============================================================================
# 1. INTERACTIVE CHECK
# =============================================================================
case $- in
*i*) ;;
*) return;;
esac
# =============================================================================
# 2. HISTORY & WINDOW SETTINGS
# =============================================================================
HISTCONTROL=ignoreboth
shopt -s histappend
HISTSIZE=5000
HISTFILESIZE=10000
shopt -s checkwinsize
# =============================================================================
# 3. PROMPT & COLOR SETTINGS
# =============================================================================
force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]: \[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
fi
# =============================================================================
# 4. EXTERNAL TOOLS (Brew, NVM)
# =============================================================================
# Linuxbrew
if [ -d "/home/linuxbrew/.linuxbrew" ]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
# NVM (Node Version Manager)
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
# =============================================================================
# 5. OLLAMA STARTUP & OPTIMIZATION (WSL1)
# =============================================================================
export OLLAMA_HOST="http://localhost:11434"
export OLLAMA_KEEP_ALIVE="10m"
export OLLAMA_MAX_LOADED_MODELS="1"
# Check if Ollama is running
if ! pgrep -x "ollama" > /dev/null; then
echo "[System] Starting Ollama (Slim-Edition)..."
mkdir -p "$HOME/.gemini/tmp"
nohup ollama serve > "$HOME/.gemini/tmp/ollama.log" 2>&1 &
sleep 1
fi
# =============================================================================
# 6. NEXUS-AI WORKFLOW OPTIMIZATION
# =============================================================================
export AI_DIR="$HOME/_/ai"
export NEXUS_ROOT="$HOME/_"
export PATH="$PATH:$AI_DIR"
# Core Aliases
alias ai="$AI_DIR/ai.sh"
alias zen="$AI_DIR/ai.sh"
alias nx-sys="$NEXUS_ROOT/nexus-system.sh"
alias nx-shell="python3 $NEXUS_ROOT/nexus-shell.py"
alias nx-pdf="python3 $NEXUS_ROOT/nexus-pdf-generate.py"
alias nx-init="$NEXUS_ROOT/gemini-cli.installer.sh"
alias nx-logs="tail -f $HOME/.gemini/tmp/ollama.log"
alias nx-db="sqlite3 $NEXUS_ROOT/memory.db"
alias nx-scan="ai reason \"scan all recursive folders of this repository for having a complete system-scan check\""
# Git Integrity Helper
alias nx-git-fix="git reflog expire --expire=now --all && git gc --prune=now && git fsck"
# Status function
ai_status() {
echo "=== NEXUS-AI System Status ==="
echo "Ollama: $(pgrep -x ollama >/dev/null && echo 'Active' || echo 'Inactive')"
echo "Agent Script: $(which ai 2>/dev/null || echo 'ai.sh in '$AI_DIR)"
echo "Memory DB: $([ -f $NEXUS_ROOT/memory.db ] && echo 'Present' || echo 'Missing')"
}
# Auto-complete for 'ai' command
if [ -f "$AI_DIR/ai.sh" ]; then
complete -W "reason refactor batch scan analyze files recall stats cleanup export agents models help" ai
fi
# =============================================================================
# 7. FINALIZATION
# =============================================================================
if [ -f "$HOME/.env.local/bin/activate" ]; then
source "$HOME/.env.local/bin/activate"
fi