Skip to content
Query.Farm
Talk with Us

CLI reference

The complete command surface for VGI’s command-line tools. For a task-focused walkthrough of the everyday commands, see Use the CLI.

CommandDescription
vgi-clientInvoke functions and manage catalogs
vgi-serveServe a worker over stdio or HTTP
vgi-fixture-workerRun the example worker with demo functions (requires vgi-python[fixtures])

The main CLI for invoking VGI functions and managing catalogs.

vgi-client [OPTIONS]

Options:

OptionDescription
–input FILEInput parquet file (omit for table functions)
–output FILE, -oOutput file (use - for stdout)
–format FORMAT, -fOutput format: json (default), csv, parquet, arrow-ipc
–function NAMEFunction name to invoke
–args JSONFunction arguments as JSON array (default: [])
–named-arg KEY=VALUENamed argument (repeatable)
–setting KEY=VALUE, -sFunction setting (repeatable)
–worker PATH, -wWorker command (default: vgi-fixture-worker)
–type TYPE, -tFunction type: auto, table, table-in-out, scalar
–projection-id NColumn IDs to project (repeatable)
–table-input-position NPosition (0-indexed) to insert table input in positional args
–max-workers NLimit parallel workers
–worker-stderrShow worker stderr output

Table function (generates data):

# Generate a sequence of 100 integers
vgi-client --function sequence --args '[100]'

# Output as CSV
vgi-client --function sequence --args '[10]' --format csv

Table-in-out function (transforms data):

# Echo input unchanged
vgi-client --input data.parquet --function echo

# Sum all numeric columns
vgi-client --input data.parquet --function sum_all_columns

# Repeat each row 3 times
vgi-client --input data.parquet --function repeat_inputs --args '[3]'

Scalar function (per-row transform):

# Multiply values in column "price" by 2
vgi-client --input data.parquet --function multiply --args '["price", 2]' --type scalar

Output to file:

vgi-client --function sequence --args '[1000]' --output result.parquet --format parquet

Manage database catalogs exposed by VGI workers.

Most catalog operations require an attach ID. Two workflows are supported:

Explicit attach (recommended for stateful catalogs):

# Attach and capture the attach ID
ATTACH_ID=$(vgi-client catalog attach mydb --worker ./worker.py | jq -r '.attach_opaque_data')

# Use attach ID for subsequent operations
vgi-client catalog schema list --attach-opaque-data $ATTACH_ID --worker ./worker.py

# Detach when done
vgi-client catalog detach $ATTACH_ID --worker ./worker.py

Auto-attach (for stateless catalogs):

# Specify catalog name instead of attach ID
vgi-client catalog schema list --catalog mydb --worker ./worker.py

List available catalogs from a worker.

vgi-client catalog list --worker ./worker.py

Attach to a catalog and get an attach ID.

vgi-client catalog attach <name> --worker <worker> [--options '{}']

Output:

{
"attach_opaque_data": "a1b2c3d4",
"supports_transactions": true,
"catalog_version": 1
}

Detach from a catalog.

vgi-client catalog detach <attach_opaque_data> --worker <worker>

Create a new catalog.

vgi-client catalog create <name> --worker <worker> \
  [--on-conflict {error|ignore|replace}] \
  [--options '{}']

Drop a catalog.

vgi-client catalog drop <name> --worker <worker>

Get the current catalog version.

vgi-client catalog version --catalog <name> --worker <worker>

Manage schemas within a catalog.

List all schemas in a catalog.

vgi-client catalog schema list --catalog <name> --worker <worker>

Get schema details.

vgi-client catalog schema get <schema_name> --catalog <name> --worker <worker>

Create a new schema.

vgi-client catalog schema create <schema_name> \
  --catalog <name> --worker <worker> \
  [--comment "Description"] \
  [--tags '{"key": "value"}']

Drop a schema.

vgi-client catalog schema drop <schema_name> \
  --catalog <name> --worker <worker> \
  [--ignore-not-found] [--cascade]

List objects in a schema by type. Requires --type to select the object kind (table, view, scalar_function, table_function, or aggregate_function).

vgi-client catalog schema contents <schema_name> \
  --catalog <name> --worker <worker> \
  --type table

Manage tables within a schema.

Get table details.

vgi-client catalog table get <schema> <table> --catalog <name> --worker <worker>

