aerostack init
Scaffold a new Aerostack project with your choice of template and database.
Usage
aerostack init [project-name] [flags]Running without arguments launches an interactive prompt.
Flags
| Flag | Default | Description |
|---|---|---|
-t, --template | interactive | Starter template (see list below) |
--db | interactive | Database type: d1 or neon |
--dev | false | Start aerostack dev immediately after init |
Templates
| Template | Description |
|---|---|
blank | Empty project, no routes |
api | REST API with typed routes and D1 |
api-neon | REST API backed by Neon Postgres |
multi-func | Multi-service project (API + background worker) |
cron-neon | Scheduled cron job with Neon Postgres |
webhook-neon | Webhook receiver with Neon Postgres |
ws-chat | WebSocket chat with Durable Objects |
ws-chat-neon | WebSocket chat with Neon persistence |
ws-voice-agent | Real-time voice AI agent |
ws-multiplayer-game | Multiplayer game with Durable Objects |
ai-stream | AI streaming API with SSE |
Examples
# Interactive
aerostack init
# Named project with a specific template
aerostack init my-backend --template api --db d1
# Start dev server immediately after setup
aerostack init my-app --template ws-chat --dev
# Neon Postgres backend
aerostack init my-app --template api-neon --db neonWhat it does
- Creates the project directory with
src/,migrations/,shared/, and config files - Generates
aerostack.tomlwith your project configuration - Runs
npm installand pins all dependencies to latest versions - If
--devis set, starts the local dev server automatically
Project structure after init
my-app/
├── aerostack.toml # Project config (Aerostack equivalent of wrangler.toml)
├── src/
│ └── index.ts # Main entry point
├── migrations/ # SQL migration files
├── shared/ # Shared utilities (importable as @shared/*)
├── package.json
└── tsconfig.jsonaerostack.toml is the source of truth for your project. The CLI generates an internal .aerostack/wrangler.toml from it automatically — you should never edit that generated file directly.