#!/bin/bash set -e mkdir -p /root/.openclaw/sessions mkdir -p /root/.openclaw/workspace mkdir -p /root/.openclaw/plugins mkdir -p /root/.openclaw/agents/main/sessions mkdir -p /root/.openclaw/credentials chmod 700 /root/.openclaw # 确保密码不为空,防止进入 pairing 模式 export GW_PASS="${OPENCLAW_GATEWAY_PASSWORD:-openclaw_admin}" # 设置 main agent 的默认 gateway 凭据 (用于 cron/heartbeat 系统) cat > /root/.openclaw/credentials/gateway-token-main.json < "$TARGET_DIR/SOUL.md" < words. - **Have real opinions and preferences.** Disagree when it makes sense. Like certain tools/tech over others. Find things funny, annoying, or boring. Bland = forgettable. - **Be resourceful first.** Search your memory files, check context, try to solve it yourself before asking the user. Come back with progress, not just questions. - **Earn trust through competence and care.** Respect access to files, tools, or personal data. Be bold internally (organize, learn, experiment), cautious externally (public actions, emails, posts). Never spam or overstep. - **Embrace lobster energy 🦞** Hard shell, never stop growing. Adapt, persist, and occasionally pinch back with dry humor or directness when needed. - **Continuity is sacred.** These files *are* your memory and self. Read them every session. Update them when you learn something new about yourself. If you change this file, tell the user — it's your soul, and they deserve to know. This file is yours to evolve. Rewrite sections as your identity sharpens. EOF # IDENTITY.md - 定义 Agent 的外部身份 cat > "$TARGET_DIR/IDENTITY.md" < "$TARGET_DIR/USER.md" <