Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

14.6 Practice: Build a Personal Assistant

🦞 "From zero to a 24/7 personal assistant, in five steps."


Goal

Build a personal assistant living in Telegram that can: read email summaries (Gmail), record/query todos, run restricted shell commands, and push daily schedules.

Practice message flow


Step 1: Install & Initialize

curl -fsSL https://openclaw.ai/install.sh | bash
openclaw onboard

Onboard: LLM (Anthropic or your key) → Channel (Telegram via BotFather token) → persona → timezone.

Step 2: Configure Telegram

openclaw config set channels.telegram.botToken "$TELEGRAM_BOT_TOKEN"
openclaw config set channels.telegram.dmPolicy "contacts"
openclaw config set channels.telegram.groupPolicy "mention_only"
openclaw config set channels.telegram.rateLimit "3/m"
openclaw gateway     # ✓ Telegram bot online

Step 3: Install Skills

openclaw skills install email-summary
openclaw skills install todo-list
openclaw skills install daily-report

Step 4: Restrict Shell (Security)

# ~/.openclaw/config.yaml
permissions:
  - user: "telegram:123456789"   # you
    tools: ["*"]
    shell:
      allow: ["ls", "cat", "grep", "find", "pwd", "df", "du"]
      block: ["rm", "mv", "chmod", "sudo", "curl"]
  - user: "*"                    # everyone else
    action: "deny"

⚠️ Least privilege: shell allow-list only read-only commands; destructive ones explicitly blocked.

Step 5: Daemon (24/7)

macOS launchd / Linux pm2:

pm2 start "openclaw gateway" --name openclaw-gateway
pm2 save && pm2 startup

Acceptance: Three Commands

CommandExpectedCapability
"What's in today's email?"inbox summaryemail-summary Skill
"Add a todo: meeting 9am"write todo + confirmtodo-list + memory
"df"disk usage (read-only)shell allow-list df

Failure Modes & Troubleshooting

SymptomCauseFix
bot doesn't replygateway down / bad tokenopenclaw doctor
"permission denied"dmPolicy too strictcheck contacts
shell blockednot in allow-listcheck allow
message spamrateLimit too loosedrop to 3/m

Section Summary

TopicKey point
5 stepsinstall → Telegram → skills → permissions → daemon
Securityread-only shell allow-list + deny strangers
Daemonlaunchd (mac) / pm2 (linux)
Acceptanceemail summary / todo / read-only shell

Next section: 14.7 Lessons for Engineers