Expand description
botkit-cli: an IM platform implemented as an agent-friendly CLI.
Instead of talking to Discord/Telegram/Matrix, a CliBot speaks a JSONL
wire protocol: drivers inject Inbound events (messages, commands,
button presses, reactions, edits — with media, stickers, threads, and
replies) and observe every Outbound action the bot performs
(messages, files, reactions, edits, deletes, pins, typing indicators).
Two transports:
Transport::Stdio— stdin/stdout, forcargo rundebugging.Transport::Unix— a unix socket thebotkit-clidriver binary connects to, for driving a long-running bot process.
Transport::Manual attaches nothing: the owner injects and subscribes
through the CliHub handle directly (tests, in-process embedding).
ⓘ
use botkit_cli::{CliBot, Transport};
use botkit_core::Bot;
let bot = CliBot::new(Transport::Stdio)
.command("ping", || async { "pong" })
.message(|ctx: botkit_core::Context| async move {
format!("echo: {}", ctx.message_content().unwrap_or(""))
});
bot.run().await?;Re-exports§
Modules§
- wire
- The JSONL wire protocol shared by the bot-side transport and the
botkit-clidriver binary.
Structs§
- CliAction
Sender - Chat action sender that reports indicators as outbound
actionlines. - CliBot
- A bot whose “platform” is the CLI wire protocol.
- CliContext
Data - Per-event context for the CLI platform.
- CliHub
- Shared CLI-platform state.
Enums§
- Transport
- How the CLI platform moves events and actions.