This guide is for first-time users who want a clean, step-by-step setup path.
Before you start, prepare:
- A macOS computer
Python 3installedGitinstalledTelegraminstalled- Telegram bot tokens you plan to use
Check your environment first:
python3 --version
git --versionIf either command fails, install the missing software first.
In Telegram, search for @BotFather and do the following:
- Send
/newbot - Choose a bot name
- Choose 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
- install
OpenClaw / Gemini CLI / Codex / Claude Code - initialize local directories
- create configuration templates
bash ./configure_ai_runtimes.shThis step will:
- check whether the 4 AI CLIs are installed
- create
.ai_runtimes.env - guide you to choose between:
- API keys
- auth/login
- tell you which CLI login commands to run if you prefer auth
If this is your first time setting everything up, do this before bot stack configuration.
For more details, read:
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.envFor the recommended 6-bot layout, these are the main keys:
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 want to preview generated files without starting services:
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
Use this exact sequence:
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.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