CLI Tasks & Snippets

The deno tasks and VS Code snippets that power your Thunder workflow.

Thunder exposes a set of deno task commands for development, production, and code generation, plus a collection of VS Code snippets that scaffold common files instantly.

Available Tasks

deno task dev              # Development server with hot reload
deno task start            # Production server
deno task check            # Format and lint
deno task generate:openapi # Generate an OpenAPI spec
deno task generate:sdk     # Generate a TypeScript SDK
deno task generate:app     # Generate a dashboard app in the public folder
TaskDescription
devStarts the development server with hot reload.
startStarts the production server.
checkFormats and lints the project.
generate:openapiGenerates an OpenAPI specification from your registered route shapes.
generate:sdkGenerates a fully typed TypeScript SDK for your API.
generate:appGenerates a dashboard app into the public folder, based on the thunder-ui boilerplate.

Both generate:openapi and generate:sdk rely on the shape() validators you register in your route handlers. The more accurately you define $params, $query, $body, and $return, the richer your generated spec and SDK will be. See Routes.

Plugin Tasks

deno task add:plugin    -n org/plugin-name [--setup[=env,...]]  # Install (optionally run setup)
deno task setup:plugin  -n org/plugin-name [--envs=env,...]     # Run a plugin's setup lifecycle (indexes/seeds/migrations)
deno task update:plugin -n org/plugin-name                      # Update an installed plugin
deno task remove:plugin -n org/plugin-name [--clean[=env,...]]  # Remove (optionally run cleanup lifecycle)
TaskDescription
add:pluginInstalls a plugin from GitHub. Add --setup (optionally =development,production) to also run its setup lifecycle.
setup:pluginRuns an installed plugin's setup lifecycle (indexes, seeding, migrations). Use --envs to target environments non-interactively.
update:pluginUpdates an installed plugin to its latest version.
remove:pluginRemoves a plugin. Add --clean (optionally =development,production) to also run its cleanup lifecycle.

Installing a plugin does not run its setup automatically - run --setup or setup:plugin explicitly. See the Plugins page for the full lifecycle model.


VS Code Snippets

Thunder provides VS Code snippets for faster development. Type the prefix and press Tab:

SnippetScaffolds
routerA new router file
reqA route handler with validation
modelA database schema / model
crudA complete CRUD operation

There is also a req-static snippet for scaffolding a static file handler. See Serving Static Files.


On this page