afpsql CLI reference

A PostgreSQL interface for AI agents: reliable, structured, explicit, and read-only by default.

afpsql is compiled from a closed cli-spec-v1 registry: one source for argv parsing, typed invocation values, which parameter combinations are legal, output contracts, and help. An invocation runs only when it matches exactly one registered combination.

Global arguments

AFDATA registers these itself, so the syntax in Commands leaves them out.

ArgumentWhereWhat it does
--helpevery commandEvery legal shape of that command, complete, plus its subcommands. JSON by default; --output plain for a terminal.
--versionafpsql onlyName, version, and build identity as one protocol result.
--docsafpsql onlyThis document, rendered from the registry.
--output <FORMAT>per output contractRender as json, yaml, plain (default json).
--output-to <DESTINATION>per output contractRoute results and diagnostics to split, stdout, stderr (default split).
--stdout-file <PATH>, --stderr-file <PATH>per output contractAppend that stream to a file instead.

Success output is protocol events, on those terms, unless a command’s own Output line says otherwise.

A shape is one legal set of arguments that may appear together, under a stable id. Where a command has more than one, each id is a heading below. --help returns them all at once, so discovering a command costs one call; there is no recursive mode across commands, and this document is that view.

Commands

afpsql

Run one SQL action per process, or open a long-lived pipe session.

query-inline — Run inline –sql and return one bounded result

afpsql --sql <SQL> [--param <N=VALUE>...] [--statement-timeout-ms <MS>] [--lock-timeout-ms <MS>] [--inline-max-rows <N>] [--inline-max-bytes <N>] [--permission <read|write|ssh-read|ssh-write|container-read|container-write>] [--dry-run] [--explain <plan|analyze>] [--mode cli] [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...]

query-file — Run SQL read from –sql-file and return one bounded result

afpsql --sql-file <PATH> [--param <N=VALUE>...] [--statement-timeout-ms <MS>] [--lock-timeout-ms <MS>] [--inline-max-rows <N>] [--inline-max-bytes <N>] [--permission <read|write|ssh-read|ssh-write|container-read|container-write>] [--dry-run] [--explain <plan|analyze>] [--mode cli] [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...]

query-inline-stream — Stream inline –sql as ordered row batches on one stream

afpsql --sql <SQL> [--param <N=VALUE>...] --stream-rows [--batch-rows <N>] [--batch-bytes <N>] [--statement-timeout-ms <MS>] [--lock-timeout-ms <MS>] [--permission <read|write|ssh-read|ssh-write|container-read|container-write>] [--explain <plan|analyze>] [--mode cli] [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...]

query-file-stream — Stream SQL read from –sql-file as ordered row batches on one stream

afpsql --sql-file <PATH> [--param <N=VALUE>...] --stream-rows [--batch-rows <N>] [--batch-bytes <N>] [--statement-timeout-ms <MS>] [--lock-timeout-ms <MS>] [--permission <read|write|ssh-read|ssh-write|container-read|container-write>] [--explain <plan|analyze>] [--mode cli] [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...]

pipe — Open a long-lived JSONL session that reads requests from stdin

afpsql --mode pipe [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...]

psql-translation — Translate a psql command line: every remaining argument is psql’s own (-c, -f, -l, -h, -p, -U, -d, -v, DBNAME USERNAME), parsed by the compatibility layer rather than by this registry

afpsql --mode psql

Output differs by combination:

Arguments across every shape above:

