𝗖𝗼𝗱𝗶𝗻𝗴 𝗔𝗴𝗲𝗻𝘁𝘀 𝗼𝘃𝗲𝗿 𝗧𝗲𝗹𝗲𝗴𝗿𝗮𝗺: 𝗙𝗿𝗼𝗺 𝗭𝗲𝗿𝗼 𝘁𝗼 𝗔𝗻 𝗔𝗴𝗲𝗻𝘁 𝗧𝗵𝗮𝘁 𝗔𝗻𝘀𝘄𝗲𝗿𝘀

Stop reading and start doing.

By the end of this guide, you will have a Telegram topic where a coding agent answers your messages. This agent will drive a tmux pane on your own machine.

This is the core goal. You do not need memory, monitors, or tool servers yet. You only need to get the agent to answer you.

⏱️ Time Needed: 30–45 minutes.

🛠️ Prerequisites

Before you start, ensure you have these items ready:

  • A machine with tmux and shell access.
  • A working coding agent (like OpenCode or Claude Code) already running in a tmux pane.
  • The exact tmux target for your agent (example: mybox:1.1).
  • The exact command to launch your agent.
  • The OpenClaw runtime installed.
  • A Telegram account and the Telegram app.

📦 Required Versions

Do not skip these. Wrong versions cause silent failures.

• Node.js: 24.11.1 • Package Manager: pnpm 11.2.2 • OpenClaw: Pin to a specific commit.

🚀 Quick Setup Path

You can use these scripts to handle the local setup:

  1. Download the scripts: curl -fsSL "https://gist.githubusercontent.com/jerilkuriakose/cd0f8353aac74e47c591111b758943e9/raw/setup-openclaw.sh" -o setup-openclaw.sh curl -fsSL "https://gist.githubusercontent.com/jerilkuriakose/7cf94af3e96526f9f14d0c28b6c26b69/raw/ready-check.sh" -o ready-check.sh chmod +x setup-openclaw.sh ready-check.sh

  2. Run the setup with your bot token: OPENCLAW_BOT_TOKEN="" OPENCLAW_BOT_ACCOUNT="my-bot" ./setup-openclaw.sh

  3. Verify the setup: AGENT_ID=my-agent PANE=mybox:1.1 ./ready-check.sh

📱 Telegram Configuration

Follow these steps in your Telegram app:

  • Create a bot via @BotFather and save the token.
  • Create a new group and add your bot.
  • Make the bot an Administrator. This allows it to see your messages.
  • Enable "Topics" in the group settings.
  • Create a topic for your project.
  • Send one message in that topic to generate a Topic ID in your logs.

⚙️ Wiring it Together

The gateway uses a JSON config at ~/.openclaw/openclaw.json.

Use Phase 1 to find your Chat ID and Topic ID by sending a message and checking the gateway logs.

Use Phase 2 to lock the group down. Change the policy to "allowlist" and add only your numeric Telegram User ID. Map your Topic ID to your specific Agent ID.

📝 The Agent Contract

Создайте файл AGENTS.md в рабочем пространстве вашего агента. Этот файл указывает агенту, как себя вести. Вы должны определить:

  • Как читать панель (tmux capture-pane).
  • Как записывать в панель (tmux send-keys).
  • Как обрабатывать специфические команды, такие как "status", "send" или "restart".

✅ Тест на готовность

Вы закончили только тогда, когда пройдете эти пять проверок:

  1. Бот отвечает в вашей теме Telegram.
  2. Ваш промпт доходит до панели tmux.
  3. Агент-кодер начинает работать над промптом.
  4. Файл лога подтверждает, что агент обработал вашу тему.
  5. Доступ к группе ограничен только вашим User ID.

Источник: https://dev.to/jerilk/coding-agents-over-telegram-part-2-from-zero-to-an-agent-that-answers-2777

Дополнительное обучающее сообщество: https://t.me/GyaanSetuAi