If you have not authenticated with the neon auth command, running a Neon CLI command automatically launches the Neon CLI browser authentication process. Alternatively, you can specify a Neon API key using the --api-key option when running a command. See Connect.
For information about projects in Neon, see Projects.
The projects command
The projects command allows you to list, create, update, delete, and retrieve information about Neon projects.
The project name. The project ID is used if a name is not specified.
string
--region-id
The region ID. Possible values: aws-us-west-2, aws-ap-southeast-1, aws-ap-southeast-2, aws-eu-central-1, aws-us-east-1, aws-us-east-2, azure-eastus2. Defaults to aws-us-east-2 if not specified.
string
--org-id
The organization ID where you want this project to be created. If unspecified, the project is created in your personal account.
string
--psql
Connect to your new project's database via psql immediately on project creation.
boolean
--database
The database name. If not specified, the default database name will be used.
string
--role
The role name. If not specified, the default role name will be used.
string
--set-context
Set the current context to the new project.
boolean
--cu
The compute size for the default branch's primary compute. Could be a fixed size (e.g., "2") or a range delimited by a dash (e.g., "0.5-3").
string
Examples
Create a project with a user-defined name in a specific region:
tip
The Neon CLI provides a neon connection-string command you can use to extract a connection uri programmatically. See Neon CLI commands β connection-string.
Create a project with the --output format of the command set to json. This output format returns all of the project response data, whereas the default table output format (shown in the preceding example) is limited in the information it can display.
Example output
Create a project and connect to it with psql.
Create a project, connect to it with psql, and run an .sql file.
Create a project, connect to it with psql, and run a query.
Create a project and set the Neon CLI project context.
update
This subcommand allows you to update a Neon project.
Usage
The id is the project ID, which you can obtain by listing your projects or from the Project settings page in the Neon Console.
Options
In addition to the Neon CLI global options, the update subcommand supports this option:
Join our Discord Server to ask questions or see what others are doing with Neon. Users on paid plans can open a support ticket from the console. For more details, see Getting Support.