🚀
Mission Control · T-0 · All Systems Go

chatops.js
Command-First ChatOps

A deterministic, auditable ChatOps framework for Bun. Route chat commands to infrastructure with confidence — built for Slack, Discord, Teams, CLI, and any adapter you write.

Mission Parameters
🎯
Command-First

Canonical command IDs instead of fragile regex patterns. Every action is predictable and auditable.

🔌
Thin Adapters

Adapters translate — they don't decide. Business logic lives in commands, not in platform glue code.

🛡️
Permissions & Confirmation

Built-in permission grants and confirmation flows for destructive operations. Safety first.

🧩
Module System

Drop .js files into your modules directory. They load automatically — no central registry needed.

📋
Audit Built-In

Correlation IDs and lifecycle events on every command. Know exactly who did what, and when.

⚡
Bun Native

Built for Bun. Zero runtime dependencies. Fast startup, fast execution.

Quick Start
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. 🚀
The Architecture

chatops.js is structured in five clean layers — each with a single, well-defined responsibility:

Layer Responsibility
Kernel / RobotLifecycle, middleware chain, command dispatch, audit logging
AdaptersNormalize provider events → envelopes; translate responses back
Command BusRegister, resolve, validate, authorize, confirm commands
ModulesPackage commands and middleware as isolated, auto-loaded plugins
StorageEphemeral per-invocation state + pluggable durable storage
📡
The Hubot Successor

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.

Next Steps