ArgumentMeaning
--sqlInline SQL to execute
--sql-fileFile to read SQL from; - reads it from stdin
--paramPositional bind parameter in N=value form; repeat for more parameters. Bare null/true/false bind as JSON null/booleans; prefix with text: to bind any value as a literal string
--stream-rowsStream the result as ordered result_rows batches instead of one payload
--batch-rowsMaximum rows per streamed batch
--batch-bytesSoft byte target per streamed batch
--statement-timeout-msPer-query statement timeout in milliseconds
--lock-timeout-msPer-query lock timeout in milliseconds
--inline-max-rowsMaximum inline rows before returning a truncated result
--inline-max-bytesMaximum inline payload bytes before returning a truncated result
--permissionQuery permission policy; defaults to read, ssh-read with –ssh, or container-read with a –container--* flag
--dry-runPrepare the query and report its shape without running it
--explainReturn the plan instead of the rows: plan wraps the SQL in EXPLAIN (FORMAT JSON); analyze runs it and buffers metrics
--modeRuntime mode: one SQL action, a long-lived JSONL session, or psql argument translation
--dsnPostgreSQL DSN URI (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--conninfolibpq conninfo string (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--hostPostgreSQL host
--portPostgreSQL port
--userPostgreSQL user name
--dbnamePostgreSQL database name
--passwordPostgreSQL password (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--sshOpen an SSH transport to USER@HOST before connecting to PostgreSQL
--ssh-viaSSH hop to reach before the final –ssh destination; repeat for more hops
--ssh-optionAdditional OpenSSH -o option; repeat for more options
--ssh-remote-socketExplicit remote PostgreSQL Unix socket path for SSH forwarding
--ssh-sudo-userRemote OS user for the sudo -n Unix-socket bridge; needs an explicit socket
--container-docker-nameRun a docker exec stdio bridge in this container before connecting
--container-docker-userContainer OS user to run the docker exec bridge as
--container-docker-contextDocker context to run the exec against
--container-docker-runtimeDocker runtime command; defaults to docker
--container-apple-nameRun an Apple container exec stdio bridge in this container before connecting
--container-apple-userContainer OS user to run the Apple container exec bridge as
--container-apple-runtimeApple container runtime command; defaults to container
--container-podman-nameRun a podman exec stdio bridge in this container before connecting
--container-podman-userContainer OS user to run the podman exec bridge as
--container-podman-runtimePodman runtime command; defaults to podman
--container-nerdctl-nameRun a nerdctl exec stdio bridge in this container before connecting
--container-nerdctl-userContainer OS user to run the nerdctl exec bridge as
--container-nerdctl-runtimeNerdctl runtime command; defaults to nerdctl
--container-compose-serviceRun a compose exec stdio bridge in this service before connecting
--container-compose-userContainer OS user to run the compose exec bridge as
--container-compose-fileCompose file passed before compose exec; repeat for more files
--container-compose-projectCompose project name passed before compose exec
--container-compose-runtimeCompose runtime command; defaults to docker, use docker-compose for v1
--container-kubectl-podRun a kubectl exec stdio bridge in this pod before connecting
--container-kubectl-containerContainer within a multi-container pod to exec into
--container-kubectl-namespaceKubernetes namespace to run the exec in
--container-kubectl-contextKubernetes context to run the exec against
--container-kubectl-runtimeKubectl runtime command; defaults to kubectl
--logDiagnostic log filter: startup, connect, query, transport, mode, an exact event such as query.error, or all. Comma-separated or repeated

afpsql inspect connections

List server backends with state, wait event, age, and the max_connections limit.

afpsql inspect connections [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...] [--all]
ArgumentMeaning
--dsnPostgreSQL DSN URI (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--conninfolibpq conninfo string (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--hostPostgreSQL host
--portPostgreSQL port
--userPostgreSQL user name
--dbnamePostgreSQL database name
--passwordPostgreSQL password (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--sshOpen an SSH transport to USER@HOST before connecting to PostgreSQL
--ssh-viaSSH hop to reach before the final –ssh destination; repeat for more hops
--ssh-optionAdditional OpenSSH -o option; repeat for more options
--ssh-remote-socketExplicit remote PostgreSQL Unix socket path for SSH forwarding
--ssh-sudo-userRemote OS user for the sudo -n Unix-socket bridge; needs an explicit socket
--container-docker-nameRun a docker exec stdio bridge in this container before connecting
--container-docker-userContainer OS user to run the docker exec bridge as
--container-docker-contextDocker context to run the exec against
--container-docker-runtimeDocker runtime command; defaults to docker
--container-apple-nameRun an Apple container exec stdio bridge in this container before connecting
--container-apple-userContainer OS user to run the Apple container exec bridge as
--container-apple-runtimeApple container runtime command; defaults to container
--container-podman-nameRun a podman exec stdio bridge in this container before connecting
--container-podman-userContainer OS user to run the podman exec bridge as
--container-podman-runtimePodman runtime command; defaults to podman
--container-nerdctl-nameRun a nerdctl exec stdio bridge in this container before connecting
--container-nerdctl-userContainer OS user to run the nerdctl exec bridge as
--container-nerdctl-runtimeNerdctl runtime command; defaults to nerdctl
--container-compose-serviceRun a compose exec stdio bridge in this service before connecting
--container-compose-userContainer OS user to run the compose exec bridge as
--container-compose-fileCompose file passed before compose exec; repeat for more files
--container-compose-projectCompose project name passed before compose exec
--container-compose-runtimeCompose runtime command; defaults to docker, use docker-compose for v1
--container-kubectl-podRun a kubectl exec stdio bridge in this pod before connecting
--container-kubectl-containerContainer within a multi-container pod to exec into
--container-kubectl-namespaceKubernetes namespace to run the exec in
--container-kubectl-contextKubernetes context to run the exec against
--container-kubectl-runtimeKubectl runtime command; defaults to kubectl
--logDiagnostic log filter: startup, connect, query, transport, mode, an exact event such as query.error, or all. Comma-separated or repeated
--allInclude PostgreSQL’s own background backends, not just client connections

afpsql inspect database

Summarize the connected database: schema/table/view/sequence counts and size.

afpsql inspect database [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...]
ArgumentMeaning
--dsnPostgreSQL DSN URI (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--conninfolibpq conninfo string (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--hostPostgreSQL host
--portPostgreSQL port
--userPostgreSQL user name
--dbnamePostgreSQL database name
--passwordPostgreSQL password (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--sshOpen an SSH transport to USER@HOST before connecting to PostgreSQL
--ssh-viaSSH hop to reach before the final –ssh destination; repeat for more hops
--ssh-optionAdditional OpenSSH -o option; repeat for more options
--ssh-remote-socketExplicit remote PostgreSQL Unix socket path for SSH forwarding
--ssh-sudo-userRemote OS user for the sudo -n Unix-socket bridge; needs an explicit socket
--container-docker-nameRun a docker exec stdio bridge in this container before connecting
--container-docker-userContainer OS user to run the docker exec bridge as
--container-docker-contextDocker context to run the exec against
--container-docker-runtimeDocker runtime command; defaults to docker
--container-apple-nameRun an Apple container exec stdio bridge in this container before connecting
--container-apple-userContainer OS user to run the Apple container exec bridge as
--container-apple-runtimeApple container runtime command; defaults to container
--container-podman-nameRun a podman exec stdio bridge in this container before connecting
--container-podman-userContainer OS user to run the podman exec bridge as
--container-podman-runtimePodman runtime command; defaults to podman
--container-nerdctl-nameRun a nerdctl exec stdio bridge in this container before connecting
--container-nerdctl-userContainer OS user to run the nerdctl exec bridge as
--container-nerdctl-runtimeNerdctl runtime command; defaults to nerdctl
--container-compose-serviceRun a compose exec stdio bridge in this service before connecting
--container-compose-userContainer OS user to run the compose exec bridge as
--container-compose-fileCompose file passed before compose exec; repeat for more files
--container-compose-projectCompose project name passed before compose exec
--container-compose-runtimeCompose runtime command; defaults to docker, use docker-compose for v1
--container-kubectl-podRun a kubectl exec stdio bridge in this pod before connecting
--container-kubectl-containerContainer within a multi-container pod to exec into
--container-kubectl-namespaceKubernetes namespace to run the exec in
--container-kubectl-contextKubernetes context to run the exec against
--container-kubectl-runtimeKubectl runtime command; defaults to kubectl
--logDiagnostic log filter: startup, connect, query, transport, mode, an exact event such as query.error, or all. Comma-separated or repeated

afpsql inspect databases

List databases on the connected server with size, encoding, and connection facts.

afpsql inspect databases [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...] [--all]
ArgumentMeaning
--dsnPostgreSQL DSN URI (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--conninfolibpq conninfo string (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--hostPostgreSQL host
--portPostgreSQL port
--userPostgreSQL user name
--dbnamePostgreSQL database name
--passwordPostgreSQL password (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--sshOpen an SSH transport to USER@HOST before connecting to PostgreSQL
--ssh-viaSSH hop to reach before the final –ssh destination; repeat for more hops
--ssh-optionAdditional OpenSSH -o option; repeat for more options
--ssh-remote-socketExplicit remote PostgreSQL Unix socket path for SSH forwarding
--ssh-sudo-userRemote OS user for the sudo -n Unix-socket bridge; needs an explicit socket
--container-docker-nameRun a docker exec stdio bridge in this container before connecting
--container-docker-userContainer OS user to run the docker exec bridge as
--container-docker-contextDocker context to run the exec against
--container-docker-runtimeDocker runtime command; defaults to docker
--container-apple-nameRun an Apple container exec stdio bridge in this container before connecting
--container-apple-userContainer OS user to run the Apple container exec bridge as
--container-apple-runtimeApple container runtime command; defaults to container
--container-podman-nameRun a podman exec stdio bridge in this container before connecting
--container-podman-userContainer OS user to run the podman exec bridge as
--container-podman-runtimePodman runtime command; defaults to podman
--container-nerdctl-nameRun a nerdctl exec stdio bridge in this container before connecting
--container-nerdctl-userContainer OS user to run the nerdctl exec bridge as
--container-nerdctl-runtimeNerdctl runtime command; defaults to nerdctl
--container-compose-serviceRun a compose exec stdio bridge in this service before connecting
--container-compose-userContainer OS user to run the compose exec bridge as
--container-compose-fileCompose file passed before compose exec; repeat for more files
--container-compose-projectCompose project name passed before compose exec
--container-compose-runtimeCompose runtime command; defaults to docker, use docker-compose for v1
--container-kubectl-podRun a kubectl exec stdio bridge in this pod before connecting
--container-kubectl-containerContainer within a multi-container pod to exec into
--container-kubectl-namespaceKubernetes namespace to run the exec in
--container-kubectl-contextKubernetes context to run the exec against
--container-kubectl-runtimeKubectl runtime command; defaults to kubectl
--logDiagnostic log filter: startup, connect, query, transport, mode, an exact event such as query.error, or all. Comma-separated or repeated
--allInclude template databases (template0/template1)

afpsql inspect indexes

List indexes with definitions, size, validity, and optional usage stats.

afpsql inspect indexes [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...] [--schema <SCHEMA>] [--table <TABLE>] [--stats]
ArgumentMeaning
--dsnPostgreSQL DSN URI (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--conninfolibpq conninfo string (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--hostPostgreSQL host
--portPostgreSQL port
--userPostgreSQL user name
--dbnamePostgreSQL database name
--passwordPostgreSQL password (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--sshOpen an SSH transport to USER@HOST before connecting to PostgreSQL
--ssh-viaSSH hop to reach before the final –ssh destination; repeat for more hops
--ssh-optionAdditional OpenSSH -o option; repeat for more options
--ssh-remote-socketExplicit remote PostgreSQL Unix socket path for SSH forwarding
--ssh-sudo-userRemote OS user for the sudo -n Unix-socket bridge; needs an explicit socket
--container-docker-nameRun a docker exec stdio bridge in this container before connecting
--container-docker-userContainer OS user to run the docker exec bridge as
--container-docker-contextDocker context to run the exec against
--container-docker-runtimeDocker runtime command; defaults to docker
--container-apple-nameRun an Apple container exec stdio bridge in this container before connecting
--container-apple-userContainer OS user to run the Apple container exec bridge as
--container-apple-runtimeApple container runtime command; defaults to container
--container-podman-nameRun a podman exec stdio bridge in this container before connecting
--container-podman-userContainer OS user to run the podman exec bridge as
--container-podman-runtimePodman runtime command; defaults to podman
--container-nerdctl-nameRun a nerdctl exec stdio bridge in this container before connecting
--container-nerdctl-userContainer OS user to run the nerdctl exec bridge as
--container-nerdctl-runtimeNerdctl runtime command; defaults to nerdctl
--container-compose-serviceRun a compose exec stdio bridge in this service before connecting
--container-compose-userContainer OS user to run the compose exec bridge as
--container-compose-fileCompose file passed before compose exec; repeat for more files
--container-compose-projectCompose project name passed before compose exec
--container-compose-runtimeCompose runtime command; defaults to docker, use docker-compose for v1
--container-kubectl-podRun a kubectl exec stdio bridge in this pod before connecting
--container-kubectl-containerContainer within a multi-container pod to exec into
--container-kubectl-namespaceKubernetes namespace to run the exec in
--container-kubectl-contextKubernetes context to run the exec against
--container-kubectl-runtimeKubectl runtime command; defaults to kubectl
--logDiagnostic log filter: startup, connect, query, transport, mode, an exact event such as query.error, or all. Comma-separated or repeated
--schemaSchema to filter on
--tableTable to filter on; schema.table overrides –schema
--statsInclude PostgreSQL’s built-in pg_stat_user_indexes usage counters

afpsql inspect schema

Export full schema metadata for one schema.

afpsql inspect schema [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...] [--schema <SCHEMA>] [--like <PATTERN>]
ArgumentMeaning
--dsnPostgreSQL DSN URI (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--conninfolibpq conninfo string (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--hostPostgreSQL host
--portPostgreSQL port
--userPostgreSQL user name
--dbnamePostgreSQL database name
--passwordPostgreSQL password (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--sshOpen an SSH transport to USER@HOST before connecting to PostgreSQL
--ssh-viaSSH hop to reach before the final –ssh destination; repeat for more hops
--ssh-optionAdditional OpenSSH -o option; repeat for more options
--ssh-remote-socketExplicit remote PostgreSQL Unix socket path for SSH forwarding
--ssh-sudo-userRemote OS user for the sudo -n Unix-socket bridge; needs an explicit socket
--container-docker-nameRun a docker exec stdio bridge in this container before connecting
--container-docker-userContainer OS user to run the docker exec bridge as
--container-docker-contextDocker context to run the exec against
--container-docker-runtimeDocker runtime command; defaults to docker
--container-apple-nameRun an Apple container exec stdio bridge in this container before connecting
--container-apple-userContainer OS user to run the Apple container exec bridge as
--container-apple-runtimeApple container runtime command; defaults to container
--container-podman-nameRun a podman exec stdio bridge in this container before connecting
--container-podman-userContainer OS user to run the podman exec bridge as
--container-podman-runtimePodman runtime command; defaults to podman
--container-nerdctl-nameRun a nerdctl exec stdio bridge in this container before connecting
--container-nerdctl-userContainer OS user to run the nerdctl exec bridge as
--container-nerdctl-runtimeNerdctl runtime command; defaults to nerdctl
--container-compose-serviceRun a compose exec stdio bridge in this service before connecting
--container-compose-userContainer OS user to run the compose exec bridge as
--container-compose-fileCompose file passed before compose exec; repeat for more files
--container-compose-projectCompose project name passed before compose exec
--container-compose-runtimeCompose runtime command; defaults to docker, use docker-compose for v1
--container-kubectl-podRun a kubectl exec stdio bridge in this pod before connecting
--container-kubectl-containerContainer within a multi-container pod to exec into
--container-kubectl-namespaceKubernetes namespace to run the exec in
--container-kubectl-contextKubernetes context to run the exec against
--container-kubectl-runtimeKubectl runtime command; defaults to kubectl
--logDiagnostic log filter: startup, connect, query, transport, mode, an exact event such as query.error, or all. Comma-separated or repeated
--schemaSchema to inspect
--likeOptional LIKE pattern matched against relation names (% is the wildcard)

afpsql inspect schemas

List user-visible schemas with owner, object counts, and size.

afpsql inspect schemas [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...]
ArgumentMeaning
--dsnPostgreSQL DSN URI (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--conninfolibpq conninfo string (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--hostPostgreSQL host
--portPostgreSQL port
--userPostgreSQL user name
--dbnamePostgreSQL database name
--passwordPostgreSQL password (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--sshOpen an SSH transport to USER@HOST before connecting to PostgreSQL
--ssh-viaSSH hop to reach before the final –ssh destination; repeat for more hops
--ssh-optionAdditional OpenSSH -o option; repeat for more options
--ssh-remote-socketExplicit remote PostgreSQL Unix socket path for SSH forwarding
--ssh-sudo-userRemote OS user for the sudo -n Unix-socket bridge; needs an explicit socket
--container-docker-nameRun a docker exec stdio bridge in this container before connecting
--container-docker-userContainer OS user to run the docker exec bridge as
--container-docker-contextDocker context to run the exec against
--container-docker-runtimeDocker runtime command; defaults to docker
--container-apple-nameRun an Apple container exec stdio bridge in this container before connecting
--container-apple-userContainer OS user to run the Apple container exec bridge as
--container-apple-runtimeApple container runtime command; defaults to container
--container-podman-nameRun a podman exec stdio bridge in this container before connecting
--container-podman-userContainer OS user to run the podman exec bridge as
--container-podman-runtimePodman runtime command; defaults to podman
--container-nerdctl-nameRun a nerdctl exec stdio bridge in this container before connecting
--container-nerdctl-userContainer OS user to run the nerdctl exec bridge as
--container-nerdctl-runtimeNerdctl runtime command; defaults to nerdctl
--container-compose-serviceRun a compose exec stdio bridge in this service before connecting
--container-compose-userContainer OS user to run the compose exec bridge as
--container-compose-fileCompose file passed before compose exec; repeat for more files
--container-compose-projectCompose project name passed before compose exec
--container-compose-runtimeCompose runtime command; defaults to docker, use docker-compose for v1
--container-kubectl-podRun a kubectl exec stdio bridge in this pod before connecting
--container-kubectl-containerContainer within a multi-container pod to exec into
--container-kubectl-namespaceKubernetes namespace to run the exec in
--container-kubectl-contextKubernetes context to run the exec against
--container-kubectl-runtimeKubectl runtime command; defaults to kubectl
--logDiagnostic log filter: startup, connect, query, transport, mode, an exact event such as query.error, or all. Comma-separated or repeated

afpsql inspect snapshot

Export a stable full-schema snapshot for machine consumption.

afpsql inspect snapshot [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...] [--schema <SCHEMA>] [--like <PATTERN>]
ArgumentMeaning
--dsnPostgreSQL DSN URI (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--conninfolibpq conninfo string (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--hostPostgreSQL host
--portPostgreSQL port
--userPostgreSQL user name
--dbnamePostgreSQL database name
--passwordPostgreSQL password (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--sshOpen an SSH transport to USER@HOST before connecting to PostgreSQL
--ssh-viaSSH hop to reach before the final –ssh destination; repeat for more hops
--ssh-optionAdditional OpenSSH -o option; repeat for more options
--ssh-remote-socketExplicit remote PostgreSQL Unix socket path for SSH forwarding
--ssh-sudo-userRemote OS user for the sudo -n Unix-socket bridge; needs an explicit socket
--container-docker-nameRun a docker exec stdio bridge in this container before connecting
--container-docker-userContainer OS user to run the docker exec bridge as
--container-docker-contextDocker context to run the exec against
--container-docker-runtimeDocker runtime command; defaults to docker
--container-apple-nameRun an Apple container exec stdio bridge in this container before connecting
--container-apple-userContainer OS user to run the Apple container exec bridge as
--container-apple-runtimeApple container runtime command; defaults to container
--container-podman-nameRun a podman exec stdio bridge in this container before connecting
--container-podman-userContainer OS user to run the podman exec bridge as
--container-podman-runtimePodman runtime command; defaults to podman
--container-nerdctl-nameRun a nerdctl exec stdio bridge in this container before connecting
--container-nerdctl-userContainer OS user to run the nerdctl exec bridge as
--container-nerdctl-runtimeNerdctl runtime command; defaults to nerdctl
--container-compose-serviceRun a compose exec stdio bridge in this service before connecting
--container-compose-userContainer OS user to run the compose exec bridge as
--container-compose-fileCompose file passed before compose exec; repeat for more files
--container-compose-projectCompose project name passed before compose exec
--container-compose-runtimeCompose runtime command; defaults to docker, use docker-compose for v1
--container-kubectl-podRun a kubectl exec stdio bridge in this pod before connecting
--container-kubectl-containerContainer within a multi-container pod to exec into
--container-kubectl-namespaceKubernetes namespace to run the exec in
--container-kubectl-contextKubernetes context to run the exec against
--container-kubectl-runtimeKubectl runtime command; defaults to kubectl
--logDiagnostic log filter: startup, connect, query, transport, mode, an exact event such as query.error, or all. Comma-separated or repeated
--schemaSchema to inspect
--likeOptional LIKE pattern matched against relation names (% is the wildcard)

afpsql inspect table

Describe a table’s columns: types, nullability, defaults, primary key, comments.

afpsql inspect table <NAME> [--full] [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...]
ArgumentMeaning
NAMETable name; schema.table overrides the default public schema
--fullAlso return constraints, indexes, triggers, and sequence/default metadata
--dsnPostgreSQL DSN URI (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--conninfolibpq conninfo string (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--hostPostgreSQL host
--portPostgreSQL port
--userPostgreSQL user name
--dbnamePostgreSQL database name
--passwordPostgreSQL password (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--sshOpen an SSH transport to USER@HOST before connecting to PostgreSQL
--ssh-viaSSH hop to reach before the final –ssh destination; repeat for more hops
--ssh-optionAdditional OpenSSH -o option; repeat for more options
--ssh-remote-socketExplicit remote PostgreSQL Unix socket path for SSH forwarding
--ssh-sudo-userRemote OS user for the sudo -n Unix-socket bridge; needs an explicit socket
--container-docker-nameRun a docker exec stdio bridge in this container before connecting
--container-docker-userContainer OS user to run the docker exec bridge as
--container-docker-contextDocker context to run the exec against
--container-docker-runtimeDocker runtime command; defaults to docker
--container-apple-nameRun an Apple container exec stdio bridge in this container before connecting
--container-apple-userContainer OS user to run the Apple container exec bridge as
--container-apple-runtimeApple container runtime command; defaults to container
--container-podman-nameRun a podman exec stdio bridge in this container before connecting
--container-podman-userContainer OS user to run the podman exec bridge as
--container-podman-runtimePodman runtime command; defaults to podman
--container-nerdctl-nameRun a nerdctl exec stdio bridge in this container before connecting
--container-nerdctl-userContainer OS user to run the nerdctl exec bridge as
--container-nerdctl-runtimeNerdctl runtime command; defaults to nerdctl
--container-compose-serviceRun a compose exec stdio bridge in this service before connecting
--container-compose-userContainer OS user to run the compose exec bridge as
--container-compose-fileCompose file passed before compose exec; repeat for more files
--container-compose-projectCompose project name passed before compose exec
--container-compose-runtimeCompose runtime command; defaults to docker, use docker-compose for v1
--container-kubectl-podRun a kubectl exec stdio bridge in this pod before connecting
--container-kubectl-containerContainer within a multi-container pod to exec into
--container-kubectl-namespaceKubernetes namespace to run the exec in
--container-kubectl-contextKubernetes context to run the exec against
--container-kubectl-runtimeKubectl runtime command; defaults to kubectl
--logDiagnostic log filter: startup, connect, query, transport, mode, an exact event such as query.error, or all. Comma-separated or repeated

afpsql inspect tables

List tables in a schema with owner, estimated rows, and size.

afpsql inspect tables [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...] [--schema <SCHEMA>] [--like <PATTERN>]
ArgumentMeaning
--dsnPostgreSQL DSN URI (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--conninfolibpq conninfo string (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--hostPostgreSQL host
--portPostgreSQL port
--userPostgreSQL user name
--dbnamePostgreSQL database name
--passwordPostgreSQL password (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--sshOpen an SSH transport to USER@HOST before connecting to PostgreSQL
--ssh-viaSSH hop to reach before the final –ssh destination; repeat for more hops
--ssh-optionAdditional OpenSSH -o option; repeat for more options
--ssh-remote-socketExplicit remote PostgreSQL Unix socket path for SSH forwarding
--ssh-sudo-userRemote OS user for the sudo -n Unix-socket bridge; needs an explicit socket
--container-docker-nameRun a docker exec stdio bridge in this container before connecting
--container-docker-userContainer OS user to run the docker exec bridge as
--container-docker-contextDocker context to run the exec against
--container-docker-runtimeDocker runtime command; defaults to docker
--container-apple-nameRun an Apple container exec stdio bridge in this container before connecting
--container-apple-userContainer OS user to run the Apple container exec bridge as
--container-apple-runtimeApple container runtime command; defaults to container
--container-podman-nameRun a podman exec stdio bridge in this container before connecting
--container-podman-userContainer OS user to run the podman exec bridge as
--container-podman-runtimePodman runtime command; defaults to podman
--container-nerdctl-nameRun a nerdctl exec stdio bridge in this container before connecting
--container-nerdctl-userContainer OS user to run the nerdctl exec bridge as
--container-nerdctl-runtimeNerdctl runtime command; defaults to nerdctl
--container-compose-serviceRun a compose exec stdio bridge in this service before connecting
--container-compose-userContainer OS user to run the compose exec bridge as
--container-compose-fileCompose file passed before compose exec; repeat for more files
--container-compose-projectCompose project name passed before compose exec
--container-compose-runtimeCompose runtime command; defaults to docker, use docker-compose for v1
--container-kubectl-podRun a kubectl exec stdio bridge in this pod before connecting
--container-kubectl-containerContainer within a multi-container pod to exec into
--container-kubectl-namespaceKubernetes namespace to run the exec in
--container-kubectl-contextKubernetes context to run the exec against
--container-kubectl-runtimeKubectl runtime command; defaults to kubectl
--logDiagnostic log filter: startup, connect, query, transport, mode, an exact event such as query.error, or all. Comma-separated or repeated
--schemaSchema to inspect
--likeOptional LIKE pattern matched against the table name (% is the wildcard)

afpsql inspect views

List views (regular and materialized) in a schema with owner.

afpsql inspect views [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...] [--schema <SCHEMA>] [--like <PATTERN>]
ArgumentMeaning
--dsnPostgreSQL DSN URI (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--conninfolibpq conninfo string (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--hostPostgreSQL host
--portPostgreSQL port
--userPostgreSQL user name
--dbnamePostgreSQL database name
--passwordPostgreSQL password (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--sshOpen an SSH transport to USER@HOST before connecting to PostgreSQL
--ssh-viaSSH hop to reach before the final –ssh destination; repeat for more hops
--ssh-optionAdditional OpenSSH -o option; repeat for more options
--ssh-remote-socketExplicit remote PostgreSQL Unix socket path for SSH forwarding
--ssh-sudo-userRemote OS user for the sudo -n Unix-socket bridge; needs an explicit socket
--container-docker-nameRun a docker exec stdio bridge in this container before connecting
--container-docker-userContainer OS user to run the docker exec bridge as
--container-docker-contextDocker context to run the exec against
--container-docker-runtimeDocker runtime command; defaults to docker
--container-apple-nameRun an Apple container exec stdio bridge in this container before connecting
--container-apple-userContainer OS user to run the Apple container exec bridge as
--container-apple-runtimeApple container runtime command; defaults to container
--container-podman-nameRun a podman exec stdio bridge in this container before connecting
--container-podman-userContainer OS user to run the podman exec bridge as
--container-podman-runtimePodman runtime command; defaults to podman
--container-nerdctl-nameRun a nerdctl exec stdio bridge in this container before connecting
--container-nerdctl-userContainer OS user to run the nerdctl exec bridge as
--container-nerdctl-runtimeNerdctl runtime command; defaults to nerdctl
--container-compose-serviceRun a compose exec stdio bridge in this service before connecting
--container-compose-userContainer OS user to run the compose exec bridge as
--container-compose-fileCompose file passed before compose exec; repeat for more files
--container-compose-projectCompose project name passed before compose exec
--container-compose-runtimeCompose runtime command; defaults to docker, use docker-compose for v1
--container-kubectl-podRun a kubectl exec stdio bridge in this pod before connecting
--container-kubectl-containerContainer within a multi-container pod to exec into
--container-kubectl-namespaceKubernetes namespace to run the exec in
--container-kubectl-contextKubernetes context to run the exec against
--container-kubectl-runtimeKubectl runtime command; defaults to kubectl
--logDiagnostic log filter: startup, connect, query, transport, mode, an exact event such as query.error, or all. Comma-separated or repeated
--schemaSchema to inspect
--likeOptional LIKE pattern matched against the view name (% is the wildcard)

afpsql psql install

Install an afpsql-managed psql wrapper.

afpsql psql install [--bin-dir <DIR>]
ArgumentMeaning
--bin-dirDirectory that holds the psql wrapper; defaults to the afpsql executable directory

afpsql psql status

Show whether the afpsql-managed psql wrapper is installed and active.

afpsql psql status [--bin-dir <DIR>]
ArgumentMeaning
--bin-dirDirectory that holds the psql wrapper; defaults to the afpsql executable directory

afpsql psql uninstall

Remove an afpsql-managed psql wrapper.

afpsql psql uninstall [--bin-dir <DIR>]
ArgumentMeaning
--bin-dirDirectory that holds the psql wrapper; defaults to the afpsql executable directory

afpsql skill install

Install the Agent-First PSQL skill.

skill-install-every-agent — Target every agent that supports the scope

afpsql skill install [--agent all] [--scope <personal|workspace>] [--force]

skill-install-one-agent — Target one named agent; only this shape accepts –skills-dir

afpsql skill install --agent <codex|claude-code|opencode|hermes> [--scope <personal|workspace>] [--skills-dir <DIR>] [--force]

Arguments across every shape above:

ArgumentMeaning
--agentAgent to manage
--scopeSkill scope
--skills-dirDirectory that contains skill folders
--forceOverwrite or remove an unmanaged Agent-First PSQL skill at the target path

afpsql skill status

Show whether the Agent-First PSQL skill is installed, valid, and up to date.

skill-status-every-agent — Target every agent that supports the scope

afpsql skill status [--agent all] [--scope <personal|workspace>]

skill-status-one-agent — Target one named agent; only this shape accepts –skills-dir

afpsql skill status --agent <codex|claude-code|opencode|hermes> [--scope <personal|workspace>] [--skills-dir <DIR>]

Arguments across every shape above:

ArgumentMeaning
--agentAgent to manage
--scopeSkill scope
--skills-dirDirectory that contains skill folders

afpsql skill uninstall

Remove an afpsql-managed Agent-First PSQL skill.

skill-uninstall-every-agent — Target every agent that supports the scope

afpsql skill uninstall [--agent all] [--scope <personal|workspace>] [--force]

skill-uninstall-one-agent — Target one named agent; only this shape accepts –skills-dir

afpsql skill uninstall --agent <codex|claude-code|opencode|hermes> [--scope <personal|workspace>] [--skills-dir <DIR>] [--force]

Arguments across every shape above:

ArgumentMeaning
--agentAgent to manage
--scopeSkill scope
--skills-dirDirectory that contains skill folders
--forceOverwrite or remove an unmanaged Agent-First PSQL skill at the target path

afpsql ui connections

Open a live server-connection panel with plain EXPLAIN input.

afpsql ui connections [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...] [--mode <window|session>] [--all] [--refresh <SECONDS>]

Output: protocol events; --output json/yaml/plain (default json), --output-to stdout/stderr (default stdout); redirect with --stdout-file or --stderr-file.

ArgumentMeaning
--dsnPostgreSQL DSN URI (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--conninfolibpq conninfo string (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--hostPostgreSQL host
--portPostgreSQL port
--userPostgreSQL user name
--dbnamePostgreSQL database name
--passwordPostgreSQL password (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--sshOpen an SSH transport to USER@HOST before connecting to PostgreSQL
--ssh-viaSSH hop to reach before the final –ssh destination; repeat for more hops
--ssh-optionAdditional OpenSSH -o option; repeat for more options
--ssh-remote-socketExplicit remote PostgreSQL Unix socket path for SSH forwarding
--ssh-sudo-userRemote OS user for the sudo -n Unix-socket bridge; needs an explicit socket
--container-docker-nameRun a docker exec stdio bridge in this container before connecting
--container-docker-userContainer OS user to run the docker exec bridge as
--container-docker-contextDocker context to run the exec against
--container-docker-runtimeDocker runtime command; defaults to docker
--container-apple-nameRun an Apple container exec stdio bridge in this container before connecting
--container-apple-userContainer OS user to run the Apple container exec bridge as
--container-apple-runtimeApple container runtime command; defaults to container
--container-podman-nameRun a podman exec stdio bridge in this container before connecting
--container-podman-userContainer OS user to run the podman exec bridge as
--container-podman-runtimePodman runtime command; defaults to podman
--container-nerdctl-nameRun a nerdctl exec stdio bridge in this container before connecting
--container-nerdctl-userContainer OS user to run the nerdctl exec bridge as
--container-nerdctl-runtimeNerdctl runtime command; defaults to nerdctl
--container-compose-serviceRun a compose exec stdio bridge in this service before connecting
--container-compose-userContainer OS user to run the compose exec bridge as
--container-compose-fileCompose file passed before compose exec; repeat for more files
--container-compose-projectCompose project name passed before compose exec
--container-compose-runtimeCompose runtime command; defaults to docker, use docker-compose for v1
--container-kubectl-podRun a kubectl exec stdio bridge in this pod before connecting
--container-kubectl-containerContainer within a multi-container pod to exec into
--container-kubectl-namespaceKubernetes namespace to run the exec in
--container-kubectl-contextKubernetes context to run the exec against
--container-kubectl-runtimeKubectl runtime command; defaults to kubectl
--logDiagnostic log filter: startup, connect, query, transport, mode, an exact event such as query.error, or all. Comma-separated or repeated
--modeHow this reaches the person: window a browser window is open on this machine; session the session is registered only; open it with afui session open or reach it through afui session serve. Falls back to AFUI_DELIVERY, then window
--allInclude PostgreSQL’s own background backends, not just client connections
--refreshSeconds between live snapshots; minimum 2

afpsql ui indexes

Open a panel listing indexes with their definitions, size, and validity.

afpsql ui indexes [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...] [--mode <window|session>] [--schema <SCHEMA>] [--table <TABLE>]

Output: protocol events; --output json/yaml/plain (default json), --output-to stdout/stderr (default stdout); redirect with --stdout-file or --stderr-file.

ArgumentMeaning
--dsnPostgreSQL DSN URI (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--conninfolibpq conninfo string (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--hostPostgreSQL host
--portPostgreSQL port
--userPostgreSQL user name
--dbnamePostgreSQL database name
--passwordPostgreSQL password (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--sshOpen an SSH transport to USER@HOST before connecting to PostgreSQL
--ssh-viaSSH hop to reach before the final –ssh destination; repeat for more hops
--ssh-optionAdditional OpenSSH -o option; repeat for more options
--ssh-remote-socketExplicit remote PostgreSQL Unix socket path for SSH forwarding
--ssh-sudo-userRemote OS user for the sudo -n Unix-socket bridge; needs an explicit socket
--container-docker-nameRun a docker exec stdio bridge in this container before connecting
--container-docker-userContainer OS user to run the docker exec bridge as
--container-docker-contextDocker context to run the exec against
--container-docker-runtimeDocker runtime command; defaults to docker
--container-apple-nameRun an Apple container exec stdio bridge in this container before connecting
--container-apple-userContainer OS user to run the Apple container exec bridge as
--container-apple-runtimeApple container runtime command; defaults to container
--container-podman-nameRun a podman exec stdio bridge in this container before connecting
--container-podman-userContainer OS user to run the podman exec bridge as
--container-podman-runtimePodman runtime command; defaults to podman
--container-nerdctl-nameRun a nerdctl exec stdio bridge in this container before connecting
--container-nerdctl-userContainer OS user to run the nerdctl exec bridge as
--container-nerdctl-runtimeNerdctl runtime command; defaults to nerdctl
--container-compose-serviceRun a compose exec stdio bridge in this service before connecting
--container-compose-userContainer OS user to run the compose exec bridge as
--container-compose-fileCompose file passed before compose exec; repeat for more files
--container-compose-projectCompose project name passed before compose exec
--container-compose-runtimeCompose runtime command; defaults to docker, use docker-compose for v1
--container-kubectl-podRun a kubectl exec stdio bridge in this pod before connecting
--container-kubectl-containerContainer within a multi-container pod to exec into
--container-kubectl-namespaceKubernetes namespace to run the exec in
--container-kubectl-contextKubernetes context to run the exec against
--container-kubectl-runtimeKubectl runtime command; defaults to kubectl
--logDiagnostic log filter: startup, connect, query, transport, mode, an exact event such as query.error, or all. Comma-separated or repeated
--modeHow this reaches the person: window a browser window is open on this machine; session the session is registered only; open it with afui session open or reach it through afui session serve. Falls back to AFUI_DELIVERY, then window
--schemaSchema to filter on
--tableTable to filter on; schema.table overrides –schema

afpsql ui plan

Show one statement to a person and run it only if they approve; closing refuses.

ui_plan — Show inline –sql for approval

afpsql ui plan [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...] [--mode <window|session>] --sql <SQL> [--param <N=VALUE>...] [--permission <read|write|ssh-read|ssh-write|container-read|container-write>] [--statement-timeout-ms <MS>] [--lock-timeout-ms <MS>] [--inline-max-rows <N>] [--inline-max-bytes <N>]

ui_plan_file — Show the statement read from –sql-file for approval

afpsql ui plan [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...] [--mode <window|session>] --sql-file <PATH> [--param <N=VALUE>...] [--permission <read|write|ssh-read|ssh-write|container-read|container-write>] [--statement-timeout-ms <MS>] [--lock-timeout-ms <MS>] [--inline-max-rows <N>] [--inline-max-bytes <N>]

Output: protocol events; --output json/yaml/plain (default json), --output-to stdout/stderr (default stdout); redirect with --stdout-file or --stderr-file.

Arguments across every shape above:

ArgumentMeaning
--dsnPostgreSQL DSN URI (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--conninfolibpq conninfo string (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--hostPostgreSQL host
--portPostgreSQL port
--userPostgreSQL user name
--dbnamePostgreSQL database name
--passwordPostgreSQL password (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--sshOpen an SSH transport to USER@HOST before connecting to PostgreSQL
--ssh-viaSSH hop to reach before the final –ssh destination; repeat for more hops
--ssh-optionAdditional OpenSSH -o option; repeat for more options
--ssh-remote-socketExplicit remote PostgreSQL Unix socket path for SSH forwarding
--ssh-sudo-userRemote OS user for the sudo -n Unix-socket bridge; needs an explicit socket
--container-docker-nameRun a docker exec stdio bridge in this container before connecting
--container-docker-userContainer OS user to run the docker exec bridge as
--container-docker-contextDocker context to run the exec against
--container-docker-runtimeDocker runtime command; defaults to docker
--container-apple-nameRun an Apple container exec stdio bridge in this container before connecting
--container-apple-userContainer OS user to run the Apple container exec bridge as
--container-apple-runtimeApple container runtime command; defaults to container
--container-podman-nameRun a podman exec stdio bridge in this container before connecting
--container-podman-userContainer OS user to run the podman exec bridge as
--container-podman-runtimePodman runtime command; defaults to podman
--container-nerdctl-nameRun a nerdctl exec stdio bridge in this container before connecting
--container-nerdctl-userContainer OS user to run the nerdctl exec bridge as
--container-nerdctl-runtimeNerdctl runtime command; defaults to nerdctl
--container-compose-serviceRun a compose exec stdio bridge in this service before connecting
--container-compose-userContainer OS user to run the compose exec bridge as
--container-compose-fileCompose file passed before compose exec; repeat for more files
--container-compose-projectCompose project name passed before compose exec
--container-compose-runtimeCompose runtime command; defaults to docker, use docker-compose for v1
--container-kubectl-podRun a kubectl exec stdio bridge in this pod before connecting
--container-kubectl-containerContainer within a multi-container pod to exec into
--container-kubectl-namespaceKubernetes namespace to run the exec in
--container-kubectl-contextKubernetes context to run the exec against
--container-kubectl-runtimeKubectl runtime command; defaults to kubectl
--logDiagnostic log filter: startup, connect, query, transport, mode, an exact event such as query.error, or all. Comma-separated or repeated
--modeHow this reaches the person: window a browser window is open on this machine; session the session is registered only; open it with afui session open or reach it through afui session serve. Falls back to AFUI_DELIVERY, then window
--sqlInline SQL to show and, once approved, run
--sql-fileFile to read the statement from; - reads it from stdin
--paramPositional bind parameter in N=value form; repeat for more parameters. Bare null/true/false bind as JSON null/booleans; prefix with text: to bind any value as a literal string
--permissionQuery permission policy; defaults to read, ssh-read with –ssh, or container-read with a –container--* flag
--statement-timeout-msPer-query statement timeout in milliseconds
--lock-timeout-msPer-query lock timeout in milliseconds
--inline-max-rowsMaximum inline rows before returning a truncated result
--inline-max-bytesMaximum inline payload bytes before returning a truncated result

afpsql ui schema

Open a panel showing every relation in one schema and its columns.

afpsql ui schema [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...] [--mode <window|session>] <SCHEMA>

Output: protocol events; --output json/yaml/plain (default json), --output-to stdout/stderr (default stdout); redirect with --stdout-file or --stderr-file.

ArgumentMeaning
--dsnPostgreSQL DSN URI (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--conninfolibpq conninfo string (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--hostPostgreSQL host
--portPostgreSQL port
--userPostgreSQL user name
--dbnamePostgreSQL database name
--passwordPostgreSQL password (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--sshOpen an SSH transport to USER@HOST before connecting to PostgreSQL
--ssh-viaSSH hop to reach before the final –ssh destination; repeat for more hops
--ssh-optionAdditional OpenSSH -o option; repeat for more options
--ssh-remote-socketExplicit remote PostgreSQL Unix socket path for SSH forwarding
--ssh-sudo-userRemote OS user for the sudo -n Unix-socket bridge; needs an explicit socket
--container-docker-nameRun a docker exec stdio bridge in this container before connecting
--container-docker-userContainer OS user to run the docker exec bridge as
--container-docker-contextDocker context to run the exec against
--container-docker-runtimeDocker runtime command; defaults to docker
--container-apple-nameRun an Apple container exec stdio bridge in this container before connecting
--container-apple-userContainer OS user to run the Apple container exec bridge as
--container-apple-runtimeApple container runtime command; defaults to container
--container-podman-nameRun a podman exec stdio bridge in this container before connecting
--container-podman-userContainer OS user to run the podman exec bridge as
--container-podman-runtimePodman runtime command; defaults to podman
--container-nerdctl-nameRun a nerdctl exec stdio bridge in this container before connecting
--container-nerdctl-userContainer OS user to run the nerdctl exec bridge as
--container-nerdctl-runtimeNerdctl runtime command; defaults to nerdctl
--container-compose-serviceRun a compose exec stdio bridge in this service before connecting
--container-compose-userContainer OS user to run the compose exec bridge as
--container-compose-fileCompose file passed before compose exec; repeat for more files
--container-compose-projectCompose project name passed before compose exec
--container-compose-runtimeCompose runtime command; defaults to docker, use docker-compose for v1
--container-kubectl-podRun a kubectl exec stdio bridge in this pod before connecting
--container-kubectl-containerContainer within a multi-container pod to exec into
--container-kubectl-namespaceKubernetes namespace to run the exec in
--container-kubectl-contextKubernetes context to run the exec against
--container-kubectl-runtimeKubectl runtime command; defaults to kubectl
--logDiagnostic log filter: startup, connect, query, transport, mode, an exact event such as query.error, or all. Comma-separated or repeated
--modeHow this reaches the person: window a browser window is open on this machine; session the session is registered only; open it with afui session open or reach it through afui session serve. Falls back to AFUI_DELIVERY, then window
SCHEMASchema to inspect, for example public

afpsql ui table

Open a panel describing one table: columns, constraints, indexes, and triggers.

afpsql ui table [--dsn <SOURCE>] [--conninfo <SOURCE>] [--host <HOST>] [--port <PORT>] [--user <USER>] [--dbname <DBNAME>] [--password <SOURCE>] [--ssh <USER@HOST>] [--ssh-via <USER@HOST>...] [--ssh-option <OPTION>...] [--ssh-remote-socket <PATH>] [--ssh-sudo-user <USER>] [--container-docker-name <NAME>] [--container-docker-user <USER>] [--container-docker-context <CONTEXT>] [--container-docker-runtime <COMMAND>] [--container-apple-name <NAME>] [--container-apple-user <USER>] [--container-apple-runtime <COMMAND>] [--container-podman-name <NAME>] [--container-podman-user <USER>] [--container-podman-runtime <COMMAND>] [--container-nerdctl-name <NAME>] [--container-nerdctl-user <USER>] [--container-nerdctl-runtime <COMMAND>] [--container-compose-service <NAME>] [--container-compose-user <USER>] [--container-compose-file <FILE>...] [--container-compose-project <NAME>] [--container-compose-runtime <COMMAND>] [--container-kubectl-pod <NAME>] [--container-kubectl-container <NAME>] [--container-kubectl-namespace <NAMESPACE>] [--container-kubectl-context <CONTEXT>] [--container-kubectl-runtime <COMMAND>] [--log <FILTER>...] [--mode <window|session>] <NAME>

Output: protocol events; --output json/yaml/plain (default json), --output-to stdout/stderr (default stdout); redirect with --stdout-file or --stderr-file.

ArgumentMeaning
--dsnPostgreSQL DSN URI (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--conninfolibpq conninfo string (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--hostPostgreSQL host
--portPostgreSQL port
--userPostgreSQL user name
--dbnamePostgreSQL database name
--passwordPostgreSQL password (the value, or where to read it: env:NAME, file[+FORMAT]:PATH#DOT_PATH, literal:VALUE)
--sshOpen an SSH transport to USER@HOST before connecting to PostgreSQL
--ssh-viaSSH hop to reach before the final –ssh destination; repeat for more hops
--ssh-optionAdditional OpenSSH -o option; repeat for more options
--ssh-remote-socketExplicit remote PostgreSQL Unix socket path for SSH forwarding
--ssh-sudo-userRemote OS user for the sudo -n Unix-socket bridge; needs an explicit socket
--container-docker-nameRun a docker exec stdio bridge in this container before connecting
--container-docker-userContainer OS user to run the docker exec bridge as
--container-docker-contextDocker context to run the exec against
--container-docker-runtimeDocker runtime command; defaults to docker
--container-apple-nameRun an Apple container exec stdio bridge in this container before connecting
--container-apple-userContainer OS user to run the Apple container exec bridge as
--container-apple-runtimeApple container runtime command; defaults to container
--container-podman-nameRun a podman exec stdio bridge in this container before connecting
--container-podman-userContainer OS user to run the podman exec bridge as
--container-podman-runtimePodman runtime command; defaults to podman
--container-nerdctl-nameRun a nerdctl exec stdio bridge in this container before connecting
--container-nerdctl-userContainer OS user to run the nerdctl exec bridge as
--container-nerdctl-runtimeNerdctl runtime command; defaults to nerdctl
--container-compose-serviceRun a compose exec stdio bridge in this service before connecting
--container-compose-userContainer OS user to run the compose exec bridge as
--container-compose-fileCompose file passed before compose exec; repeat for more files
--container-compose-projectCompose project name passed before compose exec
--container-compose-runtimeCompose runtime command; defaults to docker, use docker-compose for v1
--container-kubectl-podRun a kubectl exec stdio bridge in this pod before connecting
--container-kubectl-containerContainer within a multi-container pod to exec into
--container-kubectl-namespaceKubernetes namespace to run the exec in
--container-kubectl-contextKubernetes context to run the exec against
--container-kubectl-runtimeKubectl runtime command; defaults to kubectl
--logDiagnostic log filter: startup, connect, query, transport, mode, an exact event such as query.error, or all. Comma-separated or repeated
--modeHow this reaches the person: window a browser window is open on this machine; session the session is registered only; open it with afui session open or reach it through afui session serve. Falls back to AFUI_DELIVERY, then window
NAMETable name; schema.table overrides the default public schema

Exit codes

CodeMeaning
0The command ran and succeeded.
1The command ran and failed. The event carries a domain error.code.
2The invocation was rejected before anything ran. error.code is one of the cli_* codes below.
4A terminal event could not be written; the requested outcome is unknown to the caller.

The split is the useful one for a caller: exit 2 means the call was never made, so retrying it unchanged cannot help, while exit 1 means it was.

CLI errors

Every structural failure emits one strict JSON kind:"error" event on stderr, leaves stdout empty, and exits 2. The code names the failure — cli_unknown_argument for an unknown spelling, cli_unregistered_combination for registered arguments in a mixture that is not, and one each for cli_unknown_command, cli_missing_argument_value, cli_invalid_argument_value, cli_duplicate_argument, cli_unexpected_positional, and cli_invalid_utf8. message identifies a safe argument spelling or the failure category and hint gives the command to run next; neither ever quotes a raw value, including secrets. These are decided before any config, secret source, filesystem, network, or domain I/O.

Two exit-1 codes describe the tool itself rather than the call: cli_invocation_invalid means the program misread its own resolved invocation — an unknown action id, or an argument id the selected combination cannot produce — and output_setup_failed means an output sink (--stdout-file, --stderr-file, stream redirection) could not be established. Both are defects to report, not inputs to correct; retrying the same command cannot help.

Domain failures (exit 1) carry their own stable error.code instead, drawn from whatever this tool defines rather than from the cli_* set. Error events are routinely logged, so a message never quotes a value that came from an argument able to carry a credential — a header, a cookie, a token, a password, a proxy URL, an environment value, a form field. Such an error names the argument and the shape that was wrong, and stops there. A value that cannot be a secret — a path, a dot-path, a session name — is quoted, because an error that cannot say which one it means is not worth logging either.