Create a new table.

vgi-client catalog table create <schema> <table> \
  --catalog <name> --worker <worker> \
  --columns '[{"name": "id", "type": "int64"}, {"name": "name", "type": "string"}]' \
  [--not-null 0] \
  [--unique "0,1"] \
  [--check "id > 0"] \
  [--on-conflict {error|ignore|replace}]

Supported column types:

CategoryTypes
Integerint8, int16, int32, int64, uint8, uint16, uint32, uint64
Floatfloat16, float32, float64
Stringstring, utf8, large_string, binary, large_binary
Booleanbool, boolean
Datedate32, date64
Timestamptimestamp, timestamp_s, timestamp_ms, timestamp_us, timestamp_ns
Durationduration, duration_s, duration_ms, duration_us, duration_ns
Timetime32, time64

Drop a table.

vgi-client catalog table drop <schema> <table> \
  --catalog <name> --worker <worker> \
  [--ignore-not-found]

Rename a table.

vgi-client catalog table rename <schema> <old_name> <new_name> \
  --catalog <name> --worker <worker>

Set or clear table comment.

# Set comment
vgi-client catalog table comment <schema> <table> \
  --catalog <name> --worker <worker> \
  --set "Table description"

# Clear comment
vgi-client catalog table comment <schema> <table> \
  --catalog <name> --worker <worker> \
  --clear

Get the scan function for a table.

vgi-client catalog table scan-function <schema> <table> \
  --catalog <name> --worker <worker>

Modify table columns.

Add a column to a table.

vgi-client catalog table column add <schema> <table> \
  --catalog <name> --worker <worker> \
  --column '{"name": "email", "type": "string"}' \
  [--if-not-exists]

Drop a column from a table.

vgi-client catalog table column drop <schema> <table> <column> \
  --catalog <name> --worker <worker> \
  [--if-exists] [--cascade]

Rename a column.

vgi-client catalog table column rename <schema> <table> <old_name> <new_name> \
  --catalog <name> --worker <worker>

Set column default value.

vgi-client catalog table column set-default <schema> <table> <column> "0" \
  --catalog <name> --worker <worker>

Remove column default value.

vgi-client catalog table column drop-default <schema> <table> <column> \
  --catalog <name> --worker <worker>

Change column type.

vgi-client catalog table column set-type <schema> <table> \
  --catalog <name> --worker <worker> \
  --column '{"name": "count", "type": "int64"}' \
  [--using "CAST(count AS int64)"]

Set or remove NOT NULL constraint.

vgi-client catalog table column set-not-null <schema> <table> <column> \
  --catalog <name> --worker <worker>

vgi-client catalog table column drop-not-null <schema> <table> <column> \
  --catalog <name> --worker <worker>

Manage views within a schema.

Get view details.

vgi-client catalog view get <schema> <view> --catalog <name> --worker <worker>

Create a view.

vgi-client catalog view create <schema> <view> \
  --catalog <name> --worker <worker> \
  --definition "SELECT id, name FROM users WHERE active = true" \
  [--on-conflict {error|ignore|replace}]

Drop a view.

vgi-client catalog view drop <schema> <view> \
  --catalog <name> --worker <worker> \
  [--ignore-not-found]

Rename a view.

vgi-client catalog view rename <schema> <old_name> <new_name> \
  --catalog <name> --worker <worker>

Set or clear view comment.

vgi-client catalog view comment <schema> <view> \
  --catalog <name> --worker <worker> \
  --set "View description"

Manage transactions for catalogs that support them.

Begin a new transaction.

TX_ID=$(vgi-client catalog transaction begin \
  --attach-opaque-data $ATTACH_ID --worker <worker> | jq -r '.transaction_opaque_data')

Commit a transaction.

vgi-client catalog transaction commit $TX_ID \
  --attach-opaque-data $ATTACH_ID --worker <worker>

Rollback a transaction.

vgi-client catalog transaction rollback $TX_ID \
  --attach-opaque-data $ATTACH_ID --worker <worker>
# Attach to catalog
ATTACH_ID=$(vgi-client catalog attach mydb --worker ./worker.py | jq -r '.attach_opaque_data')

# Begin transaction
TX_ID=$(vgi-client catalog transaction begin \
  --attach-opaque-data $ATTACH_ID --worker ./worker.py | jq -r '.transaction_opaque_data')

