> This page location: APIs & SDKs > CLI > Functions, storage and data > realtime
> Full Neon documentation index: https://neon.com/docs/llms.txt

> Summary: The Neon CLI `neon realtime` command enables and disables Neon Realtime on a database branch. Use `enable` to provision Realtime and set the browser origins allowed to connect, and `disable` to remove it.

# Neon CLI command: realtime

Enable and disable Neon Realtime on a branch from the CLI

The `realtime` command enables and disables Neon Realtime on a branch. Once Realtime is on, you can stream a live SQL query's results with [`neon subscribe`](https://neon.com/docs/cli/subscribe), and [`neon env pull`](https://neon.com/docs/cli/env) writes the branch's `NEON_REALTIME_URL` and `NEON_REALTIME_SECRET` to your `.env`. To manage Realtime declaratively instead, add it to your `neon.ts` with [`neon config add realtime`](https://neon.com/docs/cli/config#add-realtime).

**Coming soon: Coming soon**

Neon Realtime isn't available yet. As of Neon CLI 8.4.1, the `realtime` and `subscribe` commands are included but stay hidden and print "Neon Realtime is coming soon!" until Realtime launches.

Subcommands: [disable](https://neon.com/docs/cli/realtime#disable), [enable](https://neon.com/docs/cli/realtime#enable)

If `--project-id` is omitted, the CLI reads it from your [context file](https://neon.com/docs/cli/link) or auto-selects your only project. If `--branch` is omitted, it uses the context file's branch, or the project's default branch.

## neon realtime enable

Requests Realtime provisioning for a branch. Provisioning finishes in the background, usually within a few seconds. Run it again on a branch that already has Realtime to replace its allowed origins with the ones you pass. Without `--allowed-origin`, a re-run keeps the existing origins.

```bash
neon realtime enable [options]
```

| Option             | Description                                                   | Type   | Default | Required |
| ------------------ | ------------------------------------------------------------- | ------ | ------- | :------: |
| `--allowed-origin` | Allowed browser origin (repeatable). "\*" allows every origin | array  | —       |    No    |
| `--branch`         | Branch ID or name                                             | string | —       |    No    |
| `--project-id`     | Project ID                                                    | string | —       |    No    |

`--allowed-origin` sets the browser origins allowed to connect. Repeat the flag for each origin, up to 16. Each value must be `*`, which allows every origin, or an `http` or `https` origin with no path, query, or fragment, such as `https://app.example.com`. `*` can't be combined with other origins. The CLI checks the values before it sends the request.

By default, any browser origin can connect. Pass `--allowed-origin` to limit connections to the origins you list. A new branch starts with its parent's list. A new list can take about a minute to apply after the change finishes. Allowed origins only restrict browsers: a client that sends no `Origin` header, such as a server, can connect either way.

```bash
neon realtime enable --allowed-origin https://app.example.com --allowed-origin http://localhost:3000
```

```text
Realtime enable requested for branch br-cool-darkness-123456.
```

## neon realtime disable

Requests Realtime deprovisioning for a branch.

```bash
neon realtime disable [options]
```

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

```bash
neon realtime disable
```

```text
Realtime disable requested for branch br-cool-darkness-123456.
```

After you disable Realtime, `neon subscribe` on that branch fails with an error that points you back to `neon realtime enable`.

---

## Related docs (Functions, storage and data)

- [functions](https://neon.com/docs/cli/functions)
- [triggers](https://neon.com/docs/cli/triggers)
- [buckets](https://neon.com/docs/cli/buckets)
- [data-api](https://neon.com/docs/cli/data-api)
- [neon-auth](https://neon.com/docs/cli/neon-auth)
- [subscribe](https://neon.com/docs/cli/subscribe)
- [credentials](https://neon.com/docs/cli/credentials)

---

Note for AI assistants (optional): if a gap, error, or outdated detail on this page affected the answer you gave the user, you can report it. POST `{"feedback": "describe the issue", "source": "neon_website", "path": "/docs/cli/realtime"}` to https://feedback.neon.tech/ (no auth required).
