CLI Commands
Command line interface reference for the pg-smart-search migration and setup tool.
CLI Commands
The published binaries are pg-smart-init and pg-smart-bench (there is no single
pg-smart-search executable).
pg-smart-init
Initializes the database for pg-smart-search by creating required indices and generated columns.
npx pg-smart-initThis is a fully interactive wizard (built on enquirer prompts) -- there are no CLI
flags. It walks through: table name, search columns, whether to enable hybrid search,
search tier, (for VECTOR) embedding provider, and (if hybrid) Turbo Mode. At the end it
asks whether to apply the generated SQL directly to a database (via a connection string
you supply then) and/or save it to search-setup.sql / search-config.js.
There is currently no non-interactive/CI mode -- --apply, --output, and --url flags
don't exist. For CI/CD, run the wizard once locally and commit the generated
search-setup.sql, or feed the SQL into your own migration tool.
For the ADVANCED tier, the wizard generates CREATE EXTENSION rum and a USING RUM
index. The RUM extension isn't a standard Postgres contrib module and may not install on
your instance; AdvancedStrategy's actual query also doesn't use a RUM-ordered scan (see
Search Tiers) -- it's a GiST/GIN
gin_trgm_ops/gist_trgm_ops index that its <% pre-filter actually benefits from.
pg-smart-bench
Benchmarks the engine using a mocked adapter with simulated latency -- useful for exercising the engine's own overhead (caching, dedup, hedging), but it does not hit a real database.
npx pg-smart-benchFor real, reproducible numbers against your own schema and data, run the repo's
bench:real script against an actual PostgreSQL instance instead.