Multi-bot sandbox factory
Every bot gets its own popopx-cli process, its own cli-data directory, its own control port and its own SQLite files, started and stopped from one screen.
- run-cli.sh
- cli.pid
- cli-data/
- ports 5230+
AGPL-3.0-only · Open console
Create a bot, get its permanent address, then let rules answer, forward enquiries to your support group and open a ticket per customer. Everything runs on loopback, nothing is bundled.
git clone https://github.com/popopx-chat/popopx-bot-studio.git
cd popopx-bot-studio && ./install_ubuntu22.sh --check
The installer only reads the system until you run it without --check; popopx-cli is fetched at runtime, never committed.
01 / FEATURES
BotFather-grade control over many isolated bots, with the reply, routing and ticket flow you would otherwise script by hand.
Every bot gets its own popopx-cli process, its own cli-data directory, its own control port and its own SQLite files, started and stopped from one screen.
Each bot gets its own CLI data directory and permanent contact link, so reconnecting users always reach the same bot.
Match a keyword, exact phrase or regular expression and reply with a template. Cooldown keeps a chatty user from being spammed.
Forward enquiries into a support group with a #T ticket id; an operator answers with the ticket id and the reply goes back to the customer.
The identity key, the ledger and every message log live in files you own with mode 0600. There is no cloud account to lose and no vendor holding a copy.
Inbound messages pass plugins first, then rules, then routing. A plugin can reply, forward or stay silent without touching the engine.
Plugins
auto_reply
Layered Q&A and command menus
Answers from a keyword table, offers a numbered menu and falls back to a human handoff.
msg_router
Cross-chat and cross-group routing
Aggregates alerts, mirrors a direct message into a group and keeps the ticket id attached.
llm_bridge
OpenAI-compatible assistant
Point it at any compatible base URL, set the model, and the bridge asks only when a rule did not match.
webhook_relay
Inbound alerts and outbound callbacks
Turns an external monitor webhook into a bot message, and a customer reply into your own webhook call.
02 / SECURITY
A hosted bot platform holds your identity, your contacts and your message history. A self-hosted studio holds the same files for you instead.
| Dimension | POPOPX Bot Studio | Hosted platform bot |
|---|---|---|
| Identity key | Local file, mode 0600 | Held by the provider |
| Message ledger | SQLite in var/studio | Provider database |
| Encryption | End to end per contact | Transport only |
| Isolation | One process and one data dir per bot | Shared tenant space |
| Account risk | Nothing to ban: no account | Ban or rate limit at will |
| Metadata | No phone number, no user id | Contact graph and usage stats |
The engine refuses to start on a non-loopback address unless STUDIO_ALLOW_LAN=1 is set on purpose.
03 / DEPLOY
Four paths, the same engine: a production Linux box, a Mac you keep running, a development checkout, or the three clicks inside the console.
Installs Python 3.11, creates a system user, writes a systemd unit and pulls popopx-cli for your architecture.
sudo apt update && sudo apt install -y git python3.11-venv
git clone https://github.com/popopx-chat/popopx-bot-studio.git
cd popopx-bot-studio
./install_ubuntu22.sh --dry-run # plan only, nothing written
sudo ./install_ubuntu22.sh --mode native
systemctl status popopx-bot-studio
sudo -u popopx-studio cat /etc/popopx-bot-studio/.env
Registers a launchd agent so the studio comes back after a reboot, using the same installer flags as Linux.
git clone https://github.com/popopx-chat/popopx-bot-studio.git
cd popopx-bot-studio
./install_macos.sh --check # report what would change
./install_macos.sh # launchd agent + venv
./install_macos.sh --lan # bind a LAN address on purpose
launchctl list | grep popopx
open http://127.0.0.1:8090
No system service, no sudo: a virtualenv on your laptop with the console on loopback port 8090.
./start_macos.sh # venv + 127.0.0.1:8090
STUDIO_ADMIN_TOKEN=dev-token \
STUDIO_DATA_DIR=$PWD/var/studio \
BOT_WS_PORT_BASE=5230 BOT_WS_PORT_MAX=5299 \
python3 -m uvicorn studio.app.main:app --port 8090
Three moves in the console, then the Open API is yours.
Install popopx-cli from the official releases (checksum verified) and start the studio.
Create a bot in the console, pick its SMP servers and read the permanent address or QR code.
Describe your support flow: add reply rules and a routing rule that targets the group.
Call the Open API with the bot token, or let a plugin take over the conversation.
04 / OPEN API
Call sendMessage with the bot token, register a webhook, or poll getUpdates. The admin console and the API share one engine and one loopback port.
Reply to any contact or group the bot already reaches.
curl -X POST http://127.0.0.1:8090/bot$BOT_TOKEN/sendMessage \
-H "content-type: application/json" \
-d '{"chat_ref":"<contact>","text":"Deploy finished."}'
Push inbound events to your own endpoint instead of polling.
curl -X POST http://127.0.0.1:8090/bot$BOT_TOKEN/setWebhook \
-d '{"url":"https://intranet.local/hooks/popopx"}'
Read the ring buffer behind the gateway, newest last.
curl "http://127.0.0.1:8090/bot$BOT_TOKEN/getUpdates?limit=50"
Tokens and admin credentials are read from .env on your host; the site never sends anything anywhere.
05 / FAQ
Licence, agents, migration and the difference to a commercial service account.
Yes. AGPL-3.0 obliges you to share the source of the studio itself when you offer a modified version over a network, including changes to the engine and the plugins. Your bots, rules, reply texts and message data are your content and are not affected. The licence text is in the repository root.
Routing forwards an enquiry into a support group with a #T ticket id and the bot keeps the original chat reference. Any agent replies with that ticket id, and the engine sends the answer back to the customer only. Every hand is written to the audit log with the actor and the timestamp.
Export a bundle from the cold-backup screen: the bot is stopped, its cli-data directory, keys and settings are packed, and the bot starts again. Copy the archive to the new host, restore it, and the permanent contact address stays the same because identity lives in those files, not in a vendor account.
A service account is a rented identity: the provider issues the token, keeps the message graph, sets the rate limits and can end the account. The studio issues the token itself, keeps the ledger on your disk and has no account to close. The trade is that you own the uptime, the backups and the updates.
The console and the Open API carry an admin token, so an exposed port is the most likely way in. The engine validates the bind address at start-up and refuses a non-loopback host unless you set STUDIO_ALLOW_LAN=1 on purpose. Put Caddy or nginx in front, keep the port closed and add TLS plus your own authentication there.
No binary is committed to the repository, because the AGPL licence and the download both point at the official releases. The installer fetches the archive for your operating system and architecture, verifies the SHA-256 checksum, then unpacks it into the data directory. Nothing about your bots is part of that request.
Something wrong or missing? popopx-bot-studio · issues