Skip to main content
Version: Next

CLI Reference

Complete reference for the stroppy command-line interface.

stroppy run

Run a benchmark script with k6.

stroppy run [script] [sql_file] [-d driver] [-D key=value]
[-e KEY=VALUE] [-f config.json]
[--steps step1,step2] [-- k6-args...]

The script argument is optional when a config file supplies script. When present, it selects the input mode and overrides the config file script field.

InputModeExample
No extensionPreset/script namestroppy run tpcc/tx
.tsScript pathstroppy run bench.ts
.sqlSQL file modestroppy run queries.sql
Quoted string with spacesInline SQLstroppy run "select 1"

The optional second positional argument specifies an explicit SQL file and overrides script-level SQL auto-selection.

Flags

FlagShortDescription
--driver NAME-dUse a driver preset (pg, mysql, pico, ydb, noop). Append a number for additional drivers: -d1, -d2, etc. Also accepts raw JSON.
--driver-opt K=V-DOverride a single driver field. Append a number for additional drivers: -D1, -D2. See driver option keys.
--env KEY=VALUE-eSet an environment variable for the script. Lowercase keys are auto-uppercased. Real environment takes precedence over -e values.
--file PATH-fLoad run settings from a JSON config file. If omitted, ./stroppy-config.json is used when present. See Configuration Files.
--steps step1,step2Run only the listed steps; skip all others.
--no-steps step1,step2Skip the listed steps; run everything else.
--Everything after this separator is forwarded to k6.

--steps and --no-steps are mutually exclusive. Both accept comma-separated lists or the = form (--steps=create_schema,load_data).

Driver presets

PresetdriverTypeURLdefaultInsertMethod
pgpostgrespostgres://postgres:postgres@localhost:5432native
mysqlmysqlmyuser:mypassword@tcp(localhost:3306)/mydb?charset=utf8mb4&parseTime=True&loc=Localplain_bulk
picopicodatapostgres://admin:T0psecret@localhost:1331plain_bulk
ydbydbgrpc://localhost:2136/localnative
noopnoopnoop://localhostplain_bulk

CSV is a driver type but has no short preset. Configure it with -D driverType=csv and a filesystem URL.

Driver option keys

KeyTypeDescription
urlstringDatabase connection URL or DSN.
driverTypestringpostgres, mysql, picodata, ydb, noop, or csv.
defaultInsertMethodstringplain_query, native, or plain_bulk.
defaultTxIsolationstringread_uncommitted, read_committed, repeatable_read, serializable, db_default, conn, or none.
errorModestringsilent, log, throw, fail, or abort.
bulkSizeintRows per bulk INSERT or native batch where applicable. Default: 2500.
pool.maxConnsintMaximum pool connections.
pool.minConnsintMinimum pool connections.
pool.maxConnLifetimedurationMax connection lifetime, e.g. 1h.
pool.maxConnIdleTimedurationMax idle connection time, e.g. 10m.
caCertFilestringCA certificate PEM path for TLS.
authTokenstringToken credential, mainly for YDB.
authUser / authPasswordstringStatic credentials.
tlsInsecureSkipVerifyboolDisable TLS certificate verification for testing.

Examples

# Built-in TPC-C preset
stroppy run tpcc/tx

# TPC-B with k6 args
stroppy run tpcb/tx -- --duration 5m

# TPC-DS with explicit SQL variant
stroppy run tpcds tpcds-scale-100

# Custom test script
stroppy run my_benchmark.ts

# Explicit paths
stroppy run ./benchmarks/custom.ts data.sql

# Execute a SQL file directly
stroppy run queries.sql

# Execute inline SQL
stroppy run "select 1"

# Only run specified steps
stroppy run tpcc/tx --steps create_schema,load_data

# Run all steps except specified
stroppy run tpcc/tx --no-steps load_data

# PostgreSQL driver preset
stroppy run tpcc/tx -d pg

# Preset with URL override
stroppy run tpcc/tx -d pg -D url=postgres://prod:5432

# Two drivers: pg + mysql
stroppy run tpcc/procs -d pg -d1 mysql

# Set POOL_SIZE env for the script
stroppy run tpcc/tx -e pool_size=200

# Multiple env overrides
stroppy run tpcc/tx -e FOO=bar -e BAZ=qux

# Use a JSON config file
stroppy run -f prod.json

stroppy probe

Run a script in a mocked environment to extract metadata without executing the benchmark. Probe shows configuration, k6 options, SQL structure, steps, environment variables, and effective driver setup.

stroppy probe [script] [sql_file] [flags]

The script argument is optional when a loaded config file supplies script.

Flags

FlagShortDescription
--file PATH-fLoad the same JSON config file used by stroppy run. If omitted, ./stroppy-config.json is used when present.
--output FORMAT-oOutput format: human (default) or json.
--local-lPrevent tmp dir creation; resolve imports from the script's working directory.
--configShow only the Stroppy config section.
--optionsShow only the k6 options section.
--sqlShow only the SQL file structure section.
--stepsShow only the steps section.
--envsShow only the environment variables section.
--driversShow only the drivers section.

When no section flags are set, all sections are shown. Multiple section flags can be combined.

Examples

# Probe all sections
stroppy probe tpcc/tx

# Probe with an explicit SQL file
stroppy probe workloads/tpcc/tx.ts workloads/tpcc/pg.sql

# Show only SQL structure
stroppy probe workloads/tpcc/procs.ts --sql

# Show SQL structure and steps together
stroppy probe workloads/tpcc/procs.ts --sql --steps

# Show effective driver setup
stroppy probe tpcc/tx --drivers

# Machine-readable JSON output
stroppy probe workloads/tpcc/procs.ts -o json

