aerostack init
Scaffold a new Aerostack project with your choice of template and database.
aerostack init [project-name] [flags]Running without arguments launches an interactive prompt.
| 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
Section titled “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
Section titled “Examples”# Interactiveaerostack init
# Named project with a specific templateaerostack init my-backend --template api --db d1
# Start dev server immediately after setupaerostack init my-app --template ws-chat --dev
# Neon Postgres backendaerostack init my-app --template api-neon --db neonWhat it does
Section titled “What 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
Section titled “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.json