文档: 同步 OpenClaw 安装与集成说明 (#432)
Syncs OpenClaw install docs and integration paths. Aligns README examples with current script behavior.
This commit is contained in:
@@ -12,11 +12,11 @@
|
||||
# Tools:
|
||||
# antigravity — Antigravity skill files (~/.gemini/antigravity/skills/)
|
||||
# gemini-cli — Gemini CLI extension (skills/ + gemini-extension.json)
|
||||
# opencode — OpenCode agent files (.opencode/agent/*.md)
|
||||
# opencode — OpenCode agent files (.opencode/agents/*.md)
|
||||
# cursor — Cursor rule files (.cursor/rules/*.mdc)
|
||||
# aider — Single CONVENTIONS.md for Aider
|
||||
# windsurf — Single .windsurfrules for Windsurf
|
||||
# openclaw — OpenClaw SOUL.md files (openclaw_workspace/<agent>/SOUL.md)
|
||||
# openclaw — OpenClaw workspaces (integrations/openclaw/<agent>/SOUL.md)
|
||||
# qwen — Qwen Code SubAgent files (~/.qwen/agents/*.md)
|
||||
# kimi — Kimi Code CLI agent files (~/.config/kimi/agents/)
|
||||
# all — All tools (default)
|
||||
@@ -264,8 +264,8 @@ convert_openclaw() {
|
||||
# Split body sections into SOUL.md (persona) vs AGENTS.md (operations)
|
||||
# by matching ## header keywords. Unmatched sections go to AGENTS.md.
|
||||
#
|
||||
# SOUL keywords: identity, memory (paired with identity), communication,
|
||||
# style, critical rules, rules you must follow
|
||||
# SOUL keywords: identity, learning & memory, communication, style,
|
||||
# critical rules, rules you must follow
|
||||
# AGENTS keywords: everything else (mission, deliverables, workflow, etc.)
|
||||
|
||||
local current_target="agents" # default bucket
|
||||
@@ -289,6 +289,7 @@ convert_openclaw() {
|
||||
header_lower="$(echo "$line" | tr '[:upper:]' '[:lower:]')"
|
||||
|
||||
if [[ "$header_lower" =~ identity ]] ||
|
||||
[[ "$header_lower" =~ learning.*memory ]] ||
|
||||
[[ "$header_lower" =~ communication ]] ||
|
||||
[[ "$header_lower" =~ style ]] ||
|
||||
[[ "$header_lower" =~ critical.rule ]] ||
|
||||
|
||||
@@ -175,7 +175,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)" ;;
|
||||
openclaw) printf "%-14s %s" "OpenClaw" "(~/.openclaw/agency-agents)" ;;
|
||||
cursor) printf "%-14s %s" "Cursor" "(.cursor/rules)" ;;
|
||||
aider) printf "%-14s %s" "Aider" "(CONVENTIONS.md)" ;;
|
||||
windsurf) printf "%-14s %s" "Windsurf" "(.windsurfrules)" ;;
|
||||
@@ -403,21 +403,31 @@ install_openclaw() {
|
||||
local src="$INTEGRATIONS/openclaw"
|
||||
local dest="${HOME}/.openclaw/agency-agents"
|
||||
local count=0
|
||||
local existing_agents=""
|
||||
[[ -d "$src" ]] || { err "integrations/openclaw missing. Run convert.sh first."; return 1; }
|
||||
mkdir -p "$dest"
|
||||
if command -v openclaw >/dev/null 2>&1; then
|
||||
existing_agents=$'\n'"$(openclaw agents list --json 2>/dev/null | sed -n 's/^[[:space:]]*\"id\": \"\\([^\"]*\\)\".*/\\1/p')"$'\n'
|
||||
fi
|
||||
local d
|
||||
while IFS= read -r -d '' d; do
|
||||
local name; name="$(basename "$d")"
|
||||
[[ -f "$d/SOUL.md" && -f "$d/AGENTS.md" && -f "$d/IDENTITY.md" ]] || continue
|
||||
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"
|
||||
# Register with OpenClaw so agents are usable by agentId immediately
|
||||
if command -v openclaw >/dev/null 2>&1; then
|
||||
openclaw agents add "$name" --workspace "$dest/$name" --non-interactive || true
|
||||
if [[ "$existing_agents" != *$'\n'"$name"$'\n'* ]]; then
|
||||
openclaw agents add "$name" --workspace "$dest/$name" --non-interactive || true
|
||||
fi
|
||||
fi
|
||||
(( count++ )) || true
|
||||
done < <(find "$src" -mindepth 1 -maxdepth 1 -type d -print0)
|
||||
if (( count == 0 )); then
|
||||
err "integrations/openclaw contains no generated workspaces. Run ./scripts/convert.sh --tool openclaw first."
|
||||
return 1
|
||||
fi
|
||||
ok "OpenClaw: $count workspaces -> $dest"
|
||||
if command -v openclaw >/dev/null 2>&1; then
|
||||
warn "OpenClaw: run 'openclaw gateway restart' to activate new agents"
|
||||
|
||||
Reference in New Issue
Block a user