-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·133 lines (117 loc) · 4.63 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·133 lines (117 loc) · 4.63 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/usr/bin/env bash
set -e
# ==============================================================================
# DevMemory AI v1.1.0 — Automated One-Click Installer (macOS & Linux)
# ==============================================================================
BOLD='\033[1m'
GREEN='\033[0;32m'
CYAN='\033[0;36m'
YELLOW='\033[0;33m'
RED='\033[0;31m'
RESET='\033[0m'
info() {
echo -e "${CYAN}${BOLD}[INFO]${RESET} $1"
}
success() {
echo -e "${GREEN}${BOLD}[SUCCESS]${RESET} $1"
}
warn() {
echo -e "${YELLOW}${BOLD}[WARN]${RESET} $1"
}
error() {
echo -e "${RED}${BOLD}[ERROR]${RESET} $1"
}
echo -e "${BOLD}${CYAN}"
echo "========================================================"
echo " DevMemory AI v1.1.0 Installation "
echo " Automated Setup for macOS & Linux (Git, Bun, Ollama) "
echo "========================================================"
echo -e "${RESET}"
# 1. Detect & Install Git
if command -v git >/dev/null 2>&1; then
success "Git is already installed: $(git --version)"
else
info "Git not found. Attempting automatic installation..."
if [[ "$OSTYPE" == "darwin"* ]]; then
if command -v brew >/dev/null 2>&1; then
brew install git
else
info "Triggering Xcode Command Line Tools installation..."
xcode-select --install || true
fi
elif [ -f /etc/debian_version ]; then
sudo apt-get update && sudo apt-get install -y git
elif [ -f /etc/redhat-release ]; then
sudo dnf install -y git || sudo yum install -y git
elif [ -f /etc/arch-release ]; then
sudo pacman -S --noconfirm git
else
error "Unable to auto-install Git on your distribution. Please install Git manually and re-run this script."
exit 1
fi
fi
# 2. Detect & Install Bun Runtime
if command -v bun >/dev/null 2>&1; then
success "Bun runtime is already installed: $(bun --version)"
else
info "Bun runtime not found. Installing official Bun binary..."
curl -fsSL https://bun.sh/install | bash
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
fi
# 3. Detect & Install Ollama Local LLM Engine
if command -v ollama >/dev/null 2>&1; then
success "Ollama Local LLM Engine is already installed."
else
info "Ollama not found. Installing official Ollama binary..."
curl -fsSL https://ollama.com/install.sh | sh || {
warn "Could not auto-install Ollama via shell script. Please install Ollama from https://ollama.com"
}
fi
# 4. Workspace Detection / Clone & Link DevMemory AI
if [ -f "./package.json" ] && grep -q '"name": "devmemoryai"' "./package.json" 2>/dev/null; then
info "Running inside active DevMemory AI workspace: $PWD"
else
INSTALL_DIR="$HOME/.devmemory-ai"
if [ -d "$INSTALL_DIR" ]; then
info "Updating existing DevMemory AI repository at $INSTALL_DIR..."
cd "$INSTALL_DIR"
git pull origin main || true
else
info "Cloning DevMemory AI v1.1.0 repository into $INSTALL_DIR..."
git clone https://github.com/DevMemory-AI/devmemoryai.git "$INSTALL_DIR"
cd "$INSTALL_DIR"
fi
fi
info "Installing npm/bun dependencies..."
bun install
info "Linking dmai CLI executable binary into global PATH..."
bun link
# 5. Pre-warm Ollama Service & Default Model
if command -v ollama >/dev/null 2>&1; then
info "Verifying Ollama local service status..."
if ! curl -s http://localhost:11434/api/tags >/dev/null 2>&1; then
info "Launching Ollama background service (ollama serve)..."
ollama serve >/dev/null 2>&1 &
sleep 2
fi
info "Pre-warming default Ollama model (gpt-oss:120b-cloud)..."
ollama pull gpt-oss:120b-cloud >/dev/null 2>&1 &
fi
echo -e "\n${BOLD}${GREEN}"
echo "========================================================"
echo " ✔ DevMemory AI v1.1.0 Successfully Installed! "
echo "========================================================"
echo -e "${RESET}"
echo -e "You can now initialize DevMemory AI in any software repository:"
echo -e " ${BOLD}${CYAN}cd /path/to/your/project${RESET}"
echo -e " ${BOLD}${CYAN}dmai init${RESET}"
echo -e ""
echo -e "Useful CLI Commands:"
echo -e " ${CYAN}dmai status${RESET} - Check watcher, database, and repository status"
echo -e " ${CYAN}dmai ask \"...\"${RESET} - Query engineering context"
echo -e " ${CYAN}dmai dashboard${RESET} - Launch local interactive UI"
echo -e " ${CYAN}dmai projects${RESET} - List all active registered projects on machine"
echo -e " ${CYAN}dmai disable${RESET} - Safely disable project and purge .devmemory/ folder"
echo -e " ${CYAN}dmai doctor${RESET} - Verify system health & AI provider readiness"
echo -e ""