praisonai-bot Package Migration
Where bots, gateway, and channel CLI live after the C9 extraction from the praisonai wrapper into a new sibling PyPI package
praisonai-bot is a new sibling PyPI package holding the bots, gateway, and channel CLI — extracted from the praisonai wrapper — and every existing import still works via alias_package shims.
from praisonaiagents import Agent
agent = Agent(
name="Support",
instructions="Answer support questions from users on Telegram, Slack, and Discord.",
llm="gpt-4o-mini",
)
agent.start("Hello — reply if you see this.")A gateway process running praisonai-bot gateway start routes each Telegram/Slack/Discord message to this agent and posts the reply back.
Quick Start
- Nothing changes if you install the wrapper
pip install praisonaipulls inpraisonai-bottransitively. Every existing command still works:bash pip install praisonai praisonai bot serve --config bot.yaml praisonai serve gateway --config gateway.yaml - Standalone install for headless workers or containers
Install only what your container needs:
bash pip install praisonai-bot[gateway,bot] praisonai-bot gateway start --config gateway.yaml praisonai-bot bot start --config bot.yaml - Agent-centric example — route messages from any channel
python from praisonaiagents import Agent agent = Agent( name="Support", instructions="Answer support questions from users on Telegram, Slack, and Discord.", llm="gpt-4o-mini", ) agent.start("Hello — reply if you see this.")Run the gateway alongside it:
bash praisonai-bot gateway start --agents agents.yamlMessages arrive from any configured channel, the agent replies, and the gateway posts the response back.
How It Works
The gateway is the only process that holds channel credentials. Agents never talk directly to Telegram, Slack, or Discord — they receive plain text and return plain text. The gateway handles platform-specific formatting, rate-limiting, and delivery guarantees.
Which install shape is right for me?
Compatibility Guarantees
Every existing import path continues to resolve. No code changes required.
| Old path (still works) | Resolves to |
|---|---|
from praisonai.bots import Bot | praisonai_bot.bots.Bot |
from praisonai.bots.telegram import TelegramBot | praisonai_bot.bots.telegram.TelegramBot |
from praisonai.gateway import GatewayConfig | praisonai_bot.gateway.GatewayConfig |
from praisonai.gateway.server import GatewayServer | praisonai_bot.gateway.server.GatewayServer |
from praisonai.daemon import ... | praisonai_bot.daemon.* |
| CLI command modules (bot / gateway / channels) | praisonai_bot.cli.commands.* |
pip install praisonairemains the canonical user-facing install.praisonai.bots.,praisonai.gateway.,praisonai.daemon.are stable API — they arealias_packageshims backed bypraisonai_bot..- Shim registration is safe under concurrent module imports — if another thread mutates
sys.moduleswhile shims are being installed (e.g. an async client loading modules during a parallel test run), the shim retries the snapshot and falls back to key-by-key reads instead of raisingRuntimeError: dictionary changed size during iteration. praisonai-bothas no hard PyPI dependency onpraisonai— no import cycle.- Any access that
praisonai-botneeds into the wrapper goes through_wrapper_bridgeat call time, degrading gracefully when the wrapper is absent.
New CLI: praisonai-bot
The praisonai-bot binary is separate from the praisonai binary. It exposes:
praisonai-bot
├── bot Start messaging bots with full agent capabilities
│ ├── start Start a bot from a YAML config file (zero-code)
│ ├── telegram Start a Telegram bot
│ ├── discord Start a Discord bot
│ ├── slack Start a Slack bot
│ └── ...
├── gateway Manage the PraisonAI gateway server
│ ├── start Start the gateway server
│ ├── stop Stop a running gateway instance
│ └── status Check gateway and daemon status
├── pairing Manage bot pairing
├── identity Manage bot identity
├── onboard Onboard a new bot
├── kanban Kanban integration
├── claw Channel-agnostic bot operations
└── mint-link Mint magic linksExamples:
praisonai-bot gateway start --config gateway.yaml
praisonai-bot gateway start --agents agents.yaml --port 9000
praisonai-bot gateway stop
praisonai-bot gateway status
praisonai-bot bot start --config bot.yaml
praisonai-bot bot telegram --token $TELEGRAM_BOT_TOKEN --model gpt-4o-mini
praisonai-bot bot slack --token $SLACK_BOT_TOKEN --memory
praisonai-bot mint-link # hyphen form (matches --help output)
praisonai-bot mint-link --ttl 600 # with custom TTL
praisonai-bot mint_link # underscore form (backward-compatible)Extending: Register a New Channel
praisonai-bot discovers channel adapters via the praisonai.channels entry-point group at startup. No changes to praisonai-bot itself are needed.
To publish a third-party channel adapter, add an entry-point in your package’s pyproject.toml:
[project.entry-points."praisonai.channels"]
mattermost = "my_pkg.mattermost:MattermostBot"The gateway/bot loader calls entry_points(group="praisonai.channels") on startup and registers every discovered adapter automatically.
Built-in Channels
| Entry-point key | Class |
|---|---|
telegram | praisonai_bot.bots.telegram:TelegramBot |
discord | praisonai_bot.bots.discord:DiscordBot |
slack | praisonai_bot.bots.slack:SlackBot |
whatsapp | praisonai_bot.bots.whatsapp:WhatsAppBot |
linear | praisonai_bot.bots.linear:LinearBot |
email | praisonai_bot.bots.email:EmailBot |
agentmail | praisonai_bot.bots.agentmail:AgentMailBot |
Behavior changes
Recent fixes to the praisonai bot ... CLI that operators upgrading should know about:
| Change | What to expect |
|---|---|
| Declared platform wins | bot start respects the config’s platform: even when the token comes from the environment. Other platforms are no longer auto-enabled from unrelated credentials — a warning names each one skipped. |
token: is optional | Omit token: and the declared platform: resolves its own documented env var (TELEGRAM_BOT_TOKEN, etc.). |
| Slack app token required | bot slack now errors early if --app-token / SLACK_APP_TOKEN is missing (previously it silently subscribed to nothing). |
| Non-blocking bots stay up | linear, email, agentmail, webhook, and WhatsApp cloud no longer exit 0 in ~1s — the loop is held open while the adapter runs. |
| Non-zero exit codes | Any startup failure now exits 1, so systemd Restart=on-failure and if praisonai bot ... ; then scripting work. |
New bot run verb | praisonai bot run --platform <name> starts any registered platform — including local, signal, webhook, plugin channels, and adapter: drop-ins. Declared channel config_fields (including plugin/registry channels) are also accepted as --field-name flags. See praisonai bot run. |
Best Practices
Keep using praisonai.bots / praisonai.gateway in library code
Application and library code should continue to import from praisonai.bots, praisonai.gateway, and praisonai.daemon. These paths are the stable public API backed by alias_package shims. praisonai_bot.* is an alternative available path, not a replacement — the shim layer allows the physical package layout to evolve without breaking callers.
Use praisonai-bot extras for headless workers
For containers or workers that don’t need the full praisonai wrapper, install only the extras you need:
pip install praisonai-bot[gateway]— WebSocket gateway only (~200 MB fewer transitive deps than the full wrapper).pip install praisonai-bot[bot]— messaging platform adapters only.pip install praisonai-bot[gateway,bot]— full inbound-and-outbound flow.pip install praisonai-bot[all]— shortcut for[gateway,bot].
Extras are additive — install only what you need
[gateway] pulls in FastAPI, uvicorn, SSE-starlette, websockets, watchdog, and redis. [bot] pulls in python-telegram-bot, discord.py, slack_sdk, slack-bolt, and psutil. Installing both is safe and additive. [bot-whatsapp-web] adds neonize and qrcode for WhatsApp Web support.
Alias shims are load-bearing — do not remove them as cleanup
praisonai.bots, praisonai.gateway, and praisonai.daemon are alias_package shims in the wrapper. Removing or rewriting imports away from these paths in your own code is not a “cleanup” — they are the stable API. praisonai_bot.* is a new alternative surface for users who want the standalone install shape.
Related
The C0–C6 sibling extraction that moved the agentic terminal CLI into its own package
Python WrapperThe praisonai wrapper — four-tier architecture reference for contributors
GatewayGateway and control plane — WebSocket server, config, and deployment
Messaging BotsBot platform documentation — Telegram, Discord, Slack, WhatsApp, and more