77 lines
2.3 KiB
Bash
Executable File
77 lines
2.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# claude-check-env: Verify Claude Code environment on Termux
|
|
#
|
|
|
|
RED="\033[0;31m"
|
|
GREEN="\033[0;32m"
|
|
YELLOW="\033[1;33m"
|
|
CYAN="\033[0;36m"
|
|
NC="\033[0m"
|
|
|
|
echo -e "${CYAN}=== Claude Code - Environment Check ===${NC}"
|
|
echo ""
|
|
|
|
# 1. Claude version
|
|
CLAUDE_VER=$(claude --version 2>/dev/null | grep -oE "[0-9]+\.[0-9]+\.[0-9]+" | head -1)
|
|
if [[ -n "$CLAUDE_VER" ]]; then
|
|
echo -e "${GREEN}[OK]${NC} Claude Code: v$CLAUDE_VER"
|
|
else
|
|
echo -e "${RED}[ERROR]${NC} Claude Code not installed"
|
|
fi
|
|
|
|
# 2. Node.js
|
|
NODE_VER=$(node --version 2>/dev/null)
|
|
if [[ -n "$NODE_VER" ]]; then
|
|
echo -e "${GREEN}[OK]${NC} Node.js: $NODE_VER"
|
|
else
|
|
echo -e "${RED}[ERROR]${NC} Node.js not installed"
|
|
fi
|
|
|
|
# 3. proot/termux-chroot
|
|
if command -v termux-chroot &>/dev/null; then
|
|
echo -e "${GREEN}[OK]${NC} termux-chroot available"
|
|
else
|
|
echo -e "${RED}[ERROR]${NC} termux-chroot not available (pkg install proot)"
|
|
fi
|
|
|
|
# 4. Sharp WASM (image support)
|
|
SHARP_WASM=$(npm list -g @img/sharp-wasm32 2>/dev/null | grep sharp-wasm32)
|
|
if [[ -n "$SHARP_WASM" ]]; then
|
|
echo -e "${GREEN}[OK]${NC} Sharp WASM: installed (image support)"
|
|
else
|
|
echo -e "${YELLOW}[WARN]${NC} Sharp WASM not installed (no image support)"
|
|
echo " Install: npm install -g @img/sharp-wasm32 sharp --force"
|
|
fi
|
|
|
|
# 5. Credentials
|
|
if [[ -f ~/.claude/.credentials.json ]]; then
|
|
echo -e "${GREEN}[OK]${NC} Credentials: configured"
|
|
else
|
|
echo -e "${RED}[ERROR]${NC} No credentials (run: claude auth)"
|
|
fi
|
|
|
|
# 6. TMPDIR
|
|
echo -e "${GREEN}[OK]${NC} TMPDIR: ${TMPDIR:-not set}"
|
|
|
|
# 7. Tailscale (generic check via interface)
|
|
if ip link show tailscale0 &>/dev/null 2>&1; then
|
|
echo -e "${GREEN}[OK]${NC} Tailscale: connected"
|
|
else
|
|
echo -e "${YELLOW}[WARN]${NC} Tailscale: not connected"
|
|
fi
|
|
|
|
# 8. Disk space
|
|
SPACE=$(df -h "$PREFIX" 2>/dev/null | tail -1 | awk '{print $4}')
|
|
echo -e "${GREEN}[OK]${NC} Free space: $SPACE"
|
|
|
|
echo ""
|
|
echo -e "${CYAN}=== Available Commands ===${NC}"
|
|
echo " clauded - Start Claude (interactive mode)"
|
|
echo " claude-update - Update Claude Code (safe)"
|
|
echo " claude-check-env - This check"
|
|
echo ""
|
|
echo -e "${CYAN}=== Known Limitations ===${NC}"
|
|
echo " - Background tasks may fail (use termux-chroot via clauded)"
|
|
echo " - Version ceiling: v2.1.112 (last pure Node.js release)"
|