# Neon CLI command: functions

The `functions` command manages [Neon Functions](/guides/neon-functions-index) on a branch. This is the command reference; for the full deployment workflow, see [Deploy functions](/guides/neon-functions-deploy). To run functions locally, see [`neon dev`](/guides/apis-sdks-cli-dev).

Subcommands: [delete](#neon-functions-delete), [deploy](#neon-functions-deploy), [domains](#neon-functions-domains), [get](#neon-functions-get), [list](#neon-functions-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}$`).

```bash
neon functions deploy <slug> [options]
```

| Option         | Description                                                                                                                              | Type    | Default | Required |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------- | ------- | -------- |
| `--bundle`     | Bundle --src with esbuild. Use --no-bundle to zip a prebuilt directory (root must contain index.mjs or index.js) or a file of that name. | boolean | `true`  | No       |
| `--env`        | Environment variable as KEY=VALUE (repeatable)                                                                                           | string  | —       | No       |
| `--runtime`    | Function runtime Possible values: `nodejs24`                                                                                             | string  | —       | No       |
| `--src`        | Function source: a directory containing index.ts, index.js, or index.mjs (first file match is the entry), or a path to the entry file    | string  | —       | No       |
| `--wait`       | Wait for the deployment to finish building                                                                                               | boolean | `true`  | No       |
| `--branch`     | Branch ID or name                                                                                                                        | string  | —       | No       |
| `--project-id` | Project ID                                                                                                                               | string  | —       | No       |

By default, `deploy` waits until the deployment finishes building (`--wait=true`), which is the predictable path for scripts and CI. Use `--no-wait` to return immediately after triggering the deployment.

By default, `deploy` bundles your `--src` with esbuild before uploading. Pass `--no-bundle` to skip bundling and deploy a prebuilt source instead: the directory root (or the file you point at) must be named or contain `index.mjs` or `index.js`. This is useful when you run your own build step and want to ship the output as-is.

Deploy a function from an entry file:

```bash
neon functions deploy hello --src functions/hello.ts
```

```title="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:

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

## neon functions list

Lists the functions on the branch.

```bash
neon functions list [options]
```

| Option         | Description       | Type   | Default | Required |
| -------------- | ----------------- | ------ | ------- | -------- |
| `--branch`     | Branch ID or name | string | —       | No       |
| `--project-id` | Project ID        | string | —       | No       |

```bash
neon functions list
```

```title="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:

```bash
neon functions list --output json
```

:::accordion{title="Show output"}
```json
[
  {
    "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.

```bash
neon functions get <slug> [options]
```

| Option                       | Description                                                  | Type    | Default | Required |
| ---------------------------- | ------------------------------------------------------------ | ------- | ------- | -------- |
| `--list-env-variables`, `-E` | List the environment variable names of the active deployment | boolean | `false` | No       |
| `--branch`                   | Branch ID or name                                            | string  | —       | No       |
| `--project-id`               | Project ID                                                   | string  | —       | No       |

```bash
neon functions get hello
```

```title="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 │
└───────┴───────┴─────────────────────────────────────────────────────────────────────────────┴─────────────────────────────┘
deployment (current, active)
┌────┬───────────┬──────────┬────────────┬─────────────────────────────┐
│ 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.

```bash
neon functions delete <slug> [options]
```

| Option         | Description       | Type   | Default | Required |
| -------------- | ----------------- | ------ | ------- | -------- |
| `--branch`     | Branch ID or name | string | —       | No       |
| `--project-id` | Project ID        | string | —       | No       |

```bash
neon functions delete hello
```

```title="Output"
INFO: Function hello deleted from branch br-cool-darkness-123456
```

## neon functions domains

Manage custom domains for functions on the branch.

Subcommands: [delete](#neon-functions-domains-delete), [list](#neon-functions-domains-list), [register](#neon-functions-domains-register)

### neon functions domains list

Lists the custom domains registered on the branch.

```bash
neon functions domains list [options]
```

| Option         | Description       | Type   | Default | Required |
| -------------- | ----------------- | ------ | ------- | -------- |
| `--branch`     | Branch ID or name | string | —       | No       |
| `--project-id` | Project ID        | string | —       | No       |

```bash
neon functions domains list
```

The default table shows the domain, target function, and CNAME target. To inspect DNS and routing status, use JSON output:

```bash
neon functions domains list --output json
```

```json title="Output"
[
  {
    "domain": "docs.example.com",
    "entity_type": "function",
    "entity_id": "hello",
    "cname_target": "fn-custom-domains.us-east-2.aws.neon.tech",
    "status": "active",
    "dns_status": "ok",
    "binding_status": "present",
    "status_reason": ""
  }
]
```

An `active` status confirms that DNS, CAA authorization, and routing are ready. Verify the domain with an HTTPS request because certificate issuance isn't included in this status.

### neon functions domains register

Points a domain you already own at a function on the branch. Both `--slug` and the domain are required. The command prints a CNAME target; create a CNAME record for the domain at your DNS provider pointing at that target. See [Custom domains](/guides/neon-functions-custom-domains) for DNS, CAA, and TLS details.

```bash
neon functions domains register <domain> [options]
```

| Option         | Description                               | Type   | Default | Required |
| -------------- | ----------------------------------------- | ------ | ------- | -------- |
| `--slug`       | Function slug this domain should point at | string | —       | Yes      |
| `--branch`     | Branch ID or name                         | string | —       | No       |
| `--project-id` | Project ID                                | string | —       | No       |

```bash
neon functions domains register docs.example.com --slug hello
```

### neon functions domains delete

Deletes a custom domain from the branch.

```bash
neon functions domains delete <domain> [options]
```

| Option         | Description       | Type   | Default | Required |
| -------------- | ----------------- | ------ | ------- | -------- |
| `--branch`     | Branch ID or name | string | —       | No       |
| `--project-id` | Project ID        | string | —       | No       |

```bash
neon functions domains delete docs.example.com
```

Routing changes are eventually consistent, so the custom URL can continue reaching the function briefly after deletion. Deleting a function doesn't delete its custom-domain registration; delete the domain separately.

## Related pages

- [Neon CLI command: triggers](./apis-sdks-cli-triggers.md)
- [Neon CLI command: buckets](./apis-sdks-cli-buckets.md)
- [Neon CLI command: data-api](./apis-sdks-cli-data-api.md)
- [Neon CLI command: neon-auth](./apis-sdks-cli-neon-auth.md)
- [Neon CLI command: credentials](./apis-sdks-cli-credentials.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
