Skip to main content

Global Flags

Global flags specify runtime program behavior for the StackQL application, these flags are set at the command line when the StackQL application is launched (in either the interactive/shell mode or non-interactive exec mode) or are sourced from the StackQL initialization (.stackqlrc) file. Flags include:

FlagData TypeDescriptionDefault
--access.configstringCaller access configuration, a JSON envelope {"path": "/path/to/access.json"} (a bare file path is also accepted). Enables access management: callers are authenticated by JWT, static bearer token, mutual TLS or local OS identity and statements are authorised against policy rules. Local token credentials are read from STACKQL_CALLER_TOKEN. Available in StackQL releases from v1.0.
--acidstringJSON / YAML string representing ACID config{}
--allow-persistent-secretsflagAllow a session to select a persistent OS secret store (macOS Keychain, Linux Secret Service or Windows Credential Manager) with SET "$.secret_store". Flat-file stores are refused even with the flag. See Provider Sessions and Secrets. Available in StackQL releases from v1.0.false
--allow-secret-dereferenceflagAllow secret and credential values to be dereferenced in SQL expressions ("$secrets.name", "$auth.provider.field"), with the consequence that they can enter results, logs and persisted query artefacts. Not needed for normal provider authentication. See Secret values in SQL. Available in StackQL releases from v1.0.false
--apirequesttimeoutintegerAPI request timeout in seconds, 0 for no timeout45
--approotstringApplication config and cache root path{cwd}/.stackql
--approotfilemodeuint32Application config and cache file mode493
--authstringauth context keyvals in json form
--cachekeycountintegerCache initial key count100
--configfilestringConfig file full path{cwd}/.stackqlrc
--cpuprofilestringcpuprofile file, none if emptynull
--dataflow.dependency.maxintMaximum dataflow dependency depth for a given query50
--dataflow.components.maxintMaximum dataflow weakly connected components for a given query50
--dbInternalstringJSON / YAML string to configure DBMS housekeeping query handling{}
-d, --delimiterstringDelimiter for csv output. Single char only.  Ignored for all non-csv output,
--dryrunflagdryrun flag; run preprocessor only, templated output will be returnedfalse
--env.filestringOptional dotenv-style file sourced into the process environment at startup (all commands); the MCP reload_credentials tool re-sources it on demand. A missing file is tolerated; keys with empty values are skipped; existing variables are overwritten. Not sourced from .stackqlrc. Available in StackQL releases after v0.10.542.null
--execution.concurrency.limitintConcurrency limit for query execution1
--export.aliasstringExport alias prefix (namespace or schema)
--gcstringJSON / YAML string representing GC config{}
-H, --hideheadersflagDisables column headers, valid only with --output csv or --output textfalse
--http.log.enabledflagDisplay http request info in terminalfalse
--http.proxy.hoststringProxy host (leave blank for no proxy)null
--http.proxy.passwordstringProxy passwordnull
--http.proxy.portintegerProxy port, any number less than or equal to 0 will result in the default port for a given scheme (e.g. http -> 80)-1
--http.proxy.schemestringProxy scheme, http or httpshttp
--http.proxy.userstringProxy usernull
--http.response.maxResultsintegerMaximum results per http request, any number less than or equal to 0 results in no limitation-1
--http.response.pageLimitintegerMaximum pages of results that will be returned per resource, any number less than or equal to results in no limitation20
--indirect.depth.maxintegerMaximum depth for indirect queries: views and subqueries5
-i, --infilestringInput file (IQL file) from which queries are read{stdin}
-q, --iqldatastringContext (data) file for templating (json or jsonnet file)
--loglevelstringLog level, must be one of fatalfatal
--mcp.configstringJSON / YAML configuration object for the MCP server (stackql mcp and stackql srv){}
--mcp.log.formatstringMCP audit log encoding, jsonl or otel (OTLP/JSON log records); overrides server.audit.format in --mcp.config. See Log format. Available in StackQL releases from v0.11.660.jsonl
--mcp.protocol.versionstringNewest MCP protocol revision advertised, auto, 2026-07-28 (sessionless only) or an older revision such as 2025-11-25; overrides server.protocol_version in --mcp.config. See Pinning the revision. Available in StackQL releases from v0.12.732.auto
--mcp.server.typestringMCP server type, one of reverse_proxy. See MCP server type.http
--metadatattlintegerTTL for cached metadata documents, in seconds3600
--namespacesstringJSON / YAML string representing namespaces for caching, views etc{}
--offlineflagWork offline, using cached datafalse
-f, --outfilestringOutput file into which results are written{stdout}
-o, --outputstringOutput format, must be one of otel (ndjson is accepted as an alias for jsonl). otel emits OpenTelemetry log records, see Output Modes; available in StackQL releases from v0.11.660. With an exporter configured in --otel.config, otel records are also pushed to that endpointtable
--otel.configstringJSON / YAML string configuring the otel output format; exporter.endpoint, exporter.headers, exporter.timeout_ms and exporter.batch_size push the records to an OTLP/HTTP logs endpoint, see Pushing to an OTLP endpoint. Available in StackQL releases from v0.12.732{}
--previewstringJSON string enabling preview functionality. {"unstable": true} exposes the document-driven stackql_unstable_<provider>.<service>.<resource> relations, which are resolved and run by omnisdk straight from the provider documents with rows streamed as they are produced; the remaining keys (batchSize, flushInterval, endpoint, insecureSkipTLSVerify) tune that backend. Preview functionality is not stable: behaviour, syntax and output may change or break between releases without notice, so do not rely on it in production. From v1.0 the same opt-in exposes the stackql_preview.iac.run and stackql_preview.iac.destroy relations, which apply and tear down a declared resource set through omnisdk with state kept under the application root. See Preview functionality{}
--querycachesizeintegerSize in number of entries of LRU cache for query plans10000
--registrystringJSON / YAML string configuring the provider registry location and provider document signature verificationsee --registry
--sessionstringJSON / YAML string representing session config{}
--sqlBackendstringJSON / YAML string representing SQL Backend System Configsee --sqlBackend
--store.txnstringJSON / YAML string representing Txn store config{}
--tls.CABundlestringPath to CA bundle, if not specified then system defaults used
--tls.allowInsecureflagAllow trust of insecure certificates (not recommended)
--varstringExternal variables provided as key/value pairs for sourcing into StackQL queries through jsonnet data files
-v, --verboseflagVerbose outputfalse
-h, --helpContext specific help for stackql
--versionDisplays the version of the StackQL program

