PGCLI(1)

πŸ’… PGCLI β€” like, the manual, but make it make sense

okay bestie, sit down, hydrate, because we're talking about pgcli β€” the Postgres client that actually gets you. ✨ This is the manual page for pgcli version 4.7.1, and I'm gonna walk you through every single flag like we're texting at 2am. No skips. No "you'll figure it out." We're doing this properly. 🫢


✨ NAME ✨

pgcli β€” the manual page for pgcli 4.7.1. That's it, that's the name, iconic behavior honestly. πŸ’…


🌸 SYNOPSIS 🌸

pgcli [OPTIONS] [DBNAME] [USERNAME]

so you got your OPTIONS, you got an optional DBNAME, you got an optional USERNAME β€” and you're off to the races, babe. 🌈


πŸ‘‘ OPTIONS πŸ‘‘

Every single one, in order, no cap. Read them all, they're literally all useful.

  • -h, --host TEXT β€” the host address of the postgres database. where is she? tell me where she lives. 🏠
  • -p, --port INTEGER β€” the port number at which the postgres instance is listening. it's giving "I'm on this port and I'm not moving." πŸŽ€
  • -U, --username TEXT β€” the username to connect to the postgres database.
  • -u, --user TEXT β€” the username to connect to the postgres database. yes bestie, it's the same thing as -U, two spellings, one vibe. πŸ’œ
  • --timeout INTEGER β€” how many seconds to wait for a connection before giving up. and listen: 0 waits forever, which is a choice. This one overrides both the connection string and $PGCONNECT_TIMEOUT. she said "I don't care what they told you, I'm in charge." 😀
  • -W, --password β€” force the password prompt. you will be asked. no escape. πŸ”
  • -w, --no-password β€” never prompt for a password. the opposite energy. also no escape, just in the other direction. πŸ’€
  • --single-connection β€” do not use a separate connection for completions. one connection, one queen, no side pieces. πŸ‘‘
  • -v, --version β€” the version of pgcli. show me your ID. πŸͺͺ
  • -d, --dbname TEXT β€” the database name to connect to. which one are we pulling up. πŸ“
  • --pgclirc FILE β€” the location of the pgclirc file. your config, your rules. ✨
  • -D, --dsn TEXT β€” use a DSN configured in the [alias_dsn] section of the pgclirc file. cute little nickname for your connection. πŸ¦‹
  • --list-dsn β€” shows the list of DSNs configured in the [alias_dsn] section of the pgclirc file. a little roster. πŸ“‹
  • --row-limit INTEGER β€” set the threshold for the row limit prompt. use 0 to disable the prompt entirely. (yes, zero = off, noted, don't forget.) πŸ™ˆ
  • --application-name TEXT β€” the application name for the connection.
  • --less-chatty β€” skip the intro on startup and the goodbye on exit. for when you're in your mysterious, no-small-talk era. 🎧
  • -t, --tuples-only β€” print rows only: no column headers, no status footer, and no timing, just like psql. strictly business. πŸ”₯
  • --prompt TEXT β€” the prompt format. Default: "\u@\h:\d> ".
  • --prompt-dsn TEXT β€” the prompt format for connections using DSN aliases. Default: "\u@\h:\d> ". (same default, different situation, she's flexible.) 🌟
  • -l, --list β€” list the available databases, then exit. window shopping, basically. πŸ›οΈ
  • --ping β€” check database connectivity, then exit. u up? πŸ“Ά
  • --auto-vertical-output β€” automatically switch to vertical output mode if the result is wider than the terminal width. she adapts. πŸ’…
  • --warn TEXT β€” warn before running a destructive query. a little "bestie are you SURE" moment. ⚠️
  • --ssh-tunnel TEXT β€” open an SSH tunnel to the given address and connect to the database from it. sneaky, secure, slay. πŸš‡
  • --log-file TEXT β€” write all queries & output into a file, in addition to the normal output destination. receipts, always. 🧾
  • --init-command TEXT β€” an SQL statement to execute after connecting. a lil opening act. 🎬
  • -c, --command TEXT β€” run a command (SQL or internal) and exit. multiple -c options are allowed, so stack 'em up, queen. πŸ₯ž
  • -y, --yes β€” force destructive commands without the confirmation prompt. bold. fearless. possibly chaotic. you've been warned. 😭
  • -f, --file FILE β€” execute commands from a file, then exit. multiple -f options are allowed, yes you can pile those on too. πŸ“‚
  • --help β€” show this message and exit. hi, hello, welcome, here's everything, bye. πŸ‘‹

πŸ’– reminder: every flag above does exactly what it says and nothing more. I'm not out here inventing behavior for you, bestie. that's the whole point.

πŸŽ€ a lil sign-off πŸŽ€

this page is from pgcli 4.7.1, dated September 2026. mwah. go connect to something. πŸ’œβœ¨πŸ¦‹

πŸ“¦ where this page comes from