# aerostack dev

> Run a local Cloudflare Workers dev server with full edge parity — D1, KV, Queues, AI, and Durable Objects all run locally with Miniflare.

Start a local development server with full edge fidelity — D1, KV, Queues, AI bindings, and Durable Objects all run locally.

## Usage

```bash
aerostack dev [flags]
```

## Flags

| Flag | Default | Description |
|------|---------|-------------|
| `-p, --port` | `8788` | Port for the local dev server |
| `--remote` | false | Connect to your remote staging/production environment |

## Examples

```bash
# Start dev server on default port 8788
aerostack dev

# Custom port
aerostack dev --port 4000

# Connect to remote environment (real data, real KV/D1)
aerostack dev --remote
```

## How it works

1. Parses your `aerostack.toml`
2. Generates `.aerostack/wrangler.toml` with all bindings resolved
3. Starts a local Miniflare server with D1, KV, Queues, and AI bindings
4. Watches for file changes and hot-reloads

For multi-service projects (multiple entries in `aerostack.toml`), each service starts on its own port.

## Requirements

- Node.js 18+
- `aerostack.toml` in the current directory

Use `--remote` when you need to debug against real data, test webhooks, or reproduce production-only issues. Your code still runs locally but connects to the remote D1 and KV bindings.
