Skip to Content

cmdop-bot

TL;DR

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-bot

How 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?

ChannelCommandDescription
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|runSkills 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/statusShow 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|runSkills management
Slack/cmdop skill <name> <prompt>Run a skill (shorthand)
Slack/cmdop statusShow connection status

How does the architecture work?

Telegram (aiogram) ──┐ ┌── Shell Discord (discord.py) ──┤── CMDOPHandler ──┤── Agent Slack (slack-bolt) ────┘ cmdop SDK ├── Files ── Your Servers └── Skills

What environment variables are used?

VariableDescriptionRequired
TELEGRAM_BOT_TOKENTelegram bot tokenFor Telegram
DISCORD_BOT_TOKENDiscord bot tokenFor Discord
SLACK_BOT_TOKENSlack bot token (xoxb-...)For Slack
SLACK_APP_TOKENSlack app token (xapp-...)For Slack
CMDOP_API_KEYCMDOP API keyYes
CMDOP_MACHINEDefault target machineNo
CMDOP_MODELModel 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

Last updated on