/ Docs

CLI Reference

Overview

The Bounda CLI is provided by two packages:

  • @bounda-dev/codegen — the CLI binary (bounda) with generate and clean commands
  • @bounda-dev/ops — ops commands (dlq, process-manager) registered at startup when the package is installed

Install both for full CLI functionality:

npm install -D @bounda-dev/codegen @bounda-dev/ops

If @bounda-dev/ops is not installed, the dlq and process-manager commands are unavailable. Running them prints an install hint.

All commands can be run with npx bounda or, if installed globally, just bounda.

bounda generate

Generate code and type definitions from your domain files.

npx bounda generate
npx bounda gen
OptionDescription
-w, --watchWatch for file changes and regenerate automatically
-v, --verboseShow verbose output during generation
-r, --root <path>Project root directory (default: current working directory)

The gen alias is available for convenience. When used with --watch, the generator re-runs whenever domain files matching the configured patterns change.

bounda clean

Remove all generated code and type definitions.

npx bounda clean
OptionDescription
-r, --root <path>Project root directory (default: current working directory)

This deletes the output directory (.bounda by default) and all generated +types directories.

Policy Dead Letter Queue

Failed policy executions are captured in a dead letter queue (DLQ) for inspection and replay. These commands manage the policy DLQ.

bounda dlq list

List failed policy executions.

npx bounda dlq list
npx bounda dlq list --policy sendConfirmation --since 2026-03-01
OptionDescription
-p, --policy <name>Filter by policy name
-s, --since <date>Show entries since date (ISO format)
-e, --error-type <type>Filter by error type (terminal, retriable_exhausted)
--show-replayedInclude entries that have already been replayed
-r, --root <path>Project root directory

bounda dlq show

Show details of a specific DLQ entry.

npx bounda dlq show <id>

Displays the full error, event payload, and metadata for the given DLQ entry.

bounda dlq replay

Replay a failed policy execution.

npx bounda dlq replay <id>
npx bounda dlq replay --policy sendConfirmation
OptionDescription
-p, --policy <name>Replay all failures for a specific policy
-r, --root <path>Project root directory

When called with an id, replays that single entry. When called with --policy, replays all failed entries for the named policy.

bounda dlq delete

Delete a DLQ entry or entries matching a time filter.

npx bounda dlq delete <id>
npx bounda dlq delete --older-than 7d
OptionDescription
--older-than <duration>Delete entries older than the specified duration (e.g., 7d, 24h)
-r, --root <path>Project root directory

bounda dlq cleanup

Clean up old succeeded policy execution records based on the configured executionsTTL.

npx bounda dlq cleanup
OptionDescription
-r, --root <path>Project root directory

Records older than the TTL (default: 7 days) are removed.

Process Manager Commands

Inspect and manage process manager instances.

bounda process-manager list

List process manager instances.

npx bounda process-manager list
npx bounda process-manager list --status started --type onboarding
OptionDescription
-t, --type <name>Filter by process manager type
-s, --status <status>Filter by status (started, completed, failed, timed_out)
-a, --aggregate <id>Filter by aggregate ID
-r, --root <path>Project root directory

bounda process-manager show

Show details of a specific process manager instance.

npx bounda process-manager show <id>

bounda process-manager history

Show execution history of a process manager instance.

npx bounda process-manager history <id>
npx bounda process-manager history <id> --limit 20
OptionDescription
-l, --limit <number>Maximum number of results (default: 50)
-r, --root <path>Project root directory

Process Manager Dead Letter Queue

Failed process manager handler executions have their own DLQ, separate from the policy DLQ.

bounda process-manager dlq list

List failed process manager handlers.

npx bounda process-manager dlq list
npx bounda process-manager dlq list --type onboarding --error-type terminal
OptionDescription
-t, --type <name>Filter by process manager type
-s, --since <date>Show entries since date (ISO format)
-e, --error-type <type>Filter by error type (terminal, retriable_exhausted)
--show-replayedInclude entries that have already been replayed
-r, --root <path>Project root directory

bounda process-manager dlq show

Show details of a specific process manager DLQ entry.

npx bounda process-manager dlq show <id>

bounda process-manager dlq replay

Replay a failed process manager handler.

npx bounda process-manager dlq replay <id>
npx bounda process-manager dlq replay --type onboarding
OptionDescription
-t, --type <name>Replay all failures for a specific process manager type
-r, --root <path>Project root directory

bounda process-manager dlq delete

Delete a process manager DLQ entry.

npx bounda process-manager dlq delete <id>
npx bounda process-manager dlq delete --older-than 7d
OptionDescription
--older-than <duration>Delete entries older than the specified duration (e.g., 7d, 24h)
-r, --root <path>Project root directory