> This page location: APIs & SDKs > CLI > Projects and branches > postgres
> 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 `postgres` command (aliases `pg` and `lakebase`) groups the Lakebase Postgres commands: `computes`, `databases`, `roles`, `connection-string`, and `psql`. Use this reference for `neon postgres computes`, which lists, inspects, resizes, suspends, starts, restarts, and deletes the computes in a Neon project. The other subcommands match their top-level forms, such as `neon roles` and `neon psql`.

# Neon CLI command: postgres

Manage computes, databases, and roles, and connect to Lakebase Postgres, from one command group

Last updated: 2026-11-05

The `postgres` command groups the commands that work with Lakebase Postgres in a Neon project: [computes](https://neon.com/docs/cli/postgres#computes), [databases](https://neon.com/docs/cli/databases), [roles](https://neon.com/docs/cli/roles), [connection strings](https://neon.com/docs/cli/connection-string), and [psql](https://neon.com/docs/cli/psql). Its aliases are `pg` and `lakebase`, so `neon pg roles list` and `neon lakebase roles list` work too.

`computes` is only available under `postgres`. The other subcommands run the same command as their top-level spelling, so `neon postgres roles list` and `neon roles list` do the same thing. Both spellings work.

If `--project-id` is omitted, the CLI resolves it from your [context file](https://neon.com/docs/cli/link), auto-selects when your account has only one project, and otherwise asks you to pass `--project-id`.

Subcommands: [computes](https://neon.com/docs/cli/postgres#computes), [connection-string](https://neon.com/docs/cli/postgres#connection-string), [databases](https://neon.com/docs/cli/postgres#databases), [psql](https://neon.com/docs/cli/postgres#psql), [roles](https://neon.com/docs/cli/postgres#roles)

## neon postgres computes

Manages the computes in a Neon project. Aliases: `compute`, `endpoints`, and `endpoint`. For background, see [Manage computes](https://neon.com/docs/manage/computes).

```bash
neon postgres computes <sub-command> [options]
```

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

Subcommands: [delete](https://neon.com/docs/cli/postgres#computes-delete), [get](https://neon.com/docs/cli/postgres#computes-get), [list](https://neon.com/docs/cli/postgres#computes-list), [restart](https://neon.com/docs/cli/postgres#computes-restart), [start](https://neon.com/docs/cli/postgres#computes-start), [suspend](https://neon.com/docs/cli/postgres#computes-suspend), [update](https://neon.com/docs/cli/postgres#computes-update)

`update`, `start`, `suspend`, `restart`, and `delete` wait until the change is applied. Pass `--no-wait` to return as soon as the API accepts the request. To add a compute, use [`neon branches add-compute`](https://neon.com/docs/cli/branches#add-compute).

### neon postgres computes list

Lists computes. With `--branch`, or when your `.neon` context file pins a branch, it lists that branch's computes. Otherwise it lists every compute in the project. `--all-branches` lists every compute in the project even when `.neon` pins a branch.

```bash
neon postgres computes list [options]
```

| Option | Description | Type | Default | Required |
| - | - | - | - | :-: |
| `--all-branches` | List every compute in the project, ignoring --branch and the branch .neon pins | boolean | `false` | No |
| `--branch` | Branch ID or name | string | — | No |
| `--project-id` | Project ID | string | — | No |

```bash
neon postgres computes list --branch main
```

```text filename="Output"
Computes on main
ID                      Branch ID                  Type        Current State  Autoscaling Limit Min Cu  Autoscaling Limit Max Cu
ep-cool-king-123456     br-lively-sunset-123456    read_write  active         0.25                      2
```

### neon postgres computes get

Shows a compute's details, including its host, state, autoscaling limits, and scale-to-zero timeout.

```bash
neon postgres computes get <id> [options]
```

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

```bash
neon postgres computes get ep-cool-king-123456
```

<details>

<summary>Show output</summary>

```text
ID                        ep-cool-king-123456
Branch ID                 br-lively-sunset-123456
Type                      read_write
Current State             active
Host                      ep-cool-king-123456.us-east-2.aws.neon.tech
Region ID                 aws-us-east-2
Autoscaling Limit Min Cu  0.25
Autoscaling Limit Max Cu  2
Suspend Timeout Seconds   600
Disabled                  false
Last Active               2026-11-05T14:46:05Z
Created At                2026-11-05T14:46:01Z
```

</details>

### neon postgres computes update

Changes a compute's size, scale-to-zero timeout, name, or connection access. It sends only the options you pass, and fails if you pass none. When the change is applied, it prints the compute.

```bash
neon postgres computes update <id> [options]
```

| Option | Description | Type | Default | Required |
| - | - | - | - | :-: |
| `--cu` | The number of Compute Units. Could be a fixed size (e.g. "2") or a range delimited by a dash (e.g. "0.5-3"). | string | — | No |
| `--disabled` | Restrict connections to the compute. Disabling schedules a suspend. Use --disabled=false to allow connections again. | boolean | — | No |
| `--name` | Name of the compute | string | — | No |
| `--suspend-timeout` | Scale-to-zero idle timeout, in seconds, before the compute suspends. `0` uses the plan default; `-1` disables scale-to-zero (never suspends). Minimum is plan-dependent (Scale: 60); maximum 604800 (one week). Free cannot change it; Launch can only enable or disable; Scale can set any value. | number | — | No |
| `--wait` | Wait until the change is applied. Use --no-wait to return as soon as the API accepts it | boolean | `true` | No |
| `--project-id` | Project ID | string | — | No |

Set autoscaling to 0.25 to 2 compute units (CU) and suspend after 10 minutes of inactivity:

```bash
neon postgres computes update ep-cool-king-123456 --cu 0.25-2 --suspend-timeout 600
```

`--disabled` restricts connections to the compute and schedules a suspend. Pass `--disabled=false` to allow connections again:

```bash
neon postgres computes update ep-cool-king-123456 --disabled=false
```

### neon postgres computes start

Starts a suspended compute and prints it once it's active.

```bash
neon postgres computes start <id> [options]
```

| Option | Description | Type | Default | Required |
| - | - | - | - | :-: |
| `--wait` | Wait until the change is applied. Use --no-wait to return as soon as the API accepts it | boolean | `true` | No |
| `--project-id` | Project ID | string | — | No |

```bash
neon postgres computes start ep-cool-king-123456
```

### neon postgres computes suspend

Suspends a compute and prints it once it's idle.

```bash
neon postgres computes suspend <id> [options]
```

| Option | Description | Type | Default | Required |
| - | - | - | - | :-: |
| `--wait` | Wait until the change is applied. Use --no-wait to return as soon as the API accepts it | boolean | `true` | No |
| `--project-id` | Project ID | string | — | No |

```bash
neon postgres computes suspend ep-cool-king-123456
```

### neon postgres computes restart

Restarts a compute and prints it once it's back up.

```bash
neon postgres computes restart <id> [options]
```

| Option | Description | Type | Default | Required |
| - | - | - | - | :-: |
| `--wait` | Wait until the change is applied. Use --no-wait to return as soon as the API accepts it | boolean | `true` | No |
| `--project-id` | Project ID | string | — | No |

```bash
neon postgres computes restart ep-cool-king-123456
```

With `--no-wait`, the output says the restart was accepted but not yet applied:

```text filename="Output"
Compute ep-cool-king-123456: restart accepted, not yet applied
```

### neon postgres computes delete

Deletes a compute, such as a [read replica](https://neon.com/docs/introduction/read-replicas) you no longer need, and prints a confirmation.

```bash
neon postgres computes delete <id> [options]
```

| Option | Description | Type | Default | Required |
| - | - | - | - | :-: |
| `--wait` | Wait until the change is applied. Use --no-wait to return as soon as the API accepts it | boolean | `true` | No |
| `--project-id` | Project ID | string | — | No |

```bash
neon postgres computes delete ep-divine-tree-123456
```

```text filename="Output"
Compute ep-divine-tree-123456 deleted
```

## neon postgres databases

Lists, creates, and deletes databases. It's the same command as [`neon databases`](https://neon.com/docs/cli/databases), which documents its subcommands and options.

```bash
neon postgres databases <sub-command> [options]
```

```bash
neon postgres databases list
```

## neon postgres roles

Lists, inspects, creates, and deletes roles, and resets their passwords. It's the same command as [`neon roles`](https://neon.com/docs/cli/roles), which documents its subcommands and options.

```bash
neon postgres roles <sub-command> [options]
```

```bash
neon postgres roles list
```

## neon postgres connection-string

Prints a connection string for a branch. Alias: `cs`. It's the same command as [`neon connection-string`](https://neon.com/docs/cli/connection-string), which documents its options.

```bash
neon postgres connection-string [branch] [options]
```

```bash
neon pg cs main
```

## neon postgres psql

Opens a psql session on a branch. It's the same command as [`neon psql`](https://neon.com/docs/cli/psql), which documents its options.

```bash
neon postgres psql [branch] [options] [-- psql-args]
```

```bash
neon postgres psql main -- -c "SELECT version()"
```

---

## Related docs (Projects and branches)

- [snapshots](https://neon.com/docs/cli/snapshots)
- [diff](https://neon.com/docs/cli/diff)
- [projects](https://neon.com/docs/cli/projects)
- [branches](https://neon.com/docs/cli/branches)
- [databases](https://neon.com/docs/cli/databases)
- [roles](https://neon.com/docs/cli/roles)
- [operations](https://neon.com/docs/cli/operations)

---

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