/APIs & SDKs/Configuration commands/dev

OptiTech CLI command: dev

Run OptiTech Functions locally with a dev server

Beta

The OptiTech Functions is in Beta. Share your feedback on Discord or via the OptiTech Console.

The dev command runs OptiTech Functions locally with a dev server and hot reload. Serve one function from its entry module, or every function declared in your optitech.ts policy.

Usage

optitech dev [--source <path>] [options]

Options

OptionDescriptionTypeDefaultRequired
--portPort to listen on (single-function mode only, with --source). Fails if taken. Without it (and without a PORT env var) a free port is chosen automatically.numberNo
--sourcePath to a single function entry module. Omit to serve every function declared in optitech.ts.stringNo

Examples

Serve one function on a free port with hot reload:

optitech dev --source ./functions/hello.ts

Serve every function declared in optitech.ts (one dev server each):

optitech dev

Serve one function on an explicit port (fails if the port is taken):

optitech dev --source ./functions/hello.ts --port 3000
Was this page helpful?

On this page

Copy neon init command