Demo Bot (CLI)
DemoBot is a CLI bot for local testing β no external messaging API needed. Install with
pip install cmdop-bot (no extras required). Runs directly in your terminal with rich
formatting. Supports all standard commands plus chat mode where plain text goes to the AI
agent. Token streaming is enabled by default.
CLI bot for local testing. No external messaging API needed β runs directly in your terminal with rich formatting.
How do I install?
# Install the base package β DemoBot uses rich for terminal output (included by default)
pip install cmdop-botNo channel extras required β DemoBot uses rich for terminal formatting (included by default).
How do I use the DemoBot?
from cmdop_bot.channels.demo import DemoBot
# Create a DemoBot pointing at your CMDOP API and target machine
bot = DemoBot(
cmdop_api_key="cmdop_xxx", # Your CMDOP API key
machine="my-server", # Default target machine hostname
)
bot.run() # Starts the interactive CLI session in your terminalWhat parameters are available?
| Parameter | Type | Required | Description |
|---|---|---|---|
cmdop_api_key | str | Yes | CMDOP API key |
machine | str | No | Default target machine hostname |
model | str | No | AI model tier (use Model.balanced() etc.) |
server | str | No | gRPC server address (e.g. 127.0.0.1:50051) |
insecure | bool | No | Disable TLS (for local dev) |
timeout | float | No | Command timeout in seconds (default: 120.0) |
stream | bool | No | Stream agent tokens in real-time (default: True) |
What commands are supported?
| Command | Description |
|---|---|
/help | Show available commands |
/agent <task> | Run AI agent (with streaming) |
/shell <cmd> | Execute shell command |
/exec <cmd> | Alias for /shell |
/ls [path] | List directory |
/cat <path> | Read file |
/machine [name] | Show or set target machine |
/status | Show current machine and model |
/quit | Exit the bot |
How does chat mode work?
Any text that doesnβt start with / is sent directly to the AI agent:
> Check disk usage on this server
β³ Thinking...
Using tool: execute_shell
...How does streaming work?
When stream=True (default), agent responses stream token-by-token to your terminal. Tool usage events are also shown:
> Analyze the nginx config
Using tool: read_file
Using tool: execute_shell
The nginx configuration shows...How do I connect to a local agent?
Connect directly to a local agent without cloud relay:
# Point the bot at a local gRPC agent server instead of the cloud
bot = DemoBot(
cmdop_api_key="cmdop_xxx",
server="127.0.0.1:50051", # Local gRPC server address
insecure=True, # Disable TLS for local development
)
bot.run() # Starts the CLI session connected to the local agent