Scaffolding
create-mantle-app bootstraps a new Mantle project with Lambda handlers, TypeScript config, Drizzle schema, and OpenTofu infrastructure.
Final result
bash
npx create-mantle-app my-api --template api --database aurora-dsql
cd my-api
npx mantle buildStep 1: Run the scaffolder
bash
npx create-mantle-appThe interactive wizard asks five questions:
- Project name — lowercase alphanumeric with hyphens (e.g.
my-api) - Template —
minimal,api, orfull - Database provider —
aurora-dsql,aurora-serverless-v2,neon, ornone - Auth provider —
better-authornone - Features — multi-select:
observability,resilience
Non-interactive mode
Pass all options as flags to skip prompts:
bash
npx create-mantle-app my-api \
--template api \
--database aurora-dsql \
--auth better-auth \
--features observability,resilienceUse --yes to accept all defaults with only a project name:
bash
npx create-mantle-app my-api --yes
# template=api, database=aurora-dsql, auth=better-auth, features=observabilityAll flags
| Flag | Short | Description |
|---|---|---|
--template <t> | -t | minimal, api, or full |
--database <db> | -d | aurora-dsql, aurora-serverless-v2, neon, none |
--auth <a> | -a | better-auth or none |
--features <list> | Comma-separated: observability, resilience | |
--package-manager <pm> | pnpm, npm, yarn, or bun (auto-detected) | |
--directory <dir> | Output directory (defaults to project name) | |
--skip-install | Skip package installation | |
--skip-git | Skip git init | |
--yes | -y | Use all defaults, no prompts |
Templates
minimal
A single Lambda handler — no database, no auth.
my-api/
src/lambdas/api/
ping.get.ts # GET /ping → 200 { status: 'ok' }
mantle.config.ts
package.json
tsconfig.jsonapi
REST API with database access and authentication.
my-api/
src/
lambdas/
api/
items/
index.get.ts # GET /items
index.post.ts # POST /items
standalone/
MigrateDSQL/
index.ts
entities/
schema.ts
migrations/
infra/
main.tf
mantle.config.ts
drizzle.config.tsfull
Everything in api plus EventBridge handlers and scheduled tasks.
Database providers
| Provider | Auth method |
|---|---|
aurora-dsql | IAM token (auto-rotated) |
aurora-serverless-v2 | RDS Data API |
neon | Connection string |
none | — |
The selected provider configures getDrizzleClient(), drizzle.config.ts, and the OpenTofu database module.
Features
| Feature | What it adds |
|---|---|
observability | @mantleframework/observability — Lambda Powertools logger, metrics, tracing |
resilience | @mantleframework/resilience — idempotency helpers, retry utilities |
Step 2: Start building
bash
cd my-api
# Generate migrations from your schema
npx mantle db generate
# Build Lambda bundles
npx mantle build
# Deploy
npx mantle deploy --stage devNext steps
- Getting started — first handler walkthrough
- Infrastructure —
mantle generate infrafor adding Lambdas - Migration —
mantle db generateandmantle db migrate