vibepg new
Synopsis
bash
vibepg new <name> [--persist | --ephemeral] [--port <port>] [--version <tag>] [--db <db>] [--user <user>]Description
Create and start a new Postgres container. vibepg pulls the image if needed, picks a free port (unless one is supplied), generates a strong random password, stores it in your OS keychain, and waits for Postgres to accept connections before returning.
Arguments
| Name | Required | Description |
|---|---|---|
name | yes | Instance name. Lowercase letters, digits, -, _. |
Options
| Flag | Type | Default | Description |
|---|---|---|---|
--persist | bool | (implied) | Use a persistent Docker volume. Mutually exclusive with --ephemeral. This is the default. |
--ephemeral | bool | false | Skip volume creation; data is lost on rm. |
--port | u16 | auto | Host port to bind. If omitted, vibepg picks the first free port. |
--version | string | 16 | Postgres image tag (e.g. 15, 17, 16-alpine). |
--db | string | <name> | Database name. Must be a valid PostgreSQL identifier. |
--user | string | <name> | Database username. Must be a valid PostgreSQL identifier. |
Examples
bash
# Default: persistent, postgres:16, auto-picked port, db/user = "demo"
vibepg new demo
# Throwaway instance for tests
vibepg new scratch --ephemeral
# Pinned port and image, custom db/user
vibepg new myapp --port 5433 --version 15 --db myapp_dev --user appNotes
- Persistence mode is set at creation time and can't be changed. Recreate the instance if you need to switch.
- The container name is
vibepg-pg-<name>; the volume (if any) isvibepg-pg-<name>-data. - The generated password is 32 characters and stored in your OS keychain — see Credentials & Security.