# Probe a config file before running it
stroppy probe -f prod.json --config --envs --drivers --steps

# Probe using local imports
stroppy probe workloads/tpcc/procs.ts --local

stroppy gen

Generate a development environment with TypeScript support, static files, and an optional preset example.

stroppy gen --workdir <path> [--preset <name>]

Flags

FlagRequiredDescription
--workdir <path>YesOutput directory for the development environment.
--preset <name>NoInclude an example preset script.

Available presets

simple, tpcc, tpcb, execute_sql, tpcds, tpch

The generated directory contains:

  • Proto files (stroppy.pb.js, stroppy.pb.ts, stroppy.d.ts)
  • Helper files (helpers.ts, datagen.ts, parse_sql.ts, parse_sql.js)
  • package.json and tsconfig.json for TypeScript types
  • Stroppy binary (stroppy)
  • k6 symlink (k6 -> stroppy)
  • Preset files, if --preset is specified

Examples

# Generate a bare workspace
stroppy gen --workdir ./my-benchmark

# Generate with a preset example
stroppy gen --workdir ./my-benchmark --preset tpcc

# Generate with execute_sql preset
stroppy gen --workdir ./my-benchmark --preset execute_sql

stroppy version

Print versions of Stroppy and key dependencies.

stroppy version [--json]

Flags

FlagDescription
--jsonOutput versions as JSON.

Output

Default output:

stroppy  v5.1.2
k6 v1.7.0
pgx v5.8.0

With --json:

{
"stroppy": "v5.1.2",
"k6": "v1.7.0",
"pgx": "v5.8.0"
}

stroppy help

Show extended help about a topic. Run without arguments to list all available topics.

stroppy help [topic]

Available topics

TopicDescription
config-fileJSON configuration files for run and probe settings.
datagenRelational data generation with Rel.table and InsertSpec.
driversDriver presets, options, and multi-driver configuration.
envsEnvironment variables in Stroppy scripts.
probeProbe output sections, flags, and output formats.
resolutionHow Stroppy finds and resolves scripts and SQL files.
sqlSQL file format: sections, queries, parameters, and multi-dialect.
stepsLogical benchmark phases: defining, filtering, and discovering steps.

Examples

# List all topics
stroppy help

# Read about driver configuration
stroppy help drivers

# Read about relational data generation
stroppy help datagen

k6 passthrough

Everything after the -- separator in stroppy run is forwarded directly to the underlying k6 engine.

stroppy run <script> [stroppy-flags] -- [k6-args...]

Common k6 flags

FlagDescriptionExample
--vus NNumber of virtual users.--vus 10
--duration DTest duration.--duration 5m
--iterations NTotal script iterations.--iterations 1000
--out FORMATOutput metrics to a backend.--out json=results.json
-e KEY=VALUESet a k6 environment variable. Prefer Stroppy's -e before -- for workload params.-e WAREHOUSES=50

Examples

# 10 VUs for 5 minutes
stroppy run tpcc/tx -- --vus 10 --duration 5m

# Fixed number of iterations
stroppy run tpcb/tx -- --iterations 100

# Export metrics as JSON
stroppy run tpcc/tx -- --out json=results.json

# Combine Stroppy flags and k6 flags
stroppy run tpcc/tx -d pg --steps load_data -- --vus 4 --duration 2m

Environment variables

Set by Stroppy

These are set automatically by stroppy run before launching k6.

VariableDescription
STROPPY_DRIVER_0, STROPPY_DRIVER_1, ...JSON-serialized driver configuration for each driver index. Set from config files or -d/-D flags. If already set in the real environment, the composed value is skipped.
STROPPY_STEPSComma-separated list of steps to run.
STROPPY_NO_STEPSComma-separated list of steps to skip.
SQL_FILEPath to the resolved SQL file when a SQL file is supplied or auto-resolved.
LOG_LEVELLogger level from Stroppy global config.
LOG_MODELogger mode from Stroppy global config.

Read by scripts

These are commonly used by built-in workloads.

VariableDescription
STROPPY_ERROR_MODEError handling mode for all drivers: silent, log, throw, fail, abort. Overrides per-driver config.
SQL_FILESQL file path. Current multi-dialect scripts also auto-select SQL based on driverType when this is unset.
STROPPY_STEPSRead by the Step filter in helpers.ts.
STROPPY_NO_STEPSRead by the Step filter in helpers.ts.

k6 environment variables

VariableDescription
K6_WEB_DASHBOARDSet to true to enable the real-time web dashboard.
K6_WEB_DASHBOARD_EXPORTPath to export an HTML report at the end of the run. Requires K6_WEB_DASHBOARD=true.

Precedence

Environment and driver precedence from highest to lowest:

  1. Real environment variables.
  2. -e KEY=VALUE CLI env overrides.
  3. Config file env map.
  4. -d and -D CLI driver presets and overrides.
  5. Config file drivers map.
  6. Script defaults from ENV() and declareDriverSetup().

The -e flag and config file env keys are auto-uppercased: pool_size=200 sets POOL_SIZE=200.


File resolution

Scripts and SQL files are resolved through a search path:

  1. Current working directory.
  2. ~/.stroppy/.
  3. Embedded built-in workloads.
  4. Embedded preset subdirectories when a preset name is inferred.

Script and SQL files resolve independently. Explicit relative paths (./) and absolute paths (/) skip preset-based lookup.

Current multi-dialect built-ins usually choose their SQL file inside TypeScript based on the active driverType (pg.sql, mysql.sql, pico.sql, or ydb.sql). A second positional SQL argument or SQL_FILE override takes priority.

For the full lookup rules, see Introduction: File Resolution and stroppy help resolution.