cmdop-bot
The cmdop-bot package (pip install cmdop-bot) provides multi-channel bot integrations
for controlling remote servers via Telegram, Discord, or Slack. Built on the cmdop Python
SDK. Supports IntegrationHub for running multiple channels simultaneously, built-in
command handlers for shell, AI agent, file operations, and skills management, and fine-grained permissions.
Multi-channel bot integrations for remote machine access. Control your servers via Telegram, Discord, or Slack.
Built on the cmdop Python SDK. Simple, reliable, open-source.
pip install cmdop-botHow do I install with channel support?
# With Telegram support (aiogram)
pip install "cmdop-bot[telegram]"
# With Discord support (discord.py)
pip install "cmdop-bot[discord]"
# With Slack support (slack-bolt)
pip install "cmdop-bot[slack]"
# With all channels
pip install "cmdop-bot[all]"How do I get started?
Telegram
# Import Model for AI tier selection and TelegramBot channel
from cmdop_bot import Model
from cmdop_bot.channels.telegram import TelegramBot
# Create a Telegram bot instance with authentication and target machine
bot = TelegramBot(
token="YOUR_TELEGRAM_BOT_TOKEN", # Bot token from @BotFather
cmdop_api_key="cmdop_xxx", # Your CMDOP API key
allowed_users=[123456789], # Restrict to specific Telegram user IDs
machine="my-server", # Default target machine hostname
model=Model.balanced(), # AI model tier: cheap, balanced, or smart
)
# Start the bot (blocking call β runs the aiogram event loop)
bot.run()Discord
# Import the Discord channel integration
from cmdop_bot.channels.discord import DiscordBot
# Create a Discord bot with guild-scoped slash commands
bot = DiscordBot(
token="YOUR_DISCORD_BOT_TOKEN", # Bot token from Discord Developer Portal
cmdop_api_key="cmdop_xxx", # Your CMDOP API key
guild_ids=[123456789], # Guild IDs for instant command sync
)
# Start the bot (blocking call β runs the discord.py event loop)
bot.run()Slack
# Import the Slack channel integration
from cmdop_bot.channels.slack import SlackApp
# Create a Slack app with Socket Mode for real-time events
app = SlackApp(
bot_token="xoxb-YOUR-BOT-TOKEN", # Slack bot token (xoxb- prefix)
app_token="xapp-YOUR-APP-TOKEN", # Slack app-level token for Socket Mode
cmdop_api_key="cmdop_xxx", # Your CMDOP API key
)
# Start the Slack app (blocking call β runs the slack-bolt event loop)
app.run()IntegrationHub (Multi-Channel)
# Import IntegrationHub for running multiple channels at once
from cmdop_bot import IntegrationHub
from cmdop_bot.channels.telegram import TelegramBot
from cmdop_bot.channels.discord import DiscordBot
# Create a hub that manages shared CMDOP connection and target machine
hub = IntegrationHub(cmdop_api_key="cmdop_xxx", machine="my-server")
# Register each channel β they share the same CMDOP backend
hub.add_channel(TelegramBot(token="tg_xxx", cmdop_api_key="cmdop_xxx"))
hub.add_channel(DiscordBot(token="dc_xxx", cmdop_api_key="cmdop_xxx"))
# Start all channels concurrently (async β use inside an async function)
await hub.start()What commands are available?
| Channel | Command | Description |
|---|---|---|
| Telegram | /shell <cmd> | Execute shell command |
| Telegram | /agent <task> | Run AI agent task |
| Telegram | /ls [path] | List directory |
| Telegram | /cat <path> | Read file |
| Telegram | /skills list|show|run | Skills management |
| Telegram | /skill <name> <prompt> | Run a skill (shorthand) |
| Telegram | /machine <host> | Set target machine |
| Discord | /shell <cmd> | Execute shell command |
| Discord | /agent <task> | Run AI agent task |
| Discord | /ls [path] | List directory |
| Discord | /cat <path> | Read file |
| Discord | /skills <action> [name] [prompt] | List, show, or run skills |
| Discord | /skill <name> <prompt> | Run a skill (shorthand) |
| Discord | /status | Show connection status |
| Slack | /cmdop shell <cmd> | Execute shell command |
| Slack | /cmdop agent <task> | Run AI agent task |
| Slack | /cmdop ls [path] | List directory |
| Slack | /cmdop cat <path> | Read file |
| Slack | /cmdop skills list|show|run | Skills management |
| Slack | /cmdop skill <name> <prompt> | Run a skill (shorthand) |
| Slack | /cmdop status | Show connection status |
How does the architecture work?
Telegram (aiogram) βββ βββ Shell
Discord (discord.py) βββ€ββ CMDOPHandler βββ€ββ Agent
Slack (slack-bolt) βββββ cmdop SDK βββ Files ββ Your Servers
βββ SkillsWhat environment variables are used?
| Variable | Description | Required |
|---|---|---|
TELEGRAM_BOT_TOKEN | Telegram bot token | For Telegram |
DISCORD_BOT_TOKEN | Discord bot token | For Discord |
SLACK_BOT_TOKEN | Slack bot token (xoxb-...) | For Slack |
SLACK_APP_TOKEN | Slack app token (xapp-...) | For Slack |
CMDOP_API_KEY | CMDOP API key | Yes |
CMDOP_MACHINE | Default target machine | No |
CMDOP_MODEL | Model tier (@cheap, @balanced, @smart) | No |
Next Steps
Setup Telegram bot with aiogram
Setup Discord bot with discord.py
Setup Slack app with slack-bolt
Test locally with DemoBot
Use CMDOPHandler directly
Built-in command handlers
Control access to your bot
AI model tiers and data models