# Quick Start — Functions

> Create and deploy an Aerostack Function in under 2 minutes using the CLI.

Go from zero to a deployed Function in under 2 minutes.

## Prerequisites

- Node.js 18+
- An Aerostack account ([sign up free](https://app.aerostack.dev))

1. **Install the CLI**

   ```bash
   npm install -g @aerostack/cli
   ```

2. **Log in**

   ```bash
   aerostack login
   ```

3. **Create a new function**

   

   

   Pick a template to start with a working app:

   ```bash
   # REST API with Hono + D1 database
   aerostack init my-app --template api

   # REST API with Neon PostgreSQL
   aerostack init my-app --template api-neon

   # WebSocket group chat
   aerostack init my-app --template ws-chat

   # Conversational AI agent
   aerostack init my-app --template ws-voice-agent

   # SSE AI streaming
   aerostack init my-app --template ai-stream

   # Multiplayer game state sync
   aerostack init my-app --template ws-multiplayer-game
   ```

   See all 8 templates: [Templates](/functions/templates)

   

   

   Start with a clean project:

   ```bash
   aerostack init my-app
   cd my-app
   ```

   This creates:

   ```
   my-app/
   ├── src/
   │   └── index.ts          ← Your function code
   ├── aerostack.toml        ← Configuration
   ├── package.json
   └── tsconfig.json
   ```

   

   

4. **Run locally**

   ```bash
   cd my-app
   npm install
   aerostack dev
   ```

   Your function is running at `http://localhost:8787`. All platform bindings (DB, Cache, Queue, AI, Vector Search, Storage) work locally out of the box.

5. **Deploy**

   ```bash
   aerostack deploy function
   ```

   That's it. Your function is live on Cloudflare's edge in 300+ data centers. The CLI outputs your live URL.

   ```
   Deploying function: my-app
     Building... done (1.2s)
     Uploading... done
     Bindings configured:
       DB        → aerostack-core (Database)
       CACHE     → project-cache (Cache)
       QUEUE     → project-queue (Queue)
       AI        → Workers AI
       VECTORIZE → project-vectors (Vector Search)
       STORAGE   → project-storage (Storage)

     Live at: https://my-app.your-project.aerostack.dev
   ```

---

## What just happened?

1. **`aerostack init`** scaffolded a TypeScript project with `aerostack.toml` configuration
2. **`aerostack dev`** started a local dev server with all 6 platform bindings simulated locally
3. **`aerostack deploy`** uploaded your code to Cloudflare's edge, wired up real bindings, and gave you a URL

No Docker. No Kubernetes. No infrastructure config. One command to develop, one command to deploy.

---

## Next steps

- [**Browse templates**](/functions/templates) — 8 starter templates you can deploy right now
- [**Build a Bookmarks API**](/functions/write-first-function) — step-by-step tutorial with DB and Cache
- [**Platform bindings**](/functions/platform-access) — learn what `env.DB`, `env.CACHE`, `env.AI`, etc. can do
- [**Deploy guide**](/functions/deploy) — CLI, dashboard, secrets, and cron configuration
- [**Publish to Hub**](/functions/publish-to-hub) — share your Function with the community marketplace
