Skip to content

CIRCE / DOCUMENTATION

How it works

The lifecycle from circe start to a dispatched interaction, and what Circe deliberately does not do.

Documentation menu
On this page

Circe owns the process. You supply declarations in known places; the CLI finds, validates and wires them.

Lifecycle

  1. Load circe.config.ts and validate the environment schema.
  2. Resolve integrations: their setup() can add scan roots, lifecycle hooks and health checks.
  3. Scan scanRoot (default ./src) by folder convention.
  4. Validate every module’s shape and look for identity collisions. Failures are reported together and exit with code 1.
  5. Start the transport: gateway login, HTTP server, or both.
  6. Dispatch each interaction through middleware, guards and your handler, inside a correlation scope.

circe build stops after step 4, without connecting to Discord.

Boundaries

  • No dependency-injection container: pass dependencies with imports.
  • No plugin system: integrations only add scan roots, lifecycle hooks and health checks.
  • No wrapper over discord.js: ctx.interaction is the real object.

Programmatic form

circe.config.ts compiles down to createCirce(options), which you can call yourself. See API.