Agent skill · software engineering · jeremylongshore

clickhouse-multi-env-setup

Configure ClickHouse across dev, staging, and production with environment-specific settings, secrets management, and infrastructure-as-code patterns. Use when setting up per-environment ClickHouse instances, managing connection configs, wiring secrets per environment, or deploying to multiple environments. Trigger with "clickhouse environments", "clickhouse dev staging prod", "clickhouse multi-env", "clickhouse environment config", "clickhouse staging setup".

Why this skill is useful

Adds executable scripts for managing ClickHouse environments with secrets management and CI/CD integration that aren't in public docs.

What it needs

Requires aws, clickhouse, gcloud, vault installed locally. Requires aws, clickhouse, gcp account access. About 3k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

ClickHouse Multi-Environment Setup Overview Configure separate ClickHouse instances for development, staging, and production with proper secrets management, environment detection, and infrastructure-as-code. A single typed config module resolves the right instance from NODEENV, so application code never branches on environment and destructive operations are blocked outside dev/staging. The full code for every step lives in references/implementation.md; worked end-to-end flows are in references/examples.md. Prerequisites ClickHouse Cloud account or self-hosted instances per environment Secret management solution (Vault, AWS Secrets Manager, GCP Secret Manager) CI/CD pipeline with environment variables Instructions Step 1: Choose an environment strategy Provision one instance per tier, isolated by data sensitivity: Environment Instance Purpose Data ------------- ---------- --------- ------ Development Docker local Fast iteration Synthetic seed data Staging ClickHouse Cloud (Dev tier) Pre-prod validation Sampled prod copy Production ClickHouse Cloud (Prod tier) Live traffic Real data Step 2: Build a typed config module Create src/config/clickhouse.ts with one ClickHouseEnvConfig per environment, keyed by NODEENV. Fail fast in non-dev environments — require a password and enforce HTTPS at startup: Full per-environment config table (pool sizes, timeouts, compression): references/implementation.md. Step 3: Add a client factory A lazily-initialized singleton in src/clickhouse/client.ts builds the pool once per process from the resolved config. Full code: references/implementation.md. Step 4: Wire secrets per environment Dev uses a git-ignored .env.local; every other tier pulls from a secret manager (AWS Secrets Manager, GCP Secret Manager, or Vault) — never commit credentials. CLI recipes for all three: references/implementation.md. Step 5: Apply schema deterministically Run sorted .sql files through a migration runner (scripts/apply-schema.ts). …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/clickhouse-multi-env-setup

View the source on GitHub

Browse the @skills marketplace