Workflows
End-to-end flows driven by the Bun CLI. Workflows coordinate the canonical frontend, backend, and testing packages so a workspace can move from source files to a running or publishable server-first HTML app.
Core Commands
webstir initwebstir buildwebstir watchwebstir testwebstir publishwebstir smokewebstir operationswebstir inspectwebstir agentwebstir doctorwebstir add-pagewebstir add-routewebstir add-jobwebstir add-test
Default Path
When in doubt, use this path:
webstir init full <directory>- Add document pages with
webstir add-page - Keep forms, redirects, auth, and request-time HTML in
src/backend/module.ts - Use
webstir add-routefor backend endpoints that need manifest metadata or inspection visibility - Define request-time views in
src/backend/module.tswhen a page needs server-loaded data at request time - Enable
client-navonly after the baseline HTML flow is already correct - Use
webstir inspectto confirm scaffold health plus the frontend/backend contract surfaces before shipping - Use
webstir repairto restore scaffold drift without changing the app shape - Use
webstir publishplus the Bun Docker deployment contract for shippedapiandfullworkspaces
Flow Shape
- Resolve the workspace and detect which surfaces exist.
- Choose the active build plan from
webstir.mode:spaandssg=> frontendapi=> backendfull=> frontend + backendfullis the main lane for server-first apps with forms, redirects, auth, and optional enhancement.
- Run the canonical package logic from
packages/tooling/**. - Emit
build/**for development and test work. - Emit
dist/frontend/**for publish-ready frontend assets when a frontend surface exists. - Start or supervise long-running services only when the workflow requires them.
Workflow Contracts
init
- Creates a starter workspace for
spa,ssg,api, orfull - Writes source roots under
src/**plustypes/**
build
- Runs the frontend and/or backend package pipelines for the workspace mode
- Writes
build/frontend/**andbuild/backend/**
watch
- Starts Bun-native frontend watch for
spa,ssg, andfull - Starts the backend build watcher and runtime for
apiandfull - Proxies
/api/*in full-stack watch mode
test
- Rebuilds the required surfaces
- Discovers tests under
src/**/tests - Executes compiled suites through the active testing provider
publish
- Produces optimized frontend assets under
dist/frontend/** - Produces backend bundles under
build/backend/** - Validates the same runtime shape that the proof apps use in publish mode
- For published
apiandfull, pair the workspace with the supported Bun Docker deployment helper underorchestrators/bun/resources/deployment/docker
Runtime Scope
Only webstir test supports --runtime <frontend|backend|all>.
build, watch, and publish follow the workspace mode instead of a runtime flag. If you need a backend-only loop, use an api workspace. If you need frontend-only output, use spa or ssg.
Practical Reference
If you want to see the workflows exercised against real applications, use:
examples/demos/fullas the canonicalwebstir testand server-first workflow referenceexamples/demos/auth-crudas a proof app for richer auth and CRUD flows, not the canonical scaffold shapeexamples/demos/dashboardas a deliberate enhancement proof, not a default architecture target
Together those demos cover the current HTML-first runtime across redirect-after-post, fragment updates, sessions, auth gates, and publish-mode validation.
Recipe Benchmarks
Use the pinned recipe apps and benchmark runner when you want to prove the current agent-facing lane instead of just describing it:
examples/demos/fullis the scaffold-aligned golden-path recipeexamples/demos/auth-crudis the richer auth and CRUD proof recipeexamples/demos/dashboardis the fragment-refresh proof recipebun run benchmark:agent-tasksruns the current benchmark plan across those recipes
That benchmark intentionally stays close to the real framework operations: doctor, backend-inspect, test, and publish.