-
Notifications
You must be signed in to change notification settings - Fork 606
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·65 lines (55 loc) · 2.44 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·65 lines (55 loc) · 2.44 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
#!/bin/bash
# Claude Code Local — one-line installer
#
# curl -fsSL https://raw.githubusercontent.com/nicedreamzapp/claude-code-local/main/install.sh | bash
#
# Clones the repo to ~/claude-code-local (or updates it if it's already there)
# and hands off to setup.sh, which picks a model for your Mac's RAM and builds
# the desktop launcher. Apple Silicon only.
set -euo pipefail
REPO_URL="https://github.com/nicedreamzapp/claude-code-local"
INSTALL_DIR="${CCL_DIR:-$HOME/claude-code-local}"
echo ""
echo "╔══════════════════════════════════════════════════╗"
echo "║ Claude Code Local — Installer ║"
echo "╚══════════════════════════════════════════════════╝"
echo ""
# ── Refuse to run anywhere it can't work ──────────────────────
if [ "$(uname -s)" != "Darwin" ]; then
echo "✗ This only runs on macOS (Apple Silicon)."
exit 1
fi
if [ "$(uname -m)" != "arm64" ]; then
echo "✗ This needs Apple Silicon (M1 or newer). Detected: $(uname -m)"
exit 1
fi
if ! command -v git >/dev/null 2>&1; then
echo "✗ git not found. Install the Xcode command line tools first:"
echo " xcode-select --install"
exit 1
fi
MEM_GB=$(sysctl -n hw.memsize 2>/dev/null | awk '{print int($1/1073741824)}')
echo " Mac: $(sysctl -n machdep.cpu.brand_string 2>/dev/null || echo 'Apple Silicon')"
echo " Memory: ${MEM_GB} GB"
echo ""
if [ "$MEM_GB" -lt 16 ]; then
echo " ⚠️ Under 16 GB. setup.sh will pick a small 4B model — it works,"
echo " but tool calling will be noticeably less reliable."
echo ""
fi
# ── Clone or update ───────────────────────────────────────────
if [ -d "$INSTALL_DIR/.git" ]; then
echo "→ Found an existing install at $INSTALL_DIR, updating..."
git -C "$INSTALL_DIR" pull --ff-only
elif [ -e "$INSTALL_DIR" ]; then
echo "✗ $INSTALL_DIR already exists and is not a git checkout."
echo " Move it aside, or set a different location:"
echo " CCL_DIR=~/somewhere-else curl -fsSL .../install.sh | bash"
exit 1
else
echo "→ Cloning into $INSTALL_DIR..."
git clone --depth 1 "$REPO_URL" "$INSTALL_DIR"
fi
echo ""
cd "$INSTALL_DIR"
exec bash setup.sh