On this page

Defined in cli/commands/script.ts. A grab-bag of one-off scripts and everyday maintenance commands — most take no flags at all. Maintenance & Codebase Checks explains when to reach for each; this section lists what exists.

ds script find-missing-inits#

ds script find-missing-inits

Codebase scan for Command/Query handlers that aren't wired up in their module's init file. No flags.

ds script find-missing-set-correlation-ids#

ds script find-missing-set-correlation-ids

Codebase scan for handlers missing correlation-ID propagation. No flags.

ds script find-missing-events-registration#

ds script find-missing-events-registration

Codebase scan for domain/integration events that aren't registered. No flags.

ds script find-missing-events-in-stack#

ds script find-missing-events-in-stack

Codebase scan for event handlers missing from the infrastructure stack. No flags.

ds script find-missing-eventbridge-target-dlq / find-missing-sns-subscription-dlq#

ds script find-missing-eventbridge-target-dlq
ds script find-missing-sns-subscription-dlq

Two more wiring scans, over the infrastructure stacks rather than the module code: every EventBridge rule target, and every SNS subscription, must have a dead-letter queue, or a failed delivery is lost silently. Both print nothing when they pass. They run in the pre-commit hook beside the four scans above, and as part of the infra-synthesis pre-ship check whenever a change touches stacks/** or deploy configuration. No flags.

ds script generate-api-docs#

ds script generate-api-docs

Generates the public-facing OpenAPI spec with embedded documentation. No flags.

ds script generate-api-client#

ds script generate-api-client

Generates the typed frontend TypeScript API client SDK from backend Hono routes (also writes the canonical .ds/tmp/openapi.json). No flags.

ds script generate-api-mcp#

ds script generate-api-mcp

Orchestrates the full MCP-SDK refresh, in order: generate-api-client → generate-api-docs → regenerates packages/mcp/src/devstride/gen/* (sdk, types, schemas, operations, components) by running packages/mcp/scripts/generate.ts. Run this after any backend OpenAPI change — the generated packages/mcp files are committed to git. No flags.

ds script delete-orphaned-items#

ds script delete-orphaned-items

Deletes orphaned folders, work items, activity, comments, and assets from the database. No flags.

ds script set-config#

ds script set-config

Validates 22 unconditionally-required environment variables (DB connection strings including the read-only replica, Stripe keys, OpenAI key, Azure DevOps + Jira app credentials, all four Pusher vars, GitHub app credentials, and more), plus 5 more that are required only if SMTP is configured, then pushes them up as sst secrets set DEVSTRIDE_CONFIG (compressed, base64-encoded JSON). No flags.

Pushes up, does not pull down

ds script set-config writes your local .env values up into the SST DEVSTRIDE_CONFIG secret — it does not pull anything down. To bring values down into .env, use ds secrets pull, then run ds script set-config to push them into your stage. The running backend does not read .env directly at runtime — the CLI-side dotenv.config() only feeds the CLI/build-time process used to synth sst.config.ts. The actual Lambda / sst dev process reads secrets via the SST Config binding, which is exactly what this command populates.

The correct command name is ds script set-config. ds script set-secrets does not exist in this CLI.

ds script sync-identity-providers#

ds script sync-identity-providers

Puts Google (federated) sign-in back on the stage's Cognito app client after a deploy. CDK pins the client's supported-provider list to [COGNITO] on every deploy, because the Google client secret lives inside the DEVSTRIDE_CONFIG secret where CloudFormation cannot read it, so federated login is unavailable until this runs. Idempotent and declarative: it does nothing on a stage with no Google keys and removes a stale provider when the keys are withdrawn; password sign-in is never affected. The deploy pipeline runs it in after_deploy, before the contract migrations. No flags.

ds script check-orphan-stacks#

ds script check-orphan-stacks

Reports orphaned CloudFormation stacks left behind by earlier sst.config.ts changes. No flags.

ds script delete-orphan-stacks#

ds script delete-orphan-stacks

Deletes the orphaned CloudFormation stacks found by the check above. Also invoked internally by ds run backend and by ds script reset-db on AWS-bound stages (skipped on the local Docker stack). No flags.

ds script assistant#

ds script assistant

Likely stale

Built on an old LangChain-based CLI assistant (imports from langchain/chat_models, langchain/agents). Not a reliable everyday tool — flagged here as likely unmaintained.

No flags.

ds script get-active-emails#

ds script get-active-emails

Dumps active users' emails across organizations. No flags.

ds script maintenance-on#

ds script maintenance-on

Enables maintenance mode by toggling a Lambda environment variable. No flags.

ds script maintenance-off#

ds script maintenance-off

Disables maintenance mode. No flags.

ds script api-maintenance-on / api-maintenance-off#

ds script api-maintenance-on
ds script api-maintenance-off

The same toggle, for the public API's Lambdas only: the app keeps working while the API is held. No flags.

ds script backfill-access-permissions#

ds script backfill-access-permissions

Idempotent SQL backfill of baseline module-access permission keys. No flags.

ds script backfill-description-asset-items#

ds script backfill-description-asset-items
DEVSTRIDE_BACKFILL_DRY_RUN=true ds script backfill-description-asset-items   # report only

The half of the description-asset repair a SQL migration cannot do: parses the assets embedded in item descriptions and unfurls their metadata into asset items. DEVSTRIDE_BACKFILL_DRY_RUN=true reports without writing. No flags.

ds script inspect-user-permissions#

ds script inspect-user-permissions <username>

Diagnostic dump of every organization membership for a username, including the role's permissions and is_system_owner flag — useful for telling a stale DB role apart from a stale frontend session. The username is read positionally from process.argv, not a Commander-declared argument; omitting it prints a usage message and exits non-zero. No flags.

ds script reset-db#

ds worktree cli <instance> script reset-db   # local Docker stack
ds script reset-db                            # AWS-bound personal stage

Full reset of one database: terminates other DB connections, drops and recreates the public schema (and drops drizzle), deletes every Cognito user (all pages of the pool), re-runs SQL migrations, and builds the generated Golden dataset from nothing (ds golden build with a scoped reset, Cognito logins included). On an AWS-bound stage it also re-adds Stripe products and cleans up orphan stacks; on the local Docker stack (ds worktree cli …) those two steps and the §16 golden gate are skipped. No source database is read. No flags.

Blocked on prod and shared staging

Throws immediately if DEVSTRIDE_STAGE === "prod"; the golden stage guard also refuses the shared dev staging stage. A bare ds script reset-db binds to AWS — on the local stack always go through ds worktree cli <instance>, using the instance registered for the checkout you are on.

ds script remove-org#

ds script remove-org [-o <organization>]

Deletes all rows for one organization.

Flag Description
-o, --organization <organization> Organization ID to remove

Dev-only guard applies (not safe to run on prod).

ds script create-slack-workflows#

ds script create-slack-workflows

One-off historical migration: provisions Slack notification workflows for existing users. Never run it concurrently with the Teams backfill below or with notification-settings writes. No flags.

ds script create-teams-workflows#

ds script create-teams-workflows --app-origin <url> [--org <organizationId>] [--dry-run]

Reconciles existing Microsoft Teams reminder workflows for existing users. Apply only after the new settings API and membership consumer are deployed and old revisions have drained, and never alongside the Slack backfill above.

Flag Description
--app-origin <url> Required for a real run. Must equal the app origin the process resolves (printed first) — it is the host baked into every created link
--org <organizationId> Only this organization
--dry-run Count what would be created, write nothing

ds script billing-create-account#

ds script billing-create-account --org <organizationId> [--status <status>] [--pays-by card|invoice] [--trial-days <days>]

Rehearsal only. Makes DevStride the manager of one organization's billing on a dev stage, through the real command. It refuses production by stage name and by the database it would write to.

Flag Description
--org <organizationId> Required. The organization to manage
--status <status> trial (default), active, trial_expired, suspended or closed
--pays-by <method> card or invoice; omit for "none chosen yet"
--trial-days <days> Trial length when --status is trial. Default: 14

ds script provision-canary-org#

ds script provision-canary-org --owner <account-id>

Creates the hidden canary organization and its inbound email address, once, on production — the only stage that probes it. Idempotent; a second run changes nothing. It refuses a run whose stage and database disagree in either direction. --owner (required) is the account id of the DevStride staff member who owns the canary organization; they must be active with a @devstride.com email, or the organization is billed.

ds script event-contract-test#

ds script event-contract-test [--skip-negative] [--wait-alarm] [--allow-prod-alarms] [--timeout <seconds>]

Publishes one synthetic standard event and one synthetic FIFO event through the live EventBridge bus and SNS FIFO topic on a deployed stage and asserts they are consumed. --skip-negative runs only the delivery smoke test; --wait-alarm also waits for the sentinel alarm to reach ALARM (slow); --allow-prod-alarms permits the negative path, which fires sentinel alarms, on prod or dev; --timeout is the poll timeout in seconds (default 300). Details on Maintenance & Codebase Checks.

ds script snapshot-event-topology#

ds script snapshot-event-topology [--check] [--out <path>]

Writes a normalized snapshot of the live SNS, SQS and EventBridge topology to infra/event-topology/<stage>.baseline.json. --check diffs the live topology against the committed baseline and exits 1 on drift; --out overrides the baseline path.

ds script migrate-workitem-timespent-to-timeentry#

ds script migrate-workitem-timespent-to-timeentry

One-off historical migration: converts legacy work-item time-spent data into time-entry records. No flags.

ds script add-default-sidebar-form-group#

ds script add-default-sidebar-form-group

One-off historical migration: backfills a default sidebar form group. No flags.

One-off scripts, not everyday tools

create-slack-workflows, migrate-workitem-timespent-to-timeentry, and add-default-sidebar-form-group are historical, single-use migration scripts kept for the record — not part of the regular development loop.


Powered by DevStride