这份说明是给第一次接触这套框架的人准备的。
This guide is written for first-time users.
在开始之前,请先准备:
- 一台 macOS 电脑
- 已安装
Python 3 - 已安装
Git - 已安装
Telegram - 你准备创建的 Telegram bot token
如果你不确定电脑有没有装好 Python 3 和 Git,先在终端执行:
python3 --version
git --version如果其中任意一条报错,先安装对应软件,再继续下面步骤。
在 Telegram 里搜索 @BotFather,然后按下面步骤做:
- 发送
/newbot - 给 bot 起名字
- 给 bot 设置用户名(必须以
bot结尾) - 保存返回的 token
如果你要用推荐的 6 bot 结构,就需要准备 6 个 token。
git clone https://github.com/ukgorclawbot-stack/telegram-multi-bot-stack.git
cd telegram-multi-bot-stackbash ./install.sh这个脚本会自动:
- 创建
.venv - 安装 Python 依赖
- 安装
OpenClaw / Gemini CLI / Codex / Claude Code - 初始化本地目录
- 准备配置模板
bash ./configure_ai_runtimes.sh这一步会:
- 检查 4 个 AI CLI 是否已经安装
- 自动创建
.ai_runtimes.env - 引导你选择:
- 填 API key
- 或者直接做 auth/login
- 告诉你不同 CLI 对应的登录命令
如果你完全是第一次装,建议在配置 bot stack 之前先完成这一步。
更详细的说明见:
bash ./configure.sh配置向导会问你:
- 你的 home 目录
- 哪个 Telegram user_id 可以使用这些 bot
- 是否使用推荐的 6 bot 结构
如果你不知道自己的 user_id,可以先用任意临时 bot 或现有 bot 的 /whoami 来查。
如果你在配置向导里没有直接输入 token,就手动编辑:
open .bot_tokens.env把每个 bot 的 token 填进去。首次安装后这个文件会自动生成。
如果你只想先搭最推荐的 6 bot 结构,通常只需要填这 6 行:
TG_OPENCLAW_GROUP_TOKEN=
TG_GEMINI_GROUP_TOKEN=
TG_CODEX_GROUP_TOKEN=
TG_OPENCLAW_PRIVATE_TOKEN=
TG_GEMINI_PRIVATE_TOKEN=
TG_CODEX_PRIVATE_TOKEN=bash ./apply_stack.sh这一步会:
- 读取
.bot_tokens.env - 生成正式 env
- 生成正式 launchd plist
- 自动加载并启动服务
如果你还不想真正启动,只想先看会生成什么:
bash ./bootstrap_bot_stack.sh generate生成后的文件在:
generated/bot-stack/env/generated/bot-stack/launchd/generated/bot-stack/STACK_SUMMARY.md
直接执行:
bash ./health_check.sh如果安装成功,你会看到:
- Telegram API 检查结果
- bot 服务状态
- 监控和晨报状态
按这个顺序照做最稳:
git clone https://github.com/ukgorclawbot-stack/telegram-multi-bot-stack.git
cd telegram-multi-bot-stack
bash ./install.sh
bash ./configure_ai_runtimes.sh
bash ./configure.sh
open .bot_tokens.env
bash ./apply_stack.sh
bash ./health_check.sh先安装 Python 3,再重试:
python3 --version说明 .bot_tokens.env 还没写完整。
先检查 launchd 是否在线:
launchctl list | grep telegram再看日志:
tail -n 100 generated/bot-stack/logs/*.logBefore you start, prepare:
- A macOS computer
Python 3installedGitinstalledTelegraminstalled- Telegram bot tokens you plan to use
If you are not sure whether Python 3 and Git are installed, run:
python3 --version
git --versionIf either command fails, install the missing software first.
In Telegram, search for @BotFather and follow these steps:
- Send
/newbot - Pick a bot name
- Pick a bot username ending with
bot - Save the returned token
If you use the recommended 6-bot layout, prepare 6 tokens.
git clone https://github.com/ukgorclawbot-stack/telegram-multi-bot-stack.git
cd telegram-multi-bot-stackbash ./install.shThis script will automatically:
- create
.venv - install Python dependencies
- initialize local directories
- prepare configuration templates
bash ./configure.shThe wizard will ask for:
- your home directory
- which Telegram user ID is allowed to use the bots
- whether to use the recommended 6-bot layout
If you do not know your Telegram user_id, use any temporary bot or an existing bot command such as /whoami.
If you did not enter tokens during the wizard, edit the token file manually:
open .bot_tokens.envFill in one token per bot. This file is created automatically on first install.
For the recommended 6-bot layout, these are the main fields:
TG_OPENCLAW_GROUP_TOKEN=
TG_GEMINI_GROUP_TOKEN=
TG_CODEX_GROUP_TOKEN=
TG_OPENCLAW_PRIVATE_TOKEN=
TG_GEMINI_PRIVATE_TOKEN=
TG_CODEX_PRIVATE_TOKEN=bash ./apply_stack.shThis step will:
- load
.bot_tokens.env - generate final env files
- generate final launchd plist files
- load and start the services automatically
If you do not want to start services yet and only want to preview generated files:
bash ./bootstrap_bot_stack.sh generateGenerated files will appear in:
generated/bot-stack/env/generated/bot-stack/launchd/generated/bot-stack/STACK_SUMMARY.md
Run:
bash ./health_check.shIf setup is successful, you will see:
- Telegram API status
- bot service status
- monitor and report status
Follow these steps in this exact order:
git clone https://github.com/ukgorclawbot-stack/telegram-multi-bot-stack.git
cd telegram-multi-bot-stack
bash ./install.sh
bash ./configure.sh
open .bot_tokens.env
bash ./apply_stack.sh
bash ./health_check.shInstall Python 3 first, then retry:
python3 --versionThat means .bot_tokens.env is incomplete.
Check whether launchd services are loaded:
launchctl list | grep telegramThen inspect logs:
tail -n 100 generated/bot-stack/logs/*.log