The ds utils commands provide operational tools for maintenance, data repair, and codebase health checks. These are primarily used by developers maintaining production or investigating data integrity issues.
ds utils maintenance-mode enable
Sets DEVSTRIDE_MAINTENANCE_MODE=true on all Lambda functions in the target stage. While enabled:
ds utils maintenance-mode disable
Removes the DEVSTRIDE_MAINTENANCE_MODE environment variable from all Lambda functions, restoring normal operation.
dev or prod affects all users immediately. Coordinate with the team before enabling. Typically used during database migrations, infrastructure changes, or emergency fixes.These commands fix data integrity issues that can arise from bugs, migration edge cases, or manual database edits.
ds utils repair item-aggregations --target phil-local -o org_abc123
Recalculates rolled-up values on parent items, boards, and work types:
| Entity | Recalculated Fields |
|---|---|
| Parent items | Estimates, effort, time spent, child counts |
| Boards | Total item counts |
| Work types | Item counts per type |
Scans all children to rebuild aggregation values from source data.
Options:
| Flag | Description |
|---|---|
--target <stage> | Target stage |
-o, --organization <id> | Organization ID |
When to use:
ds utils repair item-hierarchy --target phil-local -o org_abc123
Rebuilds the hierarchy and hierarchyPath fields by walking the entire parent-child tree. Fixes broken hierarchy metadata without deleting any items.
Options:
| Flag | Description |
|---|---|
--target <stage> | Target stage |
-o, --organization <id> | Organization ID |
When to use:
ds utils delete-orphaned-items.ds utils repair min-max-dates --target phil-local
Recalculates rolled-up date ranges on parent items:
When to use:
# Preview what would be deleted
ds utils delete-orphaned-items --target phil-local --dry-run
# Execute deletion
ds utils delete-orphaned-items --target phil-local
Finds items with no valid parent and deletes them with full cascading cleanup:
| Related Data | Cleaned Up |
|---|---|
| Activity logs | Deleted |
| Comments | Deleted |
| Notifications | Deleted |
| Roadmap items | Deleted |
| Transactions | Deleted |
| GitHub PRs/commits/branches | Unlinked |
| Sub-items | Recursively deleted |
Options:
| Flag | Description |
|---|---|
--target <stage> | Target stage |
--dry-run | Preview without deleting |
--dry-run first to review what would be deleted.ds utils query-active-emails --target dev
Exports active user emails to two files:
emails.csv — CSV format with headersemails.txt — Comma-separated unique listCriteria: Users who are active members of organizations with active subscriptions. Useful for announcements, user count audits, or marketing.
These commands check for common issues in the codebase — missing registrations, incomplete wiring, or forgotten init files.
ds utils check missing-inits
Scans Command and Query handler files and reports any that aren't registered in their module's init file. Unregistered handlers will never execute because the DI container doesn't know about them.
ds utils check missing-correlation-ids
Checks that all handlers call setCorrelationId() for distributed tracing. Missing correlation IDs make it difficult to trace requests through the event-driven system.
setCorrelationId is called indirectly (e.g., via a base class method). Verify flagged handlers manually.ds utils check missing-event-handlers
Scans for event handler files not wired up in module init files:
Unwired handlers exist on disk but will never be triggered.