@tsproxy/cli
The CLI for tsproxy. Handles project setup, development, schema migration, seeding, and health checks.
Install
npm install -g @tsproxy/cli
# or use with npx:
npx @tsproxy/cli <command>Commands
tsproxy init
Interactive project setup. Asks about your Typesense setup, queue backend, and frontend framework, then generates config files and installs dependencies.
npx @tsproxy/cli initGenerates:
tsproxy.config.ts— proxy config withdefineConfigdocker-compose.yml— Typesense + Redis (if Docker selected).env— connection details
tsproxy dev
Start the proxy in development mode with hot reload.
npx tsproxy dev
npx tsproxy dev --port 4000
npx tsproxy dev --config ./custom.config.tstsproxy start
Start the proxy in production mode (requires tsproxy build first).
npx tsproxy starttsproxy build
Build the proxy for production deployment.
npx tsproxy buildtsproxy seed <file>
Seed Typesense with data from a JSON or JSONL file. Data goes through the ingest API, so computed fields are applied and the queue is used.
npx tsproxy seed products.json --collection products
npx tsproxy seed products.json --collection products --locale enOptions:
--collection <name>— target collection (default: products)--locale <locale>— locale for collection routing
tsproxy migrate
Sync Typesense schema with your tsproxy.config.ts. Shows a diff of what will change.
# Dry run (default)
npx tsproxy migrate
# Apply changes
npx tsproxy migrate --apply
# Drop and recreate
npx tsproxy migrate --apply --dropOutput:
Migration plan:
+ products — Create with 5 fields
+ products_en — Create with 5 fields
✓ products_fr — Up to date
Dry run — 2 change(s). Run with --apply to execute.tsproxy generate
Generate tsproxy.config.ts from an existing Typesense schema. Connects to Typesense, fetches collections, and scaffolds a config with correct field types.
npx tsproxy generate
npx tsproxy generate --host xyz.a1.typesense.net --port 443 --key your-key
npx tsproxy generate -o custom-config.tsOptions:
--host <host>— Typesense host--port <port>— Typesense port--key <key>— Typesense API key-o, --output <path>— Output file path (default: tsproxy.config.ts)
tsproxy health
Check Typesense and Redis connectivity.
npx tsproxy healthOutput:
Health check
✓ Proxy ok
✓ Typesense ok http://localhost:8108
✓ Redis ok localhost:6379
Status: healthy