CLI Referenceaerostack init

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

FlagDefaultDescription
-t, --templateinteractiveStarter template (see list below)
--dbinteractiveDatabase type: d1 or neon
--devfalseStart aerostack dev immediately after init

Templates

TemplateDescription
blankEmpty project, no routes
apiREST API with typed routes and D1
api-neonREST API backed by Neon Postgres
multi-funcMulti-service project (API + background worker)
cron-neonScheduled cron job with Neon Postgres
webhook-neonWebhook receiver with Neon Postgres
ws-chatWebSocket chat with Durable Objects
ws-chat-neonWebSocket chat with Neon persistence
ws-voice-agentReal-time voice AI agent
ws-multiplayer-gameMultiplayer game with Durable Objects
ai-streamAI 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 neon

What it does

  1. Creates the project directory with src/, migrations/, shared/, and config files
  2. Generates aerostack.toml with your project configuration
  3. Runs npm install and pins all dependencies to latest versions
  4. If --dev is 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.json

aerostack.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.