Canonical command IDs instead of fragile regex patterns. Every action is predictable and auditable.
Adapters translate โ they don't decide. Business logic lives in commands, not in platform glue code.
Built-in permission grants and confirmation flows for destructive operations. Safety first.
Drop .js files into your modules directory. They load automatically โ no central registry needed.
Correlation IDs and lifecycle events on every command. Know exactly who did what, and when.
Built for Bun. Zero runtime dependencies. Fast startup, fast execution.
bun add @devchitchat/chatopsjs
import { Robot, Command, createTextResponse } from '@devchitchat/chatopsjs'
const robot = await Robot.create({ directory: './modules' })
// Modules auto-load from ./modules/*.js
// Or register commands inline:
robot.commands.register(new Command({
id: 'hello',
description: 'Say hello from mission control',
handler: async (ctx) => createTextResponse(
`Hello ${ctx.envelope.actor.id}! All systems nominal. ๐`
)
}))
// Start the built-in CLI adapter
import { CliAdapter } from '@devchitchat/chatopsjs'
const cli = new CliAdapter(robot)
robot.adapters.add(cli)
await cli.start()
$ bun run src/cli.js
chatops> hello
Hello mission-control! All systems nominal. ๐
chatops.js is structured in five clean layers โ each with a single, well-defined responsibility:
| Layer | Responsibility |
|---|---|
| Kernel / Robot | Lifecycle, middleware chain, command dispatch, audit logging |
| Adapters | Normalize provider events โ envelopes; translate responses back |
| Command Bus | Register, resolve, validate, authorize, confirm commands |
| Modules | Package commands and middleware as isolated, auto-loaded plugins |
| Storage | Ephemeral per-invocation state + pluggable durable storage |
chatops.js is a modern successor to Hubot โ deterministic where Hubot was ambient, auditable where Hubot was opaque, and strongly-typed where Hubot relied on pattern matching.