# Neon CLI command: databases

List, create, and delete databases in a Neon project

The `databases` command lists, creates, and deletes databases in a Neon project from the terminal. For information about databases in Neon, see [Manage databases](/guides/manage-operate-manage-databases). If `--project-id` is omitted, the CLI resolves it from your [context file](/guides/apis-sdks-cli-link), auto-selects when your account has only one project, and otherwise asks you to pass `--project-id`.

Subcommands: [create](/guides/apis-sdks-cli-databases#neon-databases-create), [delete](/guides/apis-sdks-cli-databases#neon-databases-delete), [list](/guides/apis-sdks-cli-databases#neon-databases-list)

## neon databases list

Lists databases. If you don't specify a branch ID or name with `--branch`, the command targets the project's default branch. This applies to all `databases` subcommands.

```bash
neon databases list [options]
```

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

```bash
neon databases list --branch br-autumn-dust-190886
```

```text filename="Output"
┌────────┬────────────┬──────────────────────┐
│ Name   │ Owner Name │ Created At           │
├────────┼────────────┼──────────────────────┤
│ neondb │ daniel     │ 2023-06-19T18:27:19Z │
└────────┴────────────┴──────────────────────┘
```

## neon databases create

Creates a database. If you don't specify `--owner-name`, the current user becomes the database owner.

```bash
neon databases create [options]
```

| Option         | Description       | Type   | Default | Required |
| -------------- | ----------------- | ------ | ------- | :------: |
| `--name`       | Database name     | string | —       |    Yes   |
| `--owner-name` | Owner name        | string | —       |    No    |
| `--branch`     | Branch ID or name | string | —       |    No    |
| `--project-id` | Project ID        | string | —       |    No    |

```bash
neon databases create --name mynewdb --owner-name john
```

```text filename="Output"
┌─────────┬────────────┬──────────────────────┐
│ Name    │ Owner Name │ Created At           │
├─────────┼────────────┼──────────────────────┤
│ mynewdb │ john       │ 2023-06-19T23:45:45Z │
└─────────┴────────────┴──────────────────────┘
```

## neon databases delete

Deletes a database. The `<database>` is the database name.

```bash
neon databases delete <database> [options]
```

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

```bash
neon databases delete mydb
```

```text filename="Output"
┌─────────┬────────────┬──────────────────────┐
│ Name    │ Owner Name │ Created At           │
├─────────┼────────────┼──────────────────────┤
│ mydb    │ daniel     │ 2023-06-19T23:45:45Z │
└─────────┴────────────┴──────────────────────┘
```

## Related pages

- [Neon CLI command: snapshots](./apis-sdks-cli-snapshots.md)
- [Neon CLI command: diff](./apis-sdks-cli-diff.md)
- [Neon CLI command: projects](./apis-sdks-cli-projects.md)
- [Neon CLI command: branches](./apis-sdks-cli-branches.md)
- [Neon CLI command: roles](./apis-sdks-cli-roles.md)
- [Neon CLI command: operations](./apis-sdks-cli-operations.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
