Initial openclaw skill
This commit is contained in:
90
SKILL.md
Normal file
90
SKILL.md
Normal file
@@ -0,0 +1,90 @@
|
||||
---
|
||||
name: openclaw
|
||||
description: OpenClaw personal AI assistant gateway
|
||||
metadata:
|
||||
version: "1.0.0"
|
||||
vibestack:
|
||||
main: false
|
||||
---
|
||||
|
||||
# OpenClaw Skill
|
||||
|
||||
[OpenClaw](https://github.com/openclaw/openclaw) - a personal AI assistant you run on your own devices with multi-channel messaging support.
|
||||
|
||||
## Features
|
||||
|
||||
- Local-first AI assistant
|
||||
- Multi-channel messaging: WhatsApp, Telegram, Slack, Discord
|
||||
- WebSocket gateway for unified control
|
||||
- Web UI dashboard
|
||||
- Skills/tools system
|
||||
|
||||
## Configuration
|
||||
|
||||
| Variable | Description | Default |
|
||||
|----------|-------------|---------|
|
||||
| `OPENCLAW_PORT` | Gateway port | `18789` |
|
||||
| `OPENCLAW_DOMAIN` | Domain for Caddy auto-config | (none) |
|
||||
| `OPENCLAW_DATA_DIR` | Data directory | `/data/openclaw` |
|
||||
| `ANTHROPIC_API_KEY` | API key for Claude | (required) |
|
||||
|
||||
## Setup
|
||||
|
||||
After the skill starts, complete onboarding:
|
||||
|
||||
```bash
|
||||
# Via ttyd terminal or exec into container
|
||||
openclaw onboard
|
||||
```
|
||||
|
||||
This wizard configures:
|
||||
- Workspace settings
|
||||
- Channel integrations (WhatsApp, Telegram, etc.)
|
||||
- Skills installation
|
||||
|
||||
## Usage
|
||||
|
||||
### Web UI
|
||||
|
||||
Access the dashboard at `http://localhost:18789` (or via Caddy proxy).
|
||||
|
||||
### CLI
|
||||
|
||||
```bash
|
||||
# Send a message
|
||||
openclaw send "Hello, what can you do?"
|
||||
|
||||
# Invoke with thinking
|
||||
openclaw invoke --think "Plan my day"
|
||||
```
|
||||
|
||||
### Channels
|
||||
|
||||
Configure channels via onboarding or environment:
|
||||
- WhatsApp: Requires WhatsApp Business API
|
||||
- Telegram: Bot token
|
||||
- Slack: OAuth app
|
||||
- Discord: Bot token
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────┐
|
||||
│ OpenClaw Gateway │
|
||||
│ :18789 │
|
||||
├─────────────────────────────────────────┤
|
||||
│ WebSocket Control Plane │
|
||||
│ ├── Sessions │
|
||||
│ ├── Channels (WhatsApp, Telegram...) │
|
||||
│ └── Tools/Skills │
|
||||
├─────────────────────────────────────────┤
|
||||
│ Web UI Dashboard │
|
||||
└─────────────────────────────────────────┘
|
||||
│
|
||||
▼
|
||||
Claude / LLM
|
||||
```
|
||||
|
||||
## Integration with VibeStack
|
||||
|
||||
OpenClaw can use the same Claude API key as the claude skill. It provides a different interface - messaging-focused rather than terminal-focused.
|
||||
97
scripts/autorun.sh
Normal file
97
scripts/autorun.sh
Normal file
@@ -0,0 +1,97 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
SKILLS_DIR="${SKILLS_DIR:-/skills}"
|
||||
OPENCLAW_DATA_DIR="${OPENCLAW_DATA_DIR:-/data/openclaw}"
|
||||
|
||||
# Install Node.js 22+ (required for OpenClaw)
|
||||
install_node() {
|
||||
if command -v node &>/dev/null; then
|
||||
local version=$(node --version | sed 's/v//' | cut -d. -f1)
|
||||
if [ "$version" -ge 22 ]; then
|
||||
echo "Node.js already installed: $(node --version)"
|
||||
return 0
|
||||
fi
|
||||
echo "Node.js version too old, upgrading..."
|
||||
fi
|
||||
|
||||
echo "Installing Node.js 22..."
|
||||
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
||||
apt-get install -y nodejs
|
||||
|
||||
echo "Node.js installed: $(node --version)"
|
||||
}
|
||||
|
||||
# Install OpenClaw
|
||||
install_openclaw() {
|
||||
if command -v openclaw &>/dev/null; then
|
||||
echo "OpenClaw already installed: $(openclaw --version 2>/dev/null || echo 'installed')"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "Installing OpenClaw..."
|
||||
npm install -g openclaw@latest
|
||||
|
||||
echo "OpenClaw installed"
|
||||
}
|
||||
|
||||
# Setup directories
|
||||
setup_dirs() {
|
||||
mkdir -p "$OPENCLAW_DATA_DIR"
|
||||
echo "Data directory: $OPENCLAW_DATA_DIR"
|
||||
}
|
||||
|
||||
# Configure Caddy if present
|
||||
configure_caddy() {
|
||||
local caddy_dir="$SKILLS_DIR/caddy"
|
||||
local openclaw_port="${OPENCLAW_PORT:-18789}"
|
||||
local openclaw_domain="${OPENCLAW_DOMAIN:-}"
|
||||
|
||||
if [ ! -d "$caddy_dir" ]; then
|
||||
echo "Caddy not found - OpenClaw on port $openclaw_port"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "Caddy detected - configuring reverse proxy..."
|
||||
mkdir -p "$caddy_dir/snippets.d"
|
||||
|
||||
local snippet="$caddy_dir/snippets.d/openclaw.caddy"
|
||||
|
||||
if [ -n "$openclaw_domain" ]; then
|
||||
cat > "$snippet" << EOF
|
||||
# Auto-generated by openclaw skill
|
||||
$openclaw_domain {
|
||||
reverse_proxy localhost:$openclaw_port
|
||||
}
|
||||
EOF
|
||||
echo "Caddy config: $openclaw_domain -> localhost:$openclaw_port"
|
||||
else
|
||||
cat > "$snippet" << EOF
|
||||
# Auto-generated by openclaw skill
|
||||
# Add to your site block:
|
||||
# handle /openclaw/* {
|
||||
# uri strip_prefix /openclaw
|
||||
# reverse_proxy localhost:$openclaw_port
|
||||
# }
|
||||
EOF
|
||||
echo "Caddy snippet created (manual config needed)"
|
||||
fi
|
||||
}
|
||||
|
||||
# Check auth
|
||||
check_auth() {
|
||||
if [ -z "$ANTHROPIC_API_KEY" ]; then
|
||||
echo "WARNING: ANTHROPIC_API_KEY not set - OpenClaw needs this for Claude"
|
||||
else
|
||||
echo "Authentication configured"
|
||||
fi
|
||||
}
|
||||
|
||||
install_node
|
||||
install_openclaw
|
||||
setup_dirs
|
||||
configure_caddy
|
||||
check_auth
|
||||
|
||||
echo "OpenClaw setup complete"
|
||||
echo "Run 'openclaw onboard' to configure channels"
|
||||
12
scripts/run.sh
Normal file
12
scripts/run.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
OPENCLAW_PORT="${OPENCLAW_PORT:-18789}"
|
||||
OPENCLAW_DATA_DIR="${OPENCLAW_DATA_DIR:-/data/openclaw}"
|
||||
|
||||
echo "Starting OpenClaw gateway on port $OPENCLAW_PORT..."
|
||||
echo "Data directory: $OPENCLAW_DATA_DIR"
|
||||
echo "Web UI: http://localhost:$OPENCLAW_PORT"
|
||||
|
||||
cd "$OPENCLAW_DATA_DIR"
|
||||
exec openclaw gateway --port "$OPENCLAW_PORT" --verbose
|
||||
Reference in New Issue
Block a user