Add OpenClaw support to install.sh

- Auto-detect ~/.openclaw directory or openclaw CLI
- Copy SOUL.md, AGENTS.md, IDENTITY.md per agent to ~/.openclaw/agency-agents/
- Add to interactive selector and tool list

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Michael Sitarzewski 2026-03-10 17:28:48 -05:00
parent 6d58ad4c0a
commit 42393d76ab

View File

@ -18,6 +18,7 @@
# cursor -- Copy rules to .cursor/rules/ in current directory
# aider -- Copy CONVENTIONS.md to current directory
# windsurf -- Copy .windsurfrules to current directory
# openclaw -- Copy workspaces to ~/.openclaw/agency-agents/
# all -- Install for all detected tools (default)
#
# Flags:
@ -80,7 +81,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
INTEGRATIONS="$REPO_ROOT/integrations"
ALL_TOOLS=(claude-code copilot antigravity gemini-cli opencode cursor aider windsurf)
ALL_TOOLS=(claude-code copilot antigravity gemini-cli opencode openclaw cursor aider windsurf)
# ---------------------------------------------------------------------------
# Usage
@ -110,6 +111,7 @@ detect_gemini_cli() { command -v gemini >/dev/null 2>&1 || [[ -d "${HOME}/.gem
detect_cursor() { command -v cursor >/dev/null 2>&1 || [[ -d "${HOME}/.cursor" ]]; }
detect_opencode() { command -v opencode >/dev/null 2>&1 || [[ -d "${HOME}/.config/opencode" ]]; }
detect_aider() { command -v aider >/dev/null 2>&1; }
detect_openclaw() { command -v openclaw >/dev/null 2>&1 || [[ -d "${HOME}/.openclaw" ]]; }
detect_windsurf() { command -v windsurf >/dev/null 2>&1 || [[ -d "${HOME}/.codeium" ]]; }
is_detected() {
@ -119,6 +121,7 @@ is_detected() {
antigravity) detect_antigravity ;;
gemini-cli) detect_gemini_cli ;;
opencode) detect_opencode ;;
openclaw) detect_openclaw ;;
cursor) detect_cursor ;;
aider) detect_aider ;;
windsurf) detect_windsurf ;;
@ -134,6 +137,7 @@ tool_label() {
antigravity) printf "%-14s %s" "Antigravity" "(~/.gemini/antigravity)" ;;
gemini-cli) printf "%-14s %s" "Gemini CLI" "(gemini extension)" ;;
opencode) printf "%-14s %s" "OpenCode" "(opencode.ai)" ;;
openclaw) printf "%-14s %s" "OpenClaw" "(~/.openclaw)" ;;
cursor) printf "%-14s %s" "Cursor" "(.cursor/rules)" ;;
aider) printf "%-14s %s" "Aider" "(CONVENTIONS.md)" ;;
windsurf) printf "%-14s %s" "Windsurf" "(.windsurfrules)" ;;
@ -192,7 +196,7 @@ interactive_select() {
# --- controls ---
printf "\n"
printf " ------------------------------------------------\n"
printf " ${C_CYAN}[1-8]${C_RESET} toggle ${C_CYAN}[a]${C_RESET} all ${C_CYAN}[n]${C_RESET} none ${C_CYAN}[d]${C_RESET} detected\n"
printf " ${C_CYAN}[1-9]${C_RESET} toggle ${C_CYAN}[a]${C_RESET} all ${C_CYAN}[n]${C_RESET} none ${C_CYAN}[d]${C_RESET} detected\n"
printf " ${C_GREEN}[Enter]${C_RESET} install ${C_RED}[q]${C_RESET} quit\n"
printf "\n"
printf " >> "
@ -341,6 +345,24 @@ install_opencode() {
warn "OpenCode: project-scoped. Run from your project root to install there."
}
install_openclaw() {
local src="$INTEGRATIONS/openclaw"
local dest="${HOME}/.openclaw/agency-agents"
local count=0
[[ -d "$src" ]] || { err "integrations/openclaw missing. Run convert.sh first."; return 1; }
mkdir -p "$dest"
local d
while IFS= read -r -d '' d; do
local name; name="$(basename "$d")"
mkdir -p "$dest/$name"
cp "$d/SOUL.md" "$dest/$name/SOUL.md"
cp "$d/AGENTS.md" "$dest/$name/AGENTS.md"
cp "$d/IDENTITY.md" "$dest/$name/IDENTITY.md"
(( count++ )) || true
done < <(find "$src" -mindepth 1 -maxdepth 1 -type d -print0)
ok "OpenClaw: $count workspaces -> $dest"
}
install_cursor() {
local src="$INTEGRATIONS/cursor/rules"
local dest="${PWD}/.cursor/rules"
@ -388,6 +410,7 @@ install_tool() {
antigravity) install_antigravity ;;
gemini-cli) install_gemini_cli ;;
opencode) install_opencode ;;
openclaw) install_openclaw ;;
cursor) install_cursor ;;
aider) install_aider ;;
windsurf) install_windsurf ;;