Autoscaling Report: Production databases on Neon use 2.4x less compute and 50% less cost than if they were running on a provisioned platform.
/CLI/functions

Neon CLI command: functions

Deploy, list, inspect, and delete Neon Functions

Private Preview

This feature is in private preview: it's not ready for production use, and it may be briefly unavailable as we deploy updates. To get access, sign up here.

The functions command manages Neon Functions on a branch. This is the command reference; for the full deployment workflow, see Deploy functions. To run functions locally, see neon dev.

Subcommands: delete, deploy, get, list

neon functions deploy

Deploys a function from a local directory or entry file. The <slug> is the permanent function identifier: 1 to 20 lowercase letters and digits (^[a-z0-9]{1,20}$).

neon functions deploy <slug> [options]
OptionDescriptionTypeDefaultRequired
--envEnvironment variable as KEY=VALUE (repeatable)stringNo
--runtimeFunction runtime Possible values: nodejs24stringNo
--srcFunction source: a directory containing index.ts, index.mjs, or index.js, or a path to the entry filestringNo
--waitWait for the deployment to finish buildingbooleantrueNo
--branchBranch ID or namestringNo
--project-idProject IDstringNo

Use --wait to block until the deployment finishes building, which is the predictable path for scripts and CI.

Deploy a function from an entry file:

neon functions deploy hello --src functions/hello.ts
Output
INFO: Function deployment triggered for function hello.
┌────┬───────────┬──────────┬────────────┬─────────────────────────────┐
│ Id │ Status    │ Runtime  │ Memory Mib │ Created At                  │
├────┼───────────┼──────────┼────────────┼─────────────────────────────┤
│ 1  │ completed │ nodejs24 │ 2048       │ 2026-06-12T00:14:58.044690Z │
└────┴───────────┴──────────┴────────────┴─────────────────────────────┘
INFO: Function deployment hello/1 completed.

Deploy with environment variables and wait for the build:

neon functions deploy hello --src functions/hello.ts --env LOG_LEVEL=info --wait

neon functions list

Lists the functions on the branch.

neon functions list [options]
OptionDescriptionTypeDefaultRequired
--branchBranch ID or namestringNo
--project-idProject IDstringNo
neon functions list
Output
┌───────┬───────┬─────────────────────────────────────────────────────────────────────────────┬─────────────────────────────┐
│ Slug  │ Name  │ Invocation Url                                                              │ Created At                  │
├───────┼───────┼─────────────────────────────────────────────────────────────────────────────┼─────────────────────────────┤
│ hello │ hello │ https://br-cool-darkness-123456-hello.compute.c-1.us-east-2.aws.neon.tech/ │ 2026-06-12T00:14:57.942988Z │
└───────┴───────┴─────────────────────────────────────────────────────────────────────────────┴─────────────────────────────┘

List with full deployment details for scripts and agents:

neon functions list --output json
Show output
[
  {
    "id": "hello",
    "slug": "hello",
    "name": "hello",
    "invocation_url": "https://br-cool-darkness-123456-hello.compute.c-1.us-east-2.aws.neon.tech/",
    "current_deployment": {
      "id": 1,
      "status": "completed",
      "memory_mib": 2048,
      "runtime": "nodejs24",
      "created_at": "2026-06-12T00:14:58.044690Z"
    },
    "active_deployment": {
      "id": 1,
      "status": "completed",
      "memory_mib": 2048,
      "runtime": "nodejs24",
      "created_at": "2026-06-12T00:14:58.044690Z"
    },
    "created_at": "2026-06-12T00:14:57.942988Z"
  }
]

neon functions get

Shows a function's details.

neon functions get <slug> [options]
OptionDescriptionTypeDefaultRequired
--list-env-variables, -EList the environment variable names of the active deploymentbooleanfalseNo
--branchBranch ID or namestringNo
--project-idProject IDstringNo
neon functions get hello
Output
function
┌───────┬───────┬─────────────────────────────────────────────────────────────────────────────┬─────────────────────────────┐
│ Slug  │ Name  │ Invocation Url                                                              │ Created At                  │
├───────┼───────┼─────────────────────────────────────────────────────────────────────────────┼─────────────────────────────┤
│ hello │ hello │ https://br-cool-darkness-123456-hello.compute.c-1.us-east-2.aws.neon.tech/ │ 2026-06-12T00:14:57.942988Z │
└───────┴───────┴─────────────────────────────────────────────────────────────────────────────┴─────────────────────────────┘
active deployment
┌────┬───────────┬──────────┬────────────┬─────────────────────────────┐
│ Id │ Status    │ Runtime  │ Memory Mib │ Created At                  │
├────┼───────────┼──────────┼────────────┼─────────────────────────────┤
│ 1  │ completed │ nodejs24 │ 2048       │ 2026-06-12T00:14:58.044690Z │
└────┴───────────┴──────────┴────────────┴─────────────────────────────┘

neon functions delete

Deletes a function on the branch.

neon functions delete <slug> [options]
OptionDescriptionTypeDefaultRequired
--branchBranch ID or namestringNo
--project-idProject IDstringNo
neon functions delete hello
Output
INFO: Function hello deleted from branch br-cool-darkness-123456
Was this page helpful?
Edit on GitHub

On this page

Copy neon init command