Skip to content

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 ​

NameRequiredDescription
nameyesInstance name. Lowercase letters, digits, -, _.

Options ​

FlagTypeDefaultDescription
--persistbool(implied)Use a persistent Docker volume. Mutually exclusive with --ephemeral. This is the default.
--ephemeralboolfalseSkip volume creation; data is lost on rm.
--portu16autoHost port to bind. If omitted, vibepg picks the first free port.
--versionstring16Postgres image tag (e.g. 15, 17, 16-alpine).
--dbstring<name>Database name. Must be a valid PostgreSQL identifier.
--userstring<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 app

Notes ​

  • 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) is vibepg-pg-<name>-data.
  • The generated password is 32 characters and stored in your OS keychain — see Credentials & Security.

See also ​

Released under the MIT License.