# pier psql

> Open a psql shell to a Postgres instance

URL: https://pier.run/docs/cli/reference/psql

```bash
pier psql [<postgres>] [<args>] [flags]
```

Open a psql shell to a Postgres instance.

## Arguments

| Argument     | Required | Description                        |
| ------------ | -------- | ---------------------------------- |
| `<postgres>` | no       | Postgres name, slug, or ID         |
| `<args>`     | no       | Extra args passed to psql after -- |

## Flags

| Flag   | Value    | Default | Description                                       |
| ------ | -------- | ------- | ------------------------------------------------- |
| `--db` | `STRING` |         | Override the Postgres database inside the cluster |

[Global flags](/docs/cli/reference#global-flags) apply to every command.
