Skip to content

CLI

Use the CLI for first-run auth, ClickHouse destination setup, and quick local requests.

Install

Use the installer from the same website you are reading:

  • Hosted website: https://sqltamer.com/install.sh
  • Local website eval: http://127.0.0.1:8000/install.sh
curl -fsSL https://sqltamer.com/install.sh | sh

That installer currently supports:

  • macOS (Apple Silicon and Intel)
  • Linux x86_64

Folder-local install that also keeps CLI auth/config next to the downloaded binary:

curl -fsSL https://sqltamer.com/install.sh | SQLTAMER_INSTALL_DIR="$PWD/.sqltamer/bin" sh

Local website eval example:

curl -fsSL http://127.0.0.1:8000/install.sh | SQLTAMER_INSTALL_DIR="$PWD/.runtime/downloaded-cli" sh

When you set a non-default SQLTAMER_INSTALL_DIR, the installer writes a small wrapper and defaults CLI state to .sqltamer-config.json in that directory. Override it with SQLTAMER_CONFIG_PATH when needed.

Direct downloads:

Create auth

Replace SQLTAMER_BASE_URL with your API base URL.

  • Hosted product: use https://sqltamer.com
  • Local website eval: use http://127.0.0.1:8080
sqltamer auth init --server-url "$SQLTAMER_BASE_URL"

What it does:

  • Creates preview access
  • Saves server_url and api_key locally
  • Prints the raw API key once

Check saved auth:

sqltamer auth show

Reveal the raw key again when you need it for curl:

sqltamer auth show --reveal

Create a ClickHouse destination

sqltamer clickhouse add \
  --name production \
  --upstream https://clickhouse.example.com:8443/ \
  --min-in-list-items 3

Read the returned proxy_base_url and point your ClickHouse HTTP client there. Keep your normal ClickHouse username and password.

If proxy_base_url stays on your main SQL Tamer host and includes a path like /v1/proxy/clickhouse/..., send your SQL Tamer API key as X-API-Key on each proxy request. Reveal it again with sqltamer auth show --reveal when needed.

Add --json when a script needs the raw response.

Hosted ClickHouse destinations default to min_in_list_items=1000. Lower it during smoke tests when you want smaller demo queries to rewrite immediately.

Send one SQL file to the rewrite API

sqltamer rewrite --file ./query.sql --dialect postgres

The CLI uses saved auth by default. Use --server-url or --api-key only when you need to override that config.