๐Ÿš€
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