Watch Neon Developer Days #3 šŸš€
Reference/Neon CLI

Neon CLI commands ā€” roles

Use the Neon CLI to manage Neon directly from the terminal

Before you begin

  • Before running the roles command, ensure that you have installed the Neon CLI.
  • If you have not authenticated with the neonctl 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 roles in Neon, see Manage roles.

The roles command

The roles command allows you to list, create, and delete roles in a Neon project.

Usage

SubcommandDescription
listList roles
createCreate a role
deleteDelete a role

list

This subcommand allows you to list roles.

Usage

Options

In addition to the Neon CLI global options, the list subcommand supports these options:

OptionDescriptionTypeRequired
--project-idProject IDstringOnly if your Neon account has more than one project
--branchBranch IDstring

If a branch ID or name is not provided, the command lists roles for the primary branch of the project.

Examples

List roles with the --output format set to json:

create

This subcommand allows you to create a role.

Usage

Options

In addition to the Neon CLI global options, the create subcommand supports these options:

OptionDescriptionTypeRequired
--project-idProject IDstringOnly if your Neon account has more than one project
--branchBranch IDstring
--nameThe role name. Cannot exceed 63 bytes in length.stringāœ“

If a branch ID or name is not provided, the command creates a role in the primary branch of the project.

Example

delete

This subcommand allows you to delete a role.

Usage

Options

In addition to the Neon CLI global options, the delete subcommand supports these options:

OptionDescriptionTypeRequired
--project-idProject IDstringOnly if your Neon account has more than one project
--branchBranch IDstring

If a branch ID or name is not provided, the command assumes the role resides in the primary branch of the project.

Example

Need help?

Join the Neon community forum to ask questions or see what others are doing with Neon. Neon Pro Plan users can open a support ticket from the console. For more detail, see Getting Support.

Last updated on

Edit this page
Was this page helpful?