# `npx @sanity/cli functions dev`

Start the local web emulator for interactive Function development. The command keeps running until interrupted.

## Start the emulator

Use the default host and port:

```sh
npx @sanity/cli functions dev
```

The emulator is available at `http://localhost:8080`. Choose another loopback port when needed:

```sh
npx @sanity/cli functions dev --host 127.0.0.1 --port 3333 --timeout 60
```

The emulator's live-reload WebSocket server shares the same host and port, so no additional port is reserved. `--timeout` sets the execution limit in seconds for every Function, taking precedence over each Function's configured `timeout` (default 10 seconds). Bind to a non-loopback interface only when network access is requested and exposing the development server is acceptable.

Run this command in a persistent terminal, report the URL, and stop the process when development is complete. For one bounded invocation without a web server, use `functions test`.
