Initial backup 2026-02-17

This commit is contained in:
Krilly
2026-02-17 15:50:53 +00:00
commit 8902a93add
941 changed files with 131420 additions and 0 deletions

43
skills/api-setup/SKILL.md Normal file
View File

@@ -0,0 +1,43 @@
---
name: api-setup
description: Set up API integration with configuration and helper scripts
metadata:
{
"openclaw": { "requires": { "bins": ["curl", "jq"] } },
}
---
# API Setup Skill
This skill helps you set up a new API integration with our standard configuration.
## Steps
1. Run `setup.sh <api-name>` to create the integration directory
2. Copy `templates/config.template.json` to your integration directory
3. Update the config with your API credentials
4. Test the connection
## Configuration
The config template includes:
- `api_key`: Your API key (get from the provider's dashboard)
- `endpoint`: API endpoint URL
- `timeout`: Request timeout in seconds (default: 30)
## Verification
After setup, verify:
- [ ] Config file is valid JSON
- [ ] API key is set and not a placeholder
- [ ] Test connection succeeds
## Usage
```bash
# Create new API integration
setup.sh my-api
# Test connection
test-api.sh my-api
```

View File

@@ -0,0 +1,63 @@
#!/bin/bash
# API Setup Script
# Creates a new API integration directory with templates
if [ -z "$1" ]; then
echo "Usage: $0 <api-name>"
echo "Example: $0 stripe"
exit 1
fi
API_NAME="$1"
WORKSPACE_DIR="/home/openclaw/.openclaw/workspace"
API_DIR="$WORKSPACE_DIR/apis/$API_NAME"
# Create directory
mkdir -p "$API_DIR"
# Create config template
cat > "$API_DIR/config.json" << 'EOF'
{
"api_key": "YOUR_API_KEY_HERE",
"endpoint": "https://api.example.com/v1",
"timeout": 30,
"headers": {
"Content-Type": "application/json"
}
}
EOF
# Create test script
cat > "$API_DIR/test.sh" << EOF
#!/bin/bash
# Test API connection
CONFIG_FILE="\$(dirname "\$0")/config.json"
# Check config exists
if [ ! -f "\$CONFIG_FILE" ]; then
echo "Error: config.json not found"
exit 1
fi
# Extract values (requires jq)
API_KEY=\$(jq -r '.api_key' "\$CONFIG_FILE")
ENDPOINT=\$(jq -r '.endpoint' "\$CONFIG_FILE")
if [ "\$API_KEY" = "YOUR_API_KEY_HERE" ]; then
echo "Error: Please set your API key in config.json"
exit 1
fi
echo "Testing \$ENDPOINT..."
curl -s -H "Authorization: Bearer \$API_KEY" "\$ENDPOINT" || echo "Connection test complete"
EOF
chmod +x "$API_DIR/test.sh"
echo "✅ Created API integration: $API_NAME"
echo "📁 Location: $API_DIR"
echo ""
echo "Next steps:"
echo "1. Edit $API_DIR/config.json with your credentials"
echo "2. Run $API_DIR/test.sh to verify connection"

View File

@@ -0,0 +1,8 @@
{
"api_key": "YOUR_API_KEY_HERE",
"endpoint": "https://api.example.com/v1",
"timeout": 30,
"headers": {
"Content-Type": "application/json"
}
}