Environment Variables - dathere/qsv GitHub Wiki
Tier: Advanced
Note
Canonical reference: docs/ENVIRONMENT_VARIABLES.md. 85+ variables total β this page groups them by purpose and links the canonical reference for definitions.
Run qsv --envlist to see all active qsv-relevant env vars in your environment.
qsv also supports .env files. See docs/ENVIRONMENT_VARIABLES.md#env-file-support for the lookup order.
| Variable | What it does |
|---|---|
QSV_AUTOINDEX_SIZE |
Auto-create .idx for files > N bytes (and auto-refresh stale ones) |
QSV_STATSCACHE_MODE |
auto (default), force (auto-create cache), or none
|
QSV_MAX_JOBS |
Cap the number of parallel jobs |
QSV_LLM_BASE_URL, QSV_LLM_APIKEY, QSV_LLM_MODEL
|
describegpt LLM config |
QSV_DEFAULT_DELIMITER |
Fallback delimiter for stdin, unrecognized extensions, and output |
QSV_SNIFF_DELIMITER |
Auto-detect the input delimiter |
QSV_LOG_LEVEL, QSV_LOG_DIR
|
Logging |
-
QSV_DEFAULT_DELIMITERβ the delimiter used when neither--delimiternor a.csv/.tsv/.tab/.ssvextension sets one: stdin, other extensions, and output written to stdout. Default,. It does not override--delimiteror a recognized extension. -
QSV_SNIFF_DELIMITERβ auto-detect the input delimiter; takes precedence over extensions andQSV_DEFAULT_DELIMITER, but not over--delimiter. - Precedence, highest first:
--delimiterβQSV_SNIFF_DELIMITERβ file extension βQSV_DEFAULT_DELIMITERβ,.- Exception:
joinp,sqlp,scoresqlandreadstatalways use tab for a.tsv/.tabpath and semicolon for an.ssvpath, whether reading it or writing it with--output, even when--delimiteris given.
- Exception:
-
QSV_SNIFF_PREAMBLEβ auto-detect preamble line count -
QSV_NO_HEADERSβ treat the first row as data, not headers -
QSV_TOGGLE_HEADERSβ invert header behavior -
QSV_COMMENT_CHARβ skip lines starting with this character -
QSV_OUTPUT_BOMβ add a UTF-8 BOM to outputs (Excel-friendly on Windows) -
QSV_RDR_BUFFER_CAPACITYβ reader buffer size (default 128 KB) -
QSV_WTR_BUFFER_CAPACITYβ writer buffer size (default 512 KB) -
QSV_SKIP_FORMAT_CHECKβ skip MIME-type inference for inputs
-
QSV_AUTOINDEX_SIZEβ auto-create / refresh index for files > N bytes -
QSV_MAX_JOBSβ max parallel jobs (default: all logical CPUs) -
QSV_MEMORY_CHECKβ enable pre-check that the file fits before running memory-mode commands -
QSV_FREEMEMORY_HEADROOM_PCTβ reserve N% of free RAM (default 20) -
QSV_STATS_CHUNK_MEMORY_MBβ per-chunk memory limit instats -
QSV_FREQ_CHUNK_MEMORY_MBβ per-chunk memory limit infrequency -
QSV_FREQ_HIGH_CARD_THRESHOLDβ absolute cardinality threshold for HIGH_CARDINALITY classification -
QSV_FREQ_HIGH_CARD_PCTβ percentage-of-rowcount cardinality threshold -
QSV_NO_ALLOC_TUNINGβ disable qsv's automatic jemalloc tuning (jemalloc builds only). By default qsv enables jemallocbackground_threadpurging where supported (Linux) at no extra memory cost, and on platforms without it (e.g. macOS) retains freed pages more aggressively
See Performance Tuning for how these interact.
-
QSV_STATSCACHE_MODEβauto/force/none -
QSV_CACHE_DIRβ directory for qsv's persistent caches (default~/.qsv-cache). It holds:- lookup tables downloaded by
luau(qsv_register_lookup),templateandvalidate -
geocode's Geonames index, and its OpenCage and Geoclient result caches -
get's download cache -
describegpt's tag vocabularies (its LLM completion cache is set separately by--disk-cache-dir, default~/.qsv-cache/describegpt) -
viz's Census boundary and population caches
It takes precedence over the
--cache-diroption ofdescribegpt,geocode,get,luau,templateandvalidate. - lookup tables downloaded by
-
QSV_GET_PART_SIZEβgetbyte-range part size for parallel downloads (default 8 MiB) -
QSV_GET_CONCURRENCYβgetparallel range-download workers (default 4, clamped 1β64) -
QSV_DISKCACHE_TTL_SECSβfetch/fetchpost/describegptdisk-cache TTL (default 28 days) -
QSV_DISKCACHE_TTL_REFRESHβ extend TTL on cache hit -
QSV_REDIS_CONNSTRβ Redis connection string forfetchcache (defaultredis://127.0.0.1:6379/1) -
QSV_FP_REDIS_CONNSTRβ Redis connection forfetchpostcache (default db2) -
QSV_DG_REDIS_CONNSTRβ Redis connection fordescribegptcache (default db3) -
QSV_REDIS_MAX_POOL_SIZEβ Redis connection pool size -
QSV_REDIS_TTL_SECSβ Redis cache TTL -
QSV_REDIS_TTL_REFRESHβ extend Redis TTL on cache hit
See Stats Cache & Caching and HTTP & Web.
-
QSV_LLM_BASE_URLβ OpenAI-compatible LLM endpoint fordescribegpt -
QSV_LLM_APIKEYβ API key for the LLM -
QSV_LLM_MODELβ model name (e.g.openai/gpt-oss-20b,google/gemma-4-31b) -
QSV_DUCKDB_PATHβ DuckDB binary path (enables DuckDB SQL indescribegpt&scoresql) -
QSV_TEST_DESCRIBEGPTβ enable describegpt tests (requires LM Studio withopenai/gpt-oss-20b)
See AI & Documentation.
-
QSV_TIMEOUTβ timeout in seconds forfetch,fetchpost,geocode,sniff,validate,describegpt,template,sample,snappy,luau(default 30).vizhas no--timeoutoption but honors this variable for its Census requests.applyandgethave their own--timeoutbut do not read this variable. -
QSV_USER_AGENTβ custom User-Agent header (supports$QSV_VERSION,$QSV_TARGET,$QSV_BIN_NAME,$QSV_COMMANDplaceholders) -
QSV_CKAN_APIβ CKAN action API endpoint forckan://URL scheme -
QSV_CKAN_TOKENβ CKAN access token (only required for private resources) - Plus standard
HTTP_PROXY,HTTPS_PROXY,ALL_PROXY,NO_PROXY. OS-level proxy configuration (macOS SystemConfiguration, Windows registry) is honored as well β in 23.0.1 and earlier by the fullqsvbinary only; New in 24.0.0: also byqsvlite,qsvdpandqsvmcp, which additionally decode responses by theirContent-Typecharset instead of lossy UTF-8
-
QSV_GEOIP2_FILENAMEβ MaxMind GeoLite2 binary database filename (defaultGeoLite2-City.mmdb) -
QSV_GEOCODE_INDEX_FILENAMEβ custom Geonames index file -
QSV_OPENCAGE_API_KEYβ API key for thegeocode opencage/opencagenowonline geocoding subcommands (the--api-keyflag, if given, takes precedence) -
QSV_GEOCLIENT_API_KEYβ NYC Geoclient subscription key for thegeocode geoclient/geoclientnowsubcommands (Unreleased, after 24.0.0, #4789). Get one free at https://api-portal.nyc.gov by subscribing to "Geoclient V2 User".--api-keytakes precedence. qsv sends it as a request header, never in the URL. Not needed for a self-hosted Geoclient. -
QSV_GEOCLIENT_API_URLβ base URL of a self-hosted Geoclient, e.g.http://localhost:8080/geoclient/v2; no key is needed then (defaulthttps://api.nyc.gov/geoclient/v2; Unreleased, after 24.0.0)
See Geospatial.
All require the viz feature (bundled in the prebuilt qsv/qsvpy binaries and any all_features build).
-
QSV_VIZ_MAX_POINTSβ max data pointsviz smartembeds per panel before uniform downsampling (default150000) -
QSV_VIZ_CDNβ load the plotly.js runtime from its CDN (pinned to the embedded version) instead of inlining it; shrinks asmartdashboard by ~1.9 MB but requires network access when the page is viewed β intended for web-published charts. Governs only the plotly.js bundle; figure payloads still followQSV_VIZ_NO_COMPRESS -
QSV_VIZ_NO_COMPRESSβ emit fully plain-text HTML (inline plotly.js and figures, decimal map arrays) instead of the default gzip+base64 payloads; larger output, but works on pre-2023 browsers and strict-CSP embeds and is greppable -
QSV_VIZ_DICT_FRESHβ set to1to forceviz smart --dictionary inferto re-run the LLM: ignores an existing<stem>.schema.jsonsidecar and bypasses describegpt's completion cache, overwriting the sidecar on success. Without it, an existing sidecar is reused as-is (no LLM call) β which is what makes hand-tuning a dictionary stick -
QSV_CENSUS_API_KEYβ US Census Data API key, required byviz choropleth --denominator census(and theviz smartrate panel it drives) to fetch ACS population denominators. The Bureau redirects unkeyed requests to a "Missing Key" page rather than refusing them, so qsv asks for the key up front. Request a free one -
QSV_VIZ_BOUNDARY_CACHE_TTL_DAYSβ days a boundary set fetched byviz --geojson auto(Census TIGERweb polygons) stays fresh in the cache before re-fetching; within the TTL a repeated command makes no network request at all (default30) -
QSV_VIZ_DENOMINATOR_CACHE_TTL_DAYSβ days a population denominator fetched byviz --denominator censusstays fresh in the cache (default30) -
QSV_GEOJSON_SHORTCUTSβ a JSON map of shortcut name β{path, id}soviz --geojson <name>resolves by name instead of a full path/URL; the shortcut'sidsets--feature-id-keywhen you don't pass one. Used for region maps and point-in-polygon binning
These two are not QSV_* variables and do not appear in qsv --envlist β they are read
directly by plotly_static, which backs viz static
image export. They only matter when writing a chart to PNG/SVG/PDF/JPEG/WebP.
-
WEBDRIVER_PATHβ full path to thechromedriverto render with. On 23.0.1 and earlier, you had to set it yourself whenever static export couldn't find a driver. New in 24.0.0: when unset, or not pointing at an executable file, qsv probes$WEBDRIVER_INSTALL_PATH,~/.local/bin, yourPATH, then (Unix only)/opt/homebrew/bin,/usr/local/binand/usr/bin, and sets the variable to the firstchromedriverit finds β which is what repairs prebuilt binaries, whose baked-in path points into the build machine's home directory (#4620). Firefox/geckodriveris not supported. The driver's MAJOR version must match your Chrome -
BROWSER_PATHβ full path to a Chrome/Chromium binary, when it isn't the system default
See Visualization.
-
QSV_STATS_STRING_MAX_LENGTHβ truncate long min/max string values -
QSV_STATS_SEPARATORβ separator for multi-value MODE/ANTIMODE/PERCENTILE cells (default|) -
QSV_ANTIMODES_LENβ max characters when listing antimodes (default 100)
-
QSV_PREFER_DMYβ parse dates as DMY instead of MDY (affectsdatefmt,frequency,joinp,moarstats,pivotp,sample,schema,sniff,stats,tojsonl)
-
QSV_REGEX_UNICODEβ makesearch/searchset/replaceunicode-aware (slower; default off)
-
QSV_FORCE_COLORβ force color output even in CI / pipes -
QSV_THEMEβDARKorLIGHT(overrides terminal-bg detection) -
QSV_TERMWIDTHβ override detected terminal width
See Selection & Inspection β color.
-
QSV_LOG_LEVELβerror/warn/info/trace/debug(defaultoff;qsvmcpdefaults toinfo) -
QSV_LOG_DIRβ log file directory (auto-created if missing) -
QSV_LOG_UNBUFFEREDβ write log lines synchronously -
QSV_PROGRESSBARβ enable--progressbaron commands that support it -
QSV_NO_UPDATEβ disableqsv --updateself-update version check -
QSV_ERROR_FORMATβ set tojsonto end a failed run with one JSON line on stderr ({"error":{"kind","level","message","exit_code","command","qsv_version"}}) instead of free text; ano_matchexit also gets a line. For programs driving qsv as a subprocess; qsv-client sets it for you (25.0.0)
See docs/Logging.md.
Polars commands respect Polars's own env vars:
-
POLARS_VERBOSEβ verbose logging to stderr -
POLARS_PANIC_ON_ERRβ panic on Polars errors -
POLARS_BACKTRACE_IN_ERRβ include backtrace in Polars errors -
QSV_POLARS_FLOAT_PRECISIONβ float precision for Polars β CSV conversion -
QSV_POLARS_DECIMAL_SCALEβ Polars Decimal scale (default 5)
The MCP server has its own dedicated environment variable namespace β see MCP Server and the canonical reference's MCP section.
Key ones:
-
QSV_MCP_BIN_PATHβ full path to qsv/qsvmcp binary -
QSV_MCP_WORKING_DIRβ default working directory (supports${HOME},${DOWNLOADS},${DOCUMENTS}, β¦) -
QSV_MCP_ALLOWED_DIRSβ additional accessible directories (colon-separated on Unix) -
QSV_MCP_OPERATION_TIMEOUT_MSβ operation timeout (default 600,000 = 10 min) -
QSV_MCP_MAX_OUTPUT_SIZEβ max bytes before output is saved to disk (default 50 MB) -
QSV_MCP_MAX_CONCURRENT_OPERATIONSβ concurrency cap (default 3 in plugin mode, 1 in extension mode) -
QSV_MCP_LOG_LEVELβinfo/error/off(separate fromQSV_LOG_LEVEL) -
QSV_MCP_USE_DUCKDBβ enable DuckDB SQL when available -
QSV_MCP_OUTPUT_FORMATβtsv(default) orcsv -
QSV_MCP_ENABLE_APPSβ enable MCP Apps UI features such as theqsv_browse_directoryinteractive browser (defaulttrue) -
QSV_MCP_SANITIZE_ERRORSβ strip absolute paths (usernames, directory layout) from command and error output before returning it to the client (defaulttrue). Setfalseonly for local debugging β sanitization is what protects hosted/shared deployments -
QSV_MCP_EXPOSE_ALL_TOOLSβ expose all tools at startup instead of deferred loading (core tools only). For AI clients that don't support deferred tool loading (default: auto-detect) -
QSV_MCP_SERVER_INSTRUCTIONSβ custom server instructions that override the built-in workflow guidance (default: empty = built-in) -
QSV_MCP_MAX_EXAMPLESβ max examples included in tool descriptions,0β20(default 5;0disables) -
QSV_MCP_MAX_FILES_PER_LISTINGβ max files returned in one directory listing (default 1,000) -
QSV_MCP_CONVERTED_LIFO_SIZE_GBβ size cap for the converted-file cache (ExcelβCSV, JSONLβCSV) in GB, LIFO eviction (default 1.0) -
QSV_MCP_DUCKDB_BIN_PATHβ full path to the DuckDB binary (default: auto-detect fromPATH) -
QSV_MCP_NOTIFY_UPDATESβ log update notifications when a new version is available (defaulttrue) -
QSV_MCP_AUTO_REGENERATE_SKILLSβ runqsv --update-mcp-skillsautomatically when the qsv version changes (defaultfalse) -
QSV_MCP_GITHUB_REPOβ repository used for update checks (defaultdathere/qsv) -
QSV_MCP_CHECK_UPDATES_ON_STARTUPβ check GitHub for a newer qsv release at startup (defaulttrue) -
QSV_MCP_CONCURRENCY_WAIT_TIMEOUT_MSβ how long a request waits for a free concurrency slot before being rejected;0rejects immediately (default 120,000 = 2 min) -
QSV_MCP_PLUGIN_MODEβ override plugin-mode detection; settruefor non-Claude agent CLIs (e.g. Gemini CLI) whose host already provides filesystem isolation (default: auto-detect) -
MCPB_EXTENSION_MODEβ set automatically by Claude Desktop when qsv runs as an extension; enables stricter validation (fully qualified qsv path, version β₯ 17.0.0). Don't set it yourself
-
QSV_NO_COWORK_SETUPβ set to1to stop the Cowork plugin from auto-deploying its workflow-guidanceCLAUDE.md. Set it in your shell before launching Claude Code
qsv loads .env files in this order:
- The file at
QSV_DOTENV_PATHif set (overrides everything; set to<NONE>to disable) -
.envin the current working directory -
<binary-name>.envnext to the qsv binary itself (e.g./usr/local/bin/qsv.env)
Set QSV_DOTENV_PATH=<NONE> to disable dotenv processing entirely.
Some env vars come from qsv's dependencies, not qsv itself:
-
mimallocβ see microsoft/mimalloc env options -
jemallocβ see jemalloc env options -
reqwestproxies βHTTP_PROXY,HTTPS_PROXY,ALL_PROXY,NO_PROXY
qsv --envlist
# Lists every QSV_* variable currently set in your environment,
# plus allocator-specific (MIMALLOC_*/JEMALLOC_*) and proxy vars.qsv --capabilities
# JSON: binary name, version, target, features (with Polars/Luau/Python versions)
# and installed commands. Also in qsvlite and qsvdp (25.0.0).-
docs/ENVIRONMENT_VARIABLES.mdβ canonical reference (source of truth) - Performance Tuning β when to set each performance var
- Stats Cache & Caching
- HTTP & Web
- AI & Documentation
- Geospatial
- MCP Server β MCP-specific env vars
docs/Logging.md