The roles command lists, creates, and deletes roles in a Neon project from the terminal. For information about roles in Neon, see Manage roles. 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.
neonctl roles list
Lists roles. If you don't specify a branch ID or name with --branch, the command targets the project's default branch. This applies to all roles subcommands.
neonctl roles list [options]List roles with the default table output format:
neonctl roles listOutput
┌────────┬──────────────────────┐
│ Name │ Created At │
├────────┼──────────────────────┤
│ daniel │ 2023-06-19T18:27:19Z │
└────────┴──────────────────────┘List roles with the --output format set to json:
neonctl roles list --output jsonShow output
[
{
"branch_id": "br-odd-frog-703504",
"name": "daniel",
"protected": false,
"created_at": "2023-06-28T10:17:28Z",
"updated_at": "2023-06-28T10:17:28Z"
}
]neonctl roles create
Creates a role. The role name cannot exceed 63 bytes.
neonctl roles create [options]neonctl roles create --name sallyOutput
┌───────┬──────────────────────┐
│ Name │ Created At │
├───────┼──────────────────────┤
│ sally │ 2023-06-20T00:43:17Z │
└───────┴──────────────────────┘neonctl roles delete
Deletes a role. The <role> is the role name.
neonctl roles delete <role> [options]neonctl roles delete sallyOutput
┌───────┬──────────────────────┐
│ Name │ Created At │
├───────┼──────────────────────┤
│ sally │ 2023-06-20T00:43:17Z │
└───────┴──────────────────────┘







