The projects command lists, creates, updates, deletes, recovers, and retrieves Neon projects from the terminal. For information about projects in Neon, see Projects. Subcommands that show no options table accept only the global options. If --project-id is omitted, the CLI resolves it from your context file, auto-selects when your account has only one project, and prompts otherwise.
neon projects list
Lists projects that belong to your Neon account, as well as any projects that were shared with you.
neon projects list [options]-
List projects in your default organization. If no organization context is set, the CLI prompts you to select one.
neon projects listProjects ββββββββββββββββββββββββββ¬βββββββββββββββββββββ¬ββββββββββββββββ¬βββββββββββββββββββββββ β Id β Name β Region Id β Created At β ββββββββββββββββββββββββββΌβββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββ€ β crimson-voice-12345678 β frontend β aws-us-east-2 β 2024-04-15T11:17:30Z β ββββββββββββββββββββββββββΌβββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββ€ β calm-thunder-12121212 β backend β aws-us-east-2 β 2024-04-10T15:21:01Z β ββββββββββββββββββββββββββΌβββββββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββ€ β nameless-hall-87654321 β billing β aws-us-east-2 β 2024-04-10T14:35:17Z β ββββββββββββββββββββββββββ΄βββββββββββββββββββββ΄ββββββββββββββββ΄βββββββββββββββββββββββ Shared with you βββββββββββββββββββββ¬βββββββββββββββββββββ¬βββββββββββββββββββ¬βββββββββββββββββββββββ β Id β Name β Region Id β Created At β βββββββββββββββββββββΌβββββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββββββ€ β noisy-fire-212121 β API β aws-eu-central-1 β 2023-04-22T18:41:13Z β βββββββββββββββββββββ΄βββββββββββββββββββββ΄βββββββββββββββββββ΄βββββββββββββββββββββββ
List all projects belonging to a specific organization:
neon projects list --org-id org-xxxx-xxxxList projects that can be recovered (deleted within the last 7 days):
neon projects list --recoverable-onlyProjects
βββββββββββββββββββββββ¬ββββββββββββ¬ββββββββββββββββ¬βββββββββββββββββββββββ¬βββββββββββββββββββββββ¬βββββββββββββββββββββββ
β Id β Name β Region Id β Created At β Deleted At β Recoverable Until β
βββββββββββββββββββββββΌββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββββββββββββββΌβββββββββββββββββββββββ€
β crimson-voice-12345 β myproject β aws-us-east-2 β 2024-04-15T11:17:30Z β 2024-04-16T14:22:15Z β 2024-04-23T14:22:15Z β
βββββββββββββββββββββββ΄ββββββββββββ΄ββββββββββββββββ΄βββββββββββββββββββββββ΄βββββββββββββββββββββββ΄βββββββββββββββββββββββneon projects create
Creates a Neon project.
neon projects create [options]The --region-id value defaults to aws-us-east-2 if not specified. --block-public-connections and --block-vpc-connections are part of Private Networking; --hipaa enables HIPAA compliance for the project.
note
Neon projects created using the CLI use the default Postgres version, which is Postgres 18. To create a project with a different Postgres version, pass --pg-version:
neon projects create --name mynewproject --pg-version 17You can also enable logical replication for an existing project with neon projects update <project-id> --enable-logical-replication (add --yes to skip the confirmation prompt), and create protected branches with neon branches create --protected.
Create a project with a user-defined name in a specific region:
neon projects create --name mynewproject --region-id aws-us-west-2βββββββββββββββββββββ¬βββββββββββββββ¬ββββββββββββββββ¬βββββββββββββββββββββββ
β Id β Name β Region Id β Created At β
βββββββββββββββββββββΌβββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββ€
β muddy-wood-859533 β mynewproject β aws-us-west-2 β 2023-07-09T17:04:29Z β
βββββββββββββββββββββ΄βββββββββββββββ΄ββββββββββββββββ΄βββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Connection Uri β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β postgresql://[user]:[password]@[neon_hostname]/[dbname] β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββtip
The Neon CLI provides a neon connection-string command you can use to extract a connection URI programmatically. See the connection-string command.
Create a project with a specific Postgres major version:
neon projects create --name mynewproject --pg-version 17-
Create a project with
--output json, which returns the full project response data and is the recommended format for scripts and agents. The output below was captured on an earlier CLI version; new projects report"pg_version": 18.neon projects create --output jsonShow output
{ "project": { "data_storage_bytes_hour": 0, "data_transfer_bytes": 0, "written_data_bytes": 0, "compute_time_seconds": 0, "active_time_seconds": 0, "cpu_used_sec": 0, "id": "long-wind-77910944", "platform_id": "aws", "region_id": "aws-us-east-2", "name": "long-wind-77910944", "provisioner": "k8s-pod", "default_endpoint_settings": { "autoscaling_limit_min_cu": 1, "autoscaling_limit_max_cu": 1, "suspend_timeout_seconds": 0 }, "pg_version": 17, "proxy_host": "us-east-2.aws.neon.tech", "branch_logical_size_limit": 204800, "branch_logical_size_limit_bytes": 214748364800, "store_passwords": true, "creation_source": "neon", "history_retention_seconds": 604800, "created_at": "2023-08-04T16:16:45Z", "updated_at": "2023-08-04T16:16:45Z", "consumption_period_start": "0001-01-01T00:00:00Z", "consumption_period_end": "0001-01-01T00:00:00Z", "owner_id": "e56ad68e-7f2f-4d74-928c-9ea25d7e9864" }, "connection_uris": [ { "connection_uri": "postgresql://alex:AbC123dEf@ep-cool-darkness-123456.us-east-2.aws.neon.tech/dbname?sslmode=require&channel_binding=require", "connection_parameters": { "database": "dbname", "password": "AbC123dEf", "role": "alex", "host": "ep-cool-darkness-123456.us-east-2.aws.neon.tech", "pooler_host": "ep-cool-darkness-123456-pooler.us-east-2.aws.neon.tech" } } ] }
Create a project and connect to it with psql immediately. Arguments after -- are passed through to psql, so you can run an .sql file or a query on creation:
neon projects create --psql
neon projects create --psql -- -f dump.sql
neon projects create --psql -- -c "SELECT version()"Create a project and set the Neon CLI project context to it:
neon projects create --set-contextneon projects update
Updates a Neon project. The <id> is the project ID, which you can obtain by listing your projects or from the Settings page in the Neon Console.
neon projects update <id> [options]--block-public-connections, --block-vpc-connections, and --hipaa behave as described under projects create.
Update the project name:
neon projects update muddy-wood-859533 --name dev_project_1βββββββββββββββββββββ¬ββββββββββββββββ¬ββββββββββββββββ¬βββββββββββββββββββββββ
β Id β Name β Region Id β Created At β
βββββββββββββββββββββΌββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββ€
β muddy-wood-859533 β dev_project_1 β aws-us-west-2 β 2023-07-09T17:04:29Z β
βββββββββββββββββββββ΄ββββββββββββββββ΄ββββββββββββββββ΄βββββββββββββββββββββββBlock connections from the public internet (see restrict public internet access):
neon projects update orange-credit-12345678 --block-public-connections=trueEnable logical replication for the project. This suspends active endpoints and cannot be disabled, so --yes skips the confirmation prompt:
neon projects update orange-credit-12345678 --enable-logical-replication --yesneon projects delete
Deletes a Neon project. The <id> is the project ID.
neon projects delete <id> [options]neon projects delete muddy-wood-859533βββββββββββββββββββββ¬ββββββββββββββββ¬ββββββββββββββββ¬βββββββββββββββββββββββ
β Id β Name β Region Id β Created At β
βββββββββββββββββββββΌββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββ€
β muddy-wood-859533 β dev_project_1 β aws-us-west-2 β 2023-07-09T17:04:29Z β
βββββββββββββββββββββ΄ββββββββββββββββ΄ββββββββββββββββ΄βββββββββββββββββββββββVerify the deletion with neon projects list.
neon projects recover
Recovers a deleted project within the deletion recovery period. The <id> is the project ID, which you can obtain by listing recoverable projects with neon projects list --recoverable-only.
neon projects recover <id> [options]neon projects recover crimson-voice-12345678ββββββββββββββββββββββββββ¬ββββββββββββ¬ββββββββββββββββ¬βββββββββββββββββββββββ
β Id β Name β Region Id β Created At β
ββββββββββββββββββββββββββΌββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββ€
β crimson-voice-12345678 β myproject β aws-us-east-2 β 2024-04-15T11:17:30Z β
ββββββββββββββββββββββββββ΄ββββββββββββ΄ββββββββββββββββ΄βββββββββββββββββββββββFor details on what's recovered and what requires reconfiguration after recovery, see Recover a deleted project.
neon projects get
Retrieves details about a Neon project. The <id> is the project ID.
neon projects get <id> [options]neon projects get muddy-wood-859533βββββββββββββββββββββ¬ββββββββββββββββ¬ββββββββββββββββ¬βββββββββββββββββββββββ
β Id β Name β Region Id β Created At β
βββββββββββββββββββββΌββββββββββββββββΌββββββββββββββββΌβββββββββββββββββββββββ€
β muddy-wood-859533 β dev_project_1 β aws-us-west-2 β 2023-07-09T17:04:29Z β
βββββββββββββββββββββ΄ββββββββββββββββ΄ββββββββββββββββ΄βββββββββββββββββββββββ







