Skip to content

🦅 OpenClaw Gateway

OpenClaw is a self-hosted, open-source personal assistant gateway developed by Peter Steinberger. It connects messaging networks (such as Telegram, Slack, and Discord) to Large Language Models (like Google Gemini) and exposes local operating system capabilities through custom Python executables called Skills.

For the corresponding hands-on module, see openclaw-gateway.md.


📊 Tool Datasheet

MetricDetails
Tool NameOpenClaw Gateway
CategoryMessaging & Local Assistant Gateway
PurposeTo connect messaging APIs to LLMs, exposing local OS processes through Python-decorated tool functions.
DeveloperPeter Steinberger
LicenseMIT License
Port MappingDefault: 9000

🛠️ Capabilities

  1. Multi-Channel Bridges: Connects directly to Telegram Bots (via long polling or webhooks) and broadcasts alerts to Discord and Slack webhooks.
  2. Dynamic Skill Loading: Automatically parses docstrings of Python functions decorated with @skill to dynamically define LLM tool-calling capabilities.
  3. Strict Security Whitelisting: Safeguards local system execution by rejecting commands from non-whitelisted user identifiers.
  4. Local Subprocess Execution: Spawns isolated shell tasks on the host machine to execute Python commands and return logs.

🧭 Step-by-Step Tutorial & Setup

This tutorial guides you through installing OpenClaw, configuring your Telegram token, and running a custom Python skill.

1. Installation

Clone the repository and install Node.js dependencies:

bash
cd ~/AI_BOOTCAMP/labs
git clone https://github.com/petersteinberger/openclaw.git
cd openclaw
nvm use default
npm install

2. Configure Environment Variables

Create a .env file at the root of the openclaw directory: Path: ~/AI_BOOTCAMP/labs/openclaw/.env

text
OPENAI_API_KEY=your_openai_api_key_here
TELEGRAM_BOT_TOKEN=123456789:ABCdefGhIJKlmNoPQRsTUVwxyZ
TELEGRAM_ALLOWED_USER_IDS=555123456
PORT=9000
DATA_DIR=~/AI_BOOTCAMP/labs/openclaw/data

3. Write a Custom Python Skill

Create system_skills.py inside the skills directory: Path: ~/AI_BOOTCAMP/labs/openclaw/skills/system_skills.py

python
import os
from openclaw.skills import skill

@skill(description="Lists files in the active training workspace to inspect progress.")
def check_workspace_files() -> str:
    path = os.path.expanduser("~/AI_BOOTCAMP")
    if not os.path.exists(path):
        return f"Workspace path '{path}' does not exist!"
    
    files = os.listdir(path)
    return "Files found:\n" + "\n".join([f"- {f}" for f in files])

4. Start the Gateway

Launch the server daemon in your terminal:

bash
npm run start

Message your Telegram bot: OpenClaw, what files do we have in our training workspace? The bot will execute the Python subprocess natively on Linux and reply with your directory structure.


💡 Sample Ideation to Test

Try these ideas to expand your OpenClaw Gateway integration:

  1. System Performance Auditing: Write a custom skill that parses output from psutil and sends a warning to your bot if RAM usage exceeds 90%.
  2. Outbound Webhook Dispatcher: Integrate alert_dispatcher.py to trigger immediate Slack or Discord channel notifications when local builds or database tests fail.