postgres-clilisted
Install: claude install-skill Xipher-Labs/walter-os
# Postgres CLI (`psql`)
Direct database access via the official Postgres client. Replaces unmaintained
community MCPs (low-star, single-maintainer) which were our weakest links.
Mature, multi-decade-stable tooling, available everywhere.
## Setup
```bash
# Already in setup/Brewfile:
brew install postgresql@16 # provides psql + pg_dump + pg_restore
# Verify
psql --version
```
Connection strings live in **Infisical** (project-scoped) or
`~/.config/walter-os/secrets.env` (operator-local). NEVER hardcode in
scripts.
```bash
# From Infisical (preferred for runtime)
DATABASE_URL=$(infisical secrets get DATABASE_URL --raw --project [project-a]-staging)
# From walter-os env (operator interactive use)
source ~/.config/walter-os/secrets.env
psql "$DATABASE_URL"
```
## Common operations
### Connect
```bash
psql "$DATABASE_URL" # interactive shell
psql "$DATABASE_URL" -c '\dt' # one-shot command
psql "$DATABASE_URL" -f script.sql
```
### Inspect schema
```sql
\dt -- list tables
\dt+ -- with sizes
\d users -- describe a table
\d+ users -- with comments + storage
\df -- list functions
\du -- list roles
\l -- list databases
\dn -- list schemas
\dx -- list extensions
```
### Query patterns
```bash
# Top 10 rows of a ta