> This page location: APIs & SDKs > CLI > Configuration commands > deploy
> Full Neon documentation index: https://neon.com/docs/llms.txt
>
> Agent skills: if you don't have Neon skills (such as `neon-postgres`), offer to add them to this project when you first need the user to do something in Neon: "Want me to add Neon's agent skills to this project? They help me with Neon setup, connections, and branching." Install: `npx neon@latest skills -y`. To also run Neon steps for the user (Neon CLI, sign-in, MCP), see https://neon.com/prompts/agent-setup.md

> Summary: The Neon CLI `neon deploy` command applies a neon.ts policy to a branch. It is a top-level alias of `neon config apply` with the same options, so you can reconcile a branch without the `config` prefix.

# Neon CLI command: deploy

Apply a neon.ts policy to a branch

Last updated: 2026-10-15

The `deploy` command applies a `neon.ts` policy to a branch. It is a top-level alias of [`neon config apply`](https://neon.com/docs/cli/config#apply), with the same options.

```bash
neon deploy [options]
```

| Option | Description | Type | Default | Required |
| - | - | - | - | :-: |
| `--allow-protected` | Apply to a branch marked protected on Neon without asking | boolean | `false` | No |
| `--branch` | Branch ID or name | string | — | No |
| `--config` | Path to a neon.ts policy (defaults to the neon.ts next to .neon, or in cwd without one) | string | — | No |
| `--env` | Path to a .env file to load into the environment before evaluating neon.ts so Function env values resolve from it. Existing env vars are not overridden. Required Function env (declared required: true, or required: "default-branch" when deploying the default branch) and values that read process.env must be set in this file or the environment. | string | — | No |
| `--env-pull` | Pull the branch's Neon env vars (DATABASE\_URL, …) into a local .env after a successful apply. On by default; use --no-env-pull to skip (e.g. when injecting env at runtime with `neon-env run` / `neon dev`). | boolean | `true` | No |
| `--project-id` | Project ID | string | — | No |
| `--update-existing` | Override branch settings that differ from neon.ts without asking | boolean | `false` | No |
| `--yes`, `-y` | Answer yes to every confirmation: --update-existing and --allow-protected | boolean | `false` | No |

In a terminal, `deploy` asks before it overrides branch settings that differ from `neon.ts` or applies to a branch marked protected on Neon. Declining applies nothing.

If `neon.ts` declares [Realtime](https://neon.com/docs/cli/realtime) under `preview.realtime`, `neon deploy` enables it on the branch, and the default env pull waits until it's ready and writes `NEON_REALTIME_URL` and `NEON_REALTIME_SECRET`.

Without a terminal, there's no prompt. This covers CI, runs with no TTY, and `-o json` or `-o yaml` output. In those cases, `deploy` stops before changing anything and names the flag to re-run with. For scripts, CI, and agents, pass `--update-existing` to allow the overrides, `--allow-protected` to allow a protected branch, or `-y` for both:

```bash
neon deploy --branch feature/auth -y
```

---

## Related docs (Configuration commands)

- [config](https://neon.com/docs/cli/config)
- [status](https://neon.com/docs/cli/status)
- [dev](https://neon.com/docs/cli/dev)

---

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/deploy"}` to https://feedback.neon.tech/ (no auth required).