--registry​

The --registry flag configures where provider documents are read from and whether their signatures are verified. The value is a JSON string with the following keys:

KeyDescriptionDefault
urlRegistry URL. The public StackQL provider registry is used when omitted.public registry
localDocRootA local directory holding provider documents, read in place of downloading from the registry. Used when developing a provider.
srcPrefixPath prefix under the registry root where provider source documents live.src
verifyConfig.nopVerifytrue skips signature verification. Set to false to require an embedded ML-DSA-65 (FIPS 204) signature on every provider and service document read, including the document-backed preview relations.true
verifyConfig.publicKeysA JSON object mapping key IDs to hex-encoded ML-DSA-65 public keys, for private registries. It replaces the embedded production keys; an explicit empty object is an error.embedded keys

Example: Require signed provider documents​

Turns verification on for every provider and service document read from the public registry, checked against the embedded production keys:

stackql --registry '{"verifyConfig": {"nopVerify": false}}' shell

Example: Read unsigned documents from a local directory​

Points the registry at a directory of provider documents under development. Those documents are unsigned, so verification stays off:

stackql --registry '{"localDocRoot": "/path/to/provider-dev/openapi", "verifyConfig": {"nopVerify": true}}' shell
note

Signature verification is available in StackQL releases from v1.0 and is off by default. Signatures cover the exact YAML bytes of a document, so any edit, including a formatting or newline change, invalidates them; re-sign with the registry's pqsig sign-doc tool. Unsigned local development documents must keep nopVerify: true. The former certificate options and .sig sidecar files are no longer used, and archives published with sidecars only must be republished before verified use. Verification authenticates documents when they are read; archive download and extraction are not covered.

--sqlBackend​

The --sqlBackend flag configures an external SQL backend for StackQL, allowing you to use an external database engine (such as PostgreSQL) instead of the default embedded SQL engine. This is useful for leveraging an external database for query processing, persistent storage, or integration with existing database infrastructure.

The value is a JSON string with the following keys:

KeyDescriptionExample Values
dbEngineThe database engine typepostgres_tcp
sqlDialectThe SQL dialect to usepostgres
dsnThe data source name (connection string) for the databaseSee examples below

Example: Using a PostgreSQL Backend​

./stackql \
--sqlBackend='{"dbEngine": "postgres_tcp", "sqlDialect": "postgres", "dsn": "postgres://user:password@hostname:port/dbname?sslmode=require"}' \
shell

Example: Using Databricks PostgreSQL Interface​

Databricks exposes a PostgreSQL-compatible interface that can be used as a StackQL SQL backend. The DSN uses the standard PostgreSQL connection string format with your Databricks credentials:

./stackql \
--sqlBackend='{"dbEngine": "postgres_tcp", "sqlDialect": "postgres", "dsn": "postgres://user%40domain.com:your-access-token@your-databricks-host.cloud.databricks.com/databricks_postgres?sslmode=require"}' \
shell

note

Special characters in the username or password (such as @) must be URL-encoded in the DSN (e.g., @ becomes %40).