# Make changes within transaction
vgi-client catalog table create main users \
  --attach-opaque-data $ATTACH_ID --transaction-opaque-data $TX_ID --worker ./worker.py \
  --columns '[{"name":"id","type":"int64"}]'

# Commit or rollback
vgi-client catalog transaction commit $TX_ID \
  --attach-opaque-data $ATTACH_ID --worker ./worker.py

# Detach
vgi-client catalog detach $ATTACH_ID --worker ./worker.py

Serve any worker by module reference or file path — stdio by default, --http for cloud deployment.

# Stdio (default) — for subprocess/pipe use by vgi-client or DuckDB
vgi-serve my_worker.py
vgi-serve my_app.workers:ProductionWorker

# HTTP — for cloud deployment
vgi-serve my_worker.py --http
vgi-serve my_worker.py --http --host 0.0.0.0 --port 8080

Options:

OptionDescription
–httpServe over HTTP instead of stdin/stdout
–host ADDRHTTP bind address (default: 0.0.0.0)
–port N, -pHTTP port (default: $PORT or 8080)
–prefix PREFIXURL prefix for RPC endpoints
–cors-origins ORIGINSAllowed CORS origins (default: *)
–describe / –no-describeEnable description pages (worker + RPC API)
–max-stream-response-bytes NHTTP-only producer-stream batch packing budget
–quiet, -qSuppress the startup banner (stdio mode)

Logging flags (--debug, --log-level, --log-logger, --log-format) are described under Worker logging below.


All workers that use Worker.main() (including vgi-fixture-worker) and vgi-serve support logging options on the command line. Logs are written to stderr.

OptionDescription
–debugEnable DEBUG level on all vgi and vgi_rpc loggers
–log-level LEVELSet log level: DEBUG, INFO (default), WARNING, ERROR
–log-logger NAMETarget specific logger(s) instead of all defaults (repeatable)
–log-format FORMATStderr format: text (default) or json
–quiet / -qSuppress the interactive-terminal startup warning

--debug overrides --log-level when both are provided.

# Enable debug logging
vgi-fixture-worker --debug

# Set WARNING level only
vgi-fixture-worker --log-level WARNING

# Target a specific logger at DEBUG
vgi-fixture-worker --log-level DEBUG --log-logger vgi.worker

# JSON-formatted logs (for structured log pipelines)
vgi-fixture-worker --log-format json
LoggerDescription
vgiVGI root logger (all VGI messages)
vgi.workerWorker lifecycle (startup, shutdown)
vgi.clientClient operations (spawn, bind, exchange)
vgi.client.cliCLI front-end (argument parsing)
vgi.filter_pushdownFilter pushdown debug (deserialization/evaluation)
vgi_rpcvgi_rpc root logger (all vgi_rpc messages)
vgi_rpc.wire.requestRPC wire request (serialised request bytes)
vgi_rpc.wire.responseRPC wire response (serialised response bytes)
vgi_rpc.wire.transportTransport layer (pipe/HTTP transport debug)
VariableDescription
VGI_QUIET=1Suppress the interactive-terminal startup warning (same as –quiet)
VGI_WORKER_DEBUG=1Enable DEBUG logging on worker and stderr passthrough on client
VGI_FILTER_DEBUG=1Enable filter pushdown debug logging
VGI_BEARER_TOKENSComma-separated token=principal pairs for static bearer auth (HTTP only)
VGI_JWT_ISSUERJWT issuer URL for JWT/JWKS auth (requires vgi[oauth] extra)
VGI_JWT_AUDIENCEJWT audience string, comma-separated for multiple audiences (required when VGI_JWT_ISSUER is set)
VGI_JWT_JWKS_URIJWKS endpoint URL (auto-discovered if omitted)
VGI_OAUTH_RESOURCEOAuth resource URL for RFC 9728 metadata
VGI_OAUTH_AUTH_SERVERSComma-separated authorization server URLs
VGI_OAUTH_CLIENT_IDClient ID for MCP compatibility (optional, URL-safe chars only)
VGI_SIGNING_KEYShared signing key for state tokens (set for multi-process deployments)
VGI_OTEL_ENABLEDEnable OpenTelemetry instrumentation (1/true/yes)
VGI_OTEL_CUSTOM_ATTRIBUTESComma-separated key=value pairs for custom span/metric attributes
VGI_OTEL_CLAIM_ATTRIBUTESComma-separated claim_key=span_attr_name pairs for claim extraction
VGI_OTEL_DISABLE_TRACINGDisable tracing only (1/true/yes)
VGI_OTEL_DISABLE_METRICSDisable metrics only (1/true/yes)

Note: Service name, exporters, and endpoints are configured via standard OTEL_* SDK env vars (e.g. OTEL_SERVICE_NAME, OTEL_EXPORTER_OTLP_ENDPOINT).

OTEL usage examples:

# Enable OTEL with standard SDK configuration
VGI_OTEL_ENABLED=1 \
OTEL_SERVICE_NAME=my-vgi-worker \
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 \
  vgi-serve my_worker.py --http

# With custom attributes and claim extraction
VGI_OTEL_ENABLED=1 \
VGI_OTEL_CUSTOM_ATTRIBUTES="deployment=prod,region=us-east-1" \
VGI_OTEL_CLAIM_ATTRIBUTES="tenant_id=rpc.vgi_rpc.auth.claim.tenant_id" \
  vgi-serve my_worker.py --http

Programmatic usage:

from vgi_rpc.otel import OtelConfig
from vgi.serve import create_app, load_worker_class

app = create_app(
  load_worker_class("my_worker:MyWorker"),
  otel_config=OtelConfig(
      custom_attributes={"deployment": "prod"},
      claim_attributes={"tenant_id": "rpc.vgi_rpc.auth.claim.tenant_id"},
  ),
)

Runs the built-in example worker with demo functions (install with vgi-python[fixtures]).

vgi-fixture-worker

Available functions:

FunctionTypeDescription
echotable-in-outPass through input unchanged
sum_all_columnstable-in-outSum all numeric columns
repeat_inputstable-in-outRepeat each row N times
buffer_inputtable-in-outCollect all input, emit on finalize
sequencetableGenerate sequence of integers
double_sequencetableGenerate sequence of floats
nested_sequencetableGenerate sequence with nested struct/list columns
partitioned_sequencetableGenerate sequence across multiple workers
projected_datatableGenerate data with projection pushdown
ten_thousandtableGenerate 10000 integers
constant_columnstableGenerate rows with constant values from varargs
named_params_echotableEcho named parameter values in output columns
multiplyscalarMultiply values by a constant factor
doublescalarDouble numeric values
add_valuesscalarAdd two columns together
sum_valuesscalarSum multiple numeric values (varargs)
upper_casescalarConvert string values to uppercase
null_handlingscalarReturns value or -5000 if null
random_intscalarGenerate random integers (VOLATILE)
bernoulliscalarGenerate random booleans (VOLATILE)
random_bytesscalarGenerate pseudo-random binary blobs

The mutable catalog demo (vgi/examples/catalog.py) is no longer installed as a console script. Run it from a source checkout via:

python -m vgi._test_fixtures.catalog

Line-delimited JSON, one record per line:

vgi-client --function sequence --args '[3]' --format json
{"n": 0}
{"n": 1}
{"n": 2}

CSV with headers:

vgi-client --function sequence --args '[3]' --format csv
n
0
1
2

Binary Apache Parquet format (requires output file):

vgi-client --function sequence --args '[1000]' --format parquet --output data.parquet

Apache Arrow IPC streaming format, useful for debugging or piping to other Arrow-aware tools:

vgi-client --function sequence --args '[10]' --format arrow-ipc -o out.arrow
vgi-client --function echo --input data.parquet --format arrow-ipc -o -

# Generate data and process it
vgi-client --function sequence --args '[100]' --format parquet --output /tmp/data.parquet
vgi-client --input /tmp/data.parquet --function sum_all_columns
# Extract specific fields
vgi-client catalog attach mydb --worker ./worker.py | jq -r '.attach_opaque_data'

# Pretty print
vgi-client --function sequence --args '[3]' | jq .
#!/bin/bash
WORKER="./my_worker.py"

# Attach
ATTACH_ID=$(vgi-client catalog attach mydb --worker $WORKER | jq -r '.attach_opaque_data')

# List schemas
vgi-client catalog schema list --attach-opaque-data $ATTACH_ID --worker $WORKER

# Cleanup
vgi-client catalog detach $ATTACH_ID --worker $WORKER