Add manual install steps alongside curl, harden install script
Site and README now show both curl one-liner and manual steps. Explicit note that bun is required (node/npm won't work). Install script improvements: version check, node detection warning, curl check, Windows detection, .git dir validation, shallow clone, fallback on bun install --silent, post-install missing dep summary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
10
README.md
10
README.md
@@ -39,12 +39,20 @@ curl -fsSL https://droidclaw.ai/install.sh | sh
|
|||||||
installs bun and adb if missing, clones the repo, sets up `.env`. or do it manually:
|
installs bun and adb if missing, clones the repo, sets up `.env`. or do it manually:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
brew install android-platform-tools # adb
|
# install adb
|
||||||
|
brew install android-platform-tools
|
||||||
|
|
||||||
|
# install bun (required — npm/node won't work)
|
||||||
|
curl -fsSL https://bun.sh/install | bash
|
||||||
|
|
||||||
|
# clone and setup
|
||||||
git clone https://github.com/unitedbyai/droidclaw.git
|
git clone https://github.com/unitedbyai/droidclaw.git
|
||||||
cd droidclaw && bun install
|
cd droidclaw && bun install
|
||||||
cp .env.example .env
|
cp .env.example .env
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> **note:** droidclaw requires [bun](https://bun.sh), not node/npm. it uses bun-specific apis (`Bun.spawnSync`, native `.env` loading) that don't exist in node.
|
||||||
|
|
||||||
edit `.env` - fastest way to start is with ollama (fully local, no api key):
|
edit `.env` - fastest way to start is with ollama (fully local, no api key):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -761,6 +761,17 @@ bun run src/kernel.ts --workflow morning.json</pre>
|
|||||||
<h3>install</h3>
|
<h3>install</h3>
|
||||||
<p>one command. installs bun and adb if missing, clones the repo, sets up .env.</p>
|
<p>one command. installs bun and adb if missing, clones the repo, sets up .env.</p>
|
||||||
<pre>curl -fsSL https://droidclaw.ai/install.sh | sh</pre>
|
<pre>curl -fsSL https://droidclaw.ai/install.sh | sh</pre>
|
||||||
|
<p style="margin-top: 16px;">or do it manually:</p>
|
||||||
|
<pre><span class="dim"># install adb</span>
|
||||||
|
brew install android-platform-tools
|
||||||
|
|
||||||
|
<span class="dim"># install bun (required — npm/node won't work)</span>
|
||||||
|
curl -fsSL https://bun.sh/install | bash
|
||||||
|
|
||||||
|
<span class="dim"># clone and setup</span>
|
||||||
|
git clone https://github.com/unitedbyai/droidclaw.git
|
||||||
|
cd droidclaw && bun install
|
||||||
|
cp .env.example .env</pre>
|
||||||
</div>
|
</div>
|
||||||
<div class="stepper-step">
|
<div class="stepper-step">
|
||||||
<span class="stepper-num">2</span>
|
<span class="stepper-num">2</span>
|
||||||
|
|||||||
110
site/install.sh
110
site/install.sh
@@ -6,6 +6,7 @@ set -e
|
|||||||
|
|
||||||
REPO="https://github.com/unitedbyai/droidclaw.git"
|
REPO="https://github.com/unitedbyai/droidclaw.git"
|
||||||
INSTALL_DIR="droidclaw"
|
INSTALL_DIR="droidclaw"
|
||||||
|
MIN_BUN_MAJOR=1
|
||||||
|
|
||||||
# colors
|
# colors
|
||||||
RED='\033[0;31m'
|
RED='\033[0;31m'
|
||||||
@@ -19,82 +20,129 @@ RESET='\033[0m'
|
|||||||
info() { printf "${CYAN}>${RESET} %s\n" "$1"; }
|
info() { printf "${CYAN}>${RESET} %s\n" "$1"; }
|
||||||
success() { printf "${GREEN}>${RESET} %s\n" "$1"; }
|
success() { printf "${GREEN}>${RESET} %s\n" "$1"; }
|
||||||
warn() { printf "${YELLOW}>${RESET} %s\n" "$1"; }
|
warn() { printf "${YELLOW}>${RESET} %s\n" "$1"; }
|
||||||
error() { printf "${RED}>${RESET} %s\n" "$1"; exit 1; }
|
error() { printf "${RED}error:${RESET} %s\n" "$1"; exit 1; }
|
||||||
|
|
||||||
printf "\n${BOLD}droidclaw${RESET} ${DIM}— ai agent for android${RESET}\n\n"
|
printf "\n${BOLD}droidclaw${RESET} ${DIM}— ai agent for android${RESET}\n\n"
|
||||||
|
|
||||||
|
# ─── check curl ───
|
||||||
|
if ! command -v curl >/dev/null 2>&1; then
|
||||||
|
error "curl is required but not found. install curl first."
|
||||||
|
fi
|
||||||
|
|
||||||
# ─── check git ───
|
# ─── check git ───
|
||||||
if ! command -v git >/dev/null 2>&1; then
|
if ! command -v git >/dev/null 2>&1; then
|
||||||
error "git is required. install it first: https://git-scm.com"
|
error "git is required. install it first: https://git-scm.com"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ─── check/install bun ───
|
# ─── check/install bun ───
|
||||||
if command -v bun >/dev/null 2>&1; then
|
# droidclaw requires bun — it uses Bun.spawnSync() and native .env loading
|
||||||
success "bun $(bun --version) found"
|
# these APIs don't exist in node/npm, so node won't work
|
||||||
else
|
install_bun() {
|
||||||
info "installing bun..."
|
info "installing bun..."
|
||||||
curl -fsSL https://bun.sh/install | bash
|
curl -fsSL https://bun.sh/install | bash
|
||||||
export BUN_INSTALL="$HOME/.bun"
|
# bun installs to ~/.bun/bin — add to PATH for this session
|
||||||
|
export BUN_INSTALL="${BUN_INSTALL:-$HOME/.bun}"
|
||||||
export PATH="$BUN_INSTALL/bin:$PATH"
|
export PATH="$BUN_INSTALL/bin:$PATH"
|
||||||
|
}
|
||||||
|
|
||||||
if command -v bun >/dev/null 2>&1; then
|
if command -v bun >/dev/null 2>&1; then
|
||||||
success "bun installed"
|
BUN_VERSION=$(bun --version 2>/dev/null || echo "0.0.0")
|
||||||
|
BUN_MAJOR=$(echo "$BUN_VERSION" | cut -d. -f1)
|
||||||
|
if [ "$BUN_MAJOR" -ge "$MIN_BUN_MAJOR" ] 2>/dev/null; then
|
||||||
|
success "bun $BUN_VERSION found"
|
||||||
else
|
else
|
||||||
error "bun install failed. install manually: https://bun.sh"
|
warn "bun $BUN_VERSION is too old (need $MIN_BUN_MAJOR.0+), upgrading..."
|
||||||
|
install_bun
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
if command -v node >/dev/null 2>&1; then
|
||||||
|
warn "node found but droidclaw requires bun (uses bun-specific APIs)"
|
||||||
|
warn "node/npm won't work — installing bun alongside node..."
|
||||||
|
fi
|
||||||
|
install_bun
|
||||||
|
fi
|
||||||
|
|
||||||
|
# verify bun is actually available
|
||||||
|
if ! command -v bun >/dev/null 2>&1; then
|
||||||
|
printf "\n"
|
||||||
|
error "bun installation failed. install manually:\n\n curl -fsSL https://bun.sh/install | bash\n\n then re-run this installer."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ─── check adb ───
|
# ─── check adb ───
|
||||||
if command -v adb >/dev/null 2>&1; then
|
if command -v adb >/dev/null 2>&1; then
|
||||||
success "adb found"
|
success "adb found"
|
||||||
else
|
else
|
||||||
warn "adb not found — installing..."
|
warn "adb not found — attempting install..."
|
||||||
OS="$(uname -s)"
|
OS="$(uname -s)"
|
||||||
case "$OS" in
|
case "$OS" in
|
||||||
Darwin)
|
Darwin)
|
||||||
if command -v brew >/dev/null 2>&1; then
|
if command -v brew >/dev/null 2>&1; then
|
||||||
brew install --cask android-platform-tools
|
info "installing via homebrew..."
|
||||||
success "adb installed via homebrew"
|
brew install --cask android-platform-tools 2>/dev/null && success "adb installed via homebrew" || {
|
||||||
|
warn "homebrew install failed. trying brew formula..."
|
||||||
|
brew install android-platform-tools 2>/dev/null && success "adb installed via homebrew" || {
|
||||||
|
warn "could not install adb automatically"
|
||||||
|
warn "install manually: brew install android-platform-tools"
|
||||||
|
warn "or download from: https://developer.android.com/tools/releases/platform-tools"
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
warn "homebrew not found. install adb manually:"
|
warn "homebrew not found. install adb manually:"
|
||||||
warn " brew install --cask android-platform-tools"
|
warn " /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\""
|
||||||
|
warn " brew install android-platform-tools"
|
||||||
warn " or download from: https://developer.android.com/tools/releases/platform-tools"
|
warn " or download from: https://developer.android.com/tools/releases/platform-tools"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
Linux)
|
Linux)
|
||||||
if command -v apt-get >/dev/null 2>&1; then
|
if command -v apt-get >/dev/null 2>&1; then
|
||||||
sudo apt-get update -qq && sudo apt-get install -y -qq android-tools-adb
|
info "installing via apt..."
|
||||||
success "adb installed via apt"
|
sudo apt-get update -qq && sudo apt-get install -y -qq android-tools-adb && success "adb installed via apt" || {
|
||||||
|
warn "apt install failed. install manually: sudo apt install android-tools-adb"
|
||||||
|
}
|
||||||
elif command -v dnf >/dev/null 2>&1; then
|
elif command -v dnf >/dev/null 2>&1; then
|
||||||
sudo dnf install -y android-tools
|
info "installing via dnf..."
|
||||||
success "adb installed via dnf"
|
sudo dnf install -y android-tools && success "adb installed via dnf" || {
|
||||||
|
warn "dnf install failed. install manually: sudo dnf install android-tools"
|
||||||
|
}
|
||||||
elif command -v pacman >/dev/null 2>&1; then
|
elif command -v pacman >/dev/null 2>&1; then
|
||||||
sudo pacman -S --noconfirm android-tools
|
info "installing via pacman..."
|
||||||
success "adb installed via pacman"
|
sudo pacman -S --noconfirm android-tools && success "adb installed via pacman" || {
|
||||||
|
warn "pacman install failed. install manually: sudo pacman -S android-tools"
|
||||||
|
}
|
||||||
else
|
else
|
||||||
warn "could not auto-install adb. install manually:"
|
warn "could not auto-install adb. install manually:"
|
||||||
warn " https://developer.android.com/tools/releases/platform-tools"
|
warn " https://developer.android.com/tools/releases/platform-tools"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
MINGW*|MSYS*|CYGWIN*)
|
||||||
|
warn "windows detected. install adb manually:"
|
||||||
|
warn " https://developer.android.com/tools/releases/platform-tools"
|
||||||
|
warn " extract and add to PATH"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
warn "unknown os. install adb manually:"
|
warn "unknown os ($OS). install adb manually:"
|
||||||
warn " https://developer.android.com/tools/releases/platform-tools"
|
warn " https://developer.android.com/tools/releases/platform-tools"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ─── clone ───
|
# ─── clone or update ───
|
||||||
if [ -d "$INSTALL_DIR" ]; then
|
if [ -d "$INSTALL_DIR" ]; then
|
||||||
|
if [ -d "$INSTALL_DIR/.git" ]; then
|
||||||
info "droidclaw directory exists, pulling latest..."
|
info "droidclaw directory exists, pulling latest..."
|
||||||
cd "$INSTALL_DIR" && git pull --quiet && cd ..
|
(cd "$INSTALL_DIR" && git pull --quiet)
|
||||||
|
else
|
||||||
|
error "directory '$INSTALL_DIR' exists but is not a git repo. remove it or install elsewhere."
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
info "cloning droidclaw..."
|
info "cloning droidclaw..."
|
||||||
git clone --quiet "$REPO" "$INSTALL_DIR"
|
git clone --quiet --depth 1 "$REPO" "$INSTALL_DIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ─── install deps ───
|
# ─── install deps ───
|
||||||
cd "$INSTALL_DIR"
|
cd "$INSTALL_DIR"
|
||||||
info "installing dependencies..."
|
info "installing dependencies..."
|
||||||
bun install --silent
|
bun install --silent 2>/dev/null || bun install
|
||||||
|
|
||||||
# ─── setup env ───
|
# ─── setup env ───
|
||||||
if [ ! -f .env ]; then
|
if [ ! -f .env ]; then
|
||||||
@@ -104,10 +152,22 @@ else
|
|||||||
success ".env already exists, skipping"
|
success ".env already exists, skipping"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ─── done ───
|
# ─── summary ───
|
||||||
printf "\n${GREEN}${BOLD}done!${RESET}\n\n"
|
printf "\n${GREEN}${BOLD}installed!${RESET}\n\n"
|
||||||
|
|
||||||
|
# check what's missing
|
||||||
|
MISSING=""
|
||||||
|
if ! command -v adb >/dev/null 2>&1; then
|
||||||
|
MISSING="adb"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$MISSING" ]; then
|
||||||
|
warn "missing: $MISSING (install before running)"
|
||||||
|
printf "\n"
|
||||||
|
fi
|
||||||
|
|
||||||
printf "next steps:\n\n"
|
printf "next steps:\n\n"
|
||||||
printf " ${BOLD}1.${RESET} configure an llm provider in ${CYAN}.env${RESET}\n\n"
|
printf " ${BOLD}1.${RESET} configure an llm provider in ${CYAN}droidclaw/.env${RESET}\n\n"
|
||||||
printf " ${DIM}# local with ollama (no api key needed)${RESET}\n"
|
printf " ${DIM}# local with ollama (no api key needed)${RESET}\n"
|
||||||
printf " ollama pull llama3.2\n"
|
printf " ollama pull llama3.2\n"
|
||||||
printf " ${DIM}# set in .env:${RESET} LLM_PROVIDER=ollama\n\n"
|
printf " ${DIM}# set in .env:${RESET} LLM_PROVIDER=ollama\n\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user