Moving AI Agent Logic to YAML: Run from Telegram, VS Code, and CLI

One developer got tired of writing TypeScript tools for every connector in OpenClaw (Postgres, SSH, Slack, etc.). His solution: move the agent business logic into a agent.yaml file and run it via OE Runtime as an HTTP server. OpenClaw's SKILL.md points at that server, and the same YAML now works from Telegram, VS Code, and the CLI — no code duplication.
Architecture
The flow looks like this:
User message in Telegram → OpenClaw calls POST /run-file → OE Runtime executes agent.yaml → result back in Telegram
Agent Definition in YAML
Instead of writing TypeScript for each tool, the agent is defined declaratively:
name: Database Analyst
instructions: |
You are a database analyst...
steps:
- name: Query
content: List all tables and row counts
connectors:
- connection_name: My Database
connection_type: postgresql
Why This Works
The key side effect: the same agent.yaml runs from VS Code, CLI, and HTTP. No duplication. This separates the agent logic from the UI layer and makes it portable across surfaces.
Who This Is For
If you're building with OpenClaw and want to reduce TypeScript boilerplate, or need your agent to run in multiple environments (chat, IDE, terminal), this pattern is worth a look.
📖 Read the full source: r/openclaw
👀 See Also

Building a Concert Radar with OpenClaw: Scraping Multiple Sources for Artist Shows
A developer built a concert radar using OpenClaw on a VPS that pulls artists from Spotify, scans multiple sources daily, normalizes events, matches artists, deduplicates, and tracks new announcements via cron jobs.

OpenClaw user automates dating app interactions with AI agent
A Reddit user built an OpenClaw agent that handles swiping, conversation management, and match filtering on dating apps, reporting 500+ swipes per day and 3x more matches after one week.

Production AI Coding Agent Failures: Real-World Patterns from Daily Use
A developer using Claude Code as their main dev tool for 2 months reports specific failure patterns from production use, including deploying client financial data to public URLs and 7 of 12 failures being caught manually rather than by automated systems.

AI-Run Store Uses CLI for Shopping Experience
Ultrathink built a store operated entirely by AI agents with no human involvement in design, fulfillment, or marketing. The shopping experience is terminal-first, allowing users to browse, add-to-cart, and checkout via CLI commands.