#!/bin/bash # KirinCode (开邻Claw) Install Script # Usage: curl -fsSL https://kirincode.ai/install | bash set -e RED='\033[0;31m' GOLD='\033[0;33m' NC='\033[0m' echo -e "${RED}" echo " ██╗ ██╗██╗██████╗ ██╗███╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗" echo " ██║ ██╔╝██║██╔══██╗██║████╗ ██║██╔════╝██╔═══██╗██╔══██╗██╔════╝" echo " █████╔╝ ██║██████╔╝██║██╔██╗ ██║██║ ██║ ██║██║ ██║█████╗ " echo " ██╔═██╗ ██║██╔══██╗██║██║╚██╗██║██║ ██║ ██║██║ ██║██╔══╝ " echo " ██║ ██╗██║██║ ██║██║██║ ╚████║╚██████╗╚██████╔╝██████╔╝███████╗" echo " ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝" echo -e "${GOLD} 开邻Claw — AI 编码代理${NC}" echo "" INSTALL_DIR="${KIRINCODE_INSTALL_DIR:-${XDG_BIN_DIR:-$HOME/.kirincode/bin}}" mkdir -p "$INSTALL_DIR" # Detect OS and arch OS="$(uname -s)" ARCH="$(uname -m)" case "$OS" in Darwin) OS="darwin";; Linux) OS="linux";; *) echo "Unsupported OS: $OS"; exit 1;; esac case "$ARCH" in x86_64|amd64) ARCH="x64";; arm64|aarch64) ARCH="arm64";; *) echo "Unsupported arch: $ARCH"; exit 1;; esac echo "Detected: ${OS}-${ARCH}" # Download binary REPO="kirincode/kirincode" BIN_URL="https://github.com/${REPO}/releases/latest/download/kirincode-${OS}-${ARCH}" BIN_PATH="$INSTALL_DIR/kirincode" echo "Downloading KirinCode..." if command -v curl >/dev/null 2>&1; then curl -fsSL "$BIN_URL" -o "$BIN_PATH" || { echo "Download failed. Building from source..." echo "Please clone https://github.com/kirincode/kirincode and run: bun run --cwd packages/kirincode build" exit 1 } elif command -v wget >/dev/null 2>&1; then wget -q "$BIN_URL" -O "$BIN_PATH" || exit 1 else echo "Need curl or wget to download." exit 1 fi chmod +x "$BIN_PATH" # Add to PATH hint if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then echo "" echo -e "${GOLD}Add to your shell profile:${NC}" echo " export PATH=\"$INSTALL_DIR:\$PATH\"" fi echo "" echo -e "${RED}KirinCode${NC} installed to ${GOLD}$BIN_PATH${NC}" echo "Run ${GOLD}kirincode${NC} to start." echo "" echo " Quick start:" echo " cd your-project" echo " kirincode" echo " /init # analyze project and create KIRINCODE.md" echo " /memory # view auto-memory" echo " /skill # manage skills" echo ""