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 init             # Initialize a BRAND-NEW project (resets git history, runs setup, sets up env) — destructive
deno task setup            # Prepare a CLONED/FORKED project (configures git settings + .githooks; no history reset)
deno task dev              # Development server with hot reload
deno task start            # Production server
deno task check            # Format and lint
deno task update:core      # Update the framework core (latest features + security patches; overwrites core/)
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
initInitializes a brand-new project from the template. Resets git history (rm -rf .git), runs setup, and sets up env files. Destructive - never run on a repo whose history you want to keep.
setupPrepares a cloned/forked project. Configures local git settings and the .githooks path (no history reset).
devStarts the development server with hot reload.
startStarts the production server.
checkFormats and lints the project.
update:coreUpdates the framework core to the latest version (features, bug fixes, security patches). Overwrites managed files (core/, serve.base.ts).
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.

Use deno task init only for a fresh project from the template - it deletes .git and re-initializes the repo. If you cloned or forked an existing project, run deno task setup instead.

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.


Updating the Framework Core

Keep your project current with the latest features, bug fixes, and security patches by regularly updating the core:

deno task update:core

This pulls the latest framework files from the official Thunder repository (Huruf-Tech/thunder) and overwrites the managed files (primarily core/ and serve.base.ts). This is exactly why you must never edit those files manually.

Recommended workflow:

  1. Commit or stash your own work first, so the update diff is clean.
  2. Run deno task update:core.
  3. Run deno task check (format + lint) and verify the app still boots with deno task dev.
  4. Review the update diff for any new conventions or breaking changes.

Keep installed plugins up to date as well:

deno task update:plugin -n org/plugin-name

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