Day-to-day DevStride development runs through the ds CLI (./ds from the repo root). This page covers the loop you'll use constantly once your stage is bootstrapped: starting the backend and UI, scaffolding new CQRS commands/queries, running migrations, and managing local data.
.env filled in, and an initial ds run backend + ds migrations run + ds script set-config already done). See Getting Started for first-time setup.ds run backend
This runs pnpm install, cleans up any orphaned CloudFormation stacks left over from a previous sst.config.ts change, and then starts pnpm exec sst dev — SST's live-lambda dev mode for the Hono backend. Leave this running in its own terminal; Ctrl+C stops it cleanly.
ds run backend does not start Docker or any local services. DynamoDB access always points at real AWS in normal (non-test) code — Docker is only spun up by the backend test suite, and only when NODE_ENV=test. You don't need Docker running to develop or use the app locally.ds run ui
Spawns pnpm run dev inside frontend/, injecting VITE_* env vars (API/auth/media URLs, Pusher keys, Stripe public key, etc.) derived from your bound stage. The UI serves on http://localhost:8080.
Run both ds run backend and ds run ui together in separate terminals for the normal dev loop.
DevStride's backend follows a strict CQRS layout per module (see API Development for the full Hono route → CommandBus/QueryBus call flow). Rather than hand-rolling the boilerplate, use ds g to scaffold a new command or query:
ds g command <Name> -m <module>
# alias: ds g c <Name> -m <module>
ds g query <Name> -m <module>
# alias: ds g q <Name> -m <module>
-m / --module is required — it's the target module directory (e.g. item, board, service-desk). Add -f / --force to overwrite an existing scaffold with the same name.
Running ds g command SendInvite -m user creates backend/src/modules/user/commands/send-invite/ with:
send-invite.command.ts — the Command class (props)send-invite.service.ts — the CommandHandlerBase implementation (your business logic goes here)send-invite.init.ts — registers the handler on the CommandBussend-invite.lambda.handler.ts — an HTTP entry point that constructs the command and executes it via CommandBusds g query scaffolds the equivalent layout under queries/<kebab-name>/ for QueryBus-backed reads.
*.lambda.handler.ts extends createZodHttpHandlerDto(...) against the raw APIGatewayProxyEvent/APIGatewayProxyStructuredResultV2 types — an older, now largely-abandoned pattern. The convention actually used across the codebase today (372 handlers, vs. 7 stragglers on the old pattern) is a *.hono.handler.ts file whose class extends HonoHandler<T extends RouteConfig> and defines its route — method, path, request/response schemas — inline inside the handler class itself; there's no separate Hono route file to "wire into." In practice, treat the generator's output as a props/service/init skeleton only, and hand-write the HTTP entry point as a *.hono.handler.ts extending HonoHandler<RouteConfig> following a neighboring handler in the same module as your template, rather than filling in the generated *.lambda.handler.ts as-is.ds migrations run
Runs the Drizzle SQL migrations against your bound stage's database, bringing it to the latest schema. This is what you run after pulling in someone else's schema changes, or after authoring your own with pnpm -C backend generate-sql.
ds migrations run-sql exists as a separate subcommand but today calls the exact same migrateToLatest path as ds migrations run — a leftover from a historical split that hasn't been cleaned up. Prefer ds migrations run day-to-day; run-sql is what the CI deploy pipeline invokes after a deploy, but locally the two are interchangeable.The ds data commands operate on SQL tables in your bound stage's database. import, wipe, and copy are all blocked outright on prod. export is not blocked — there's no prod guard on it in source, so it will run (read-only) against a prod-configured stage if you point one at it.
ds data import <path> [-t/--tables <csv>]
Bulk-restores SQL tables from a previously exported directory (see Export below). Use -t to restore only specific tables (comma-separated table names); omit it to restore everything found at <path>.
ds data export [path] [-t/--tables <csv>]
Dumps SQL tables to disk. If you omit path, it defaults to .ds/data/<stage>/sql. Use -t to export only specific tables.
ds data wipe [-t/--tables <csv>]
Deletes rows from the selected tables (or all tables, if -t is omitted). Blocked on prod.
ds data copy [-o/--organization <id>] [-s/--source <envVarName|connString>]
Copies a single organization's data from a source database into your bound stage's database. -s accepts either the name of an env var holding a connection string (e.g. GOLDEN_DB_CONNECTION_STRING) or a full connection string directly; if omitted in an interactive terminal you'll be prompted to pick from the *_CONNECTION_STRING vars in .env, and non-interactively it falls back to SOURCE_DB_CONNECTION_STRING.
ds data copy is a generic, marker-unaware org copier. If the org id you pass belongs to the golden dataset (e.g. Acme), copying it this way lands dated data at the source's anchor date but leaves the stage's golden_handle.anchorIso marker stale — a later ds golden reanchor will compute its shift from the wrong baseline. The CLI will warn you if you target a golden org id; prefer ds golden import for seeding golden data onto a stage instead.ds script reset-db
public schema (terminating other connections first), deletes every Cognito user in your stage's user pool, re-runs all migrations, re-adds Stripe products, and re-copies a default organization's data from SOURCE_DB_CONNECTION_STRING. It throws immediately if DEVSTRIDE_STAGE is prod. Only run this against your own personal stage when you want a completely clean slate.If you add, remove, or change a Hono route's path, request/response shape, or query parameters, the frontend's typed API client will go stale. Regenerate it before relying on the frontend to see your change — see API Development for the ds script generate-api-client command and what it does.
ds golden commands