Repository navigation
Environment Variables
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. Since 26.0.0 (#4819),excel,jsonlandreadstatfollow it on output too: if you set it only to read semicolon files, they now write semicolons to stdout as well. Pass--delimiter ,to keep commas. -
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→,. -
Piped stdin is copied to a temp
stdin.csvby commands that take several inputs. That copy is read withQSV_DEFAULT_DELIMITER, as stdin is, not with the comma its name implies (27.0.1). Commands that run qsv subprocesses on it, such asdescribegpt,moarstatsandprofile, pass its path down inQSV_STDIN_SPOOL, which qsv sets itself; don't set it by hand.- 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— detect the preamble rows above the header (a title or a "generated on" line) and skip them, so every command reads from the header; it also sniffs the delimiter. (27.0.1: it used to detect the rows and ignore them.)- Covers the Polars-based commands (
sqlp,joinp,pivotp,to parquet, …) and the DuckDB queries ofscoresqlanddescribegpttoo. Not covered: stdin and Polars SQL'sread_csv()table function. - A file with a preamble is never read through its index, and
qsv indexstill indexes the file as stored. - Stats caches and Polars schemas are kept apart for the two modes, so turning the env var on or off never reuses one built the other way. A schema of the rows past an N-line preamble is
<file>.skip<N>.pschema.json.
- Covers the Polars-based commands (
-
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 (25.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; 25.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_DAEMON: when set,viz smartleaves the qsv-clientd bridge script out of the Data Schematic (same as--no-daemon-bridge; 27.0.1, #4848). Theqsv-schematic-sourceprovenance block is still embedded, but without the input fingerprint, which saves a full extra read of the input. See live mode -
QSV_CLIENTD_PORT: the loopback port a schematic's bridge probes for qsv-clientd (default14470; 27.0.1, #4848). It is read at render time, so set it when the daemon listens on a non-default port -
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 (Avro, Arrow, Parquet, JSON, JSONL). Since #4901 (27.0.1) it no longer applies to gz/zlib/zst compressed CSVs, which are decompressed as-is. -
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
qsv — GitHub · Releases · Discussions · crates.io · qsv pro · Try it online · Benchmarks · DeepWiki · DOI · Licensed MIT · Third-party notices · AI Policy
qsv was made possible by datHere: standards-based, best-of-breed, open source solutions to make your Data Useful, Usable & Used.
Edit this page: Contributing to the Wiki
Home · Why qsv? · Tier legend
- Whirlwind Tour · Notebooks · Lessons & Exercises
- Benchmarks · Interactive Benchmarks
- Visualizations Gallery
- Neuro-symbolic, Localizable, Data Schematics
- Feature Flags · Goals/Non-goals · Testing
- Talks: NYC SOD 2022 · csv,conf,v8 · PyCon US 2025 · csv,conf,v9 · NYC SOD 2026
- "Have we achieved ACI?" series: 1 · 2 · 3 · 4
- Sponsor
- All Commands (index)
- Selection & Inspection
- Transform & Reshape
- Aggregation & Statistics
- Joins & Set Ops
- SQL & Polars
- Validation & Schema
- Metadata Profiling (profile)
- Conversion & I/O
- Geospatial
- Visualization (viz)
- HTTP & Web
- Get & Disk Cache
- Scripting (Luau / Python)
- Indexing, Compression & Diff
- AI & Documentation
- Recipes index
- Inspect an Unknown CSV
- Clean & Normalize
- Geographic Enrichment
- Date Enrichment
- CKAN Integration
- DCAT-US v3 for data.gov
- JSON Schema Validation
- Round-Trip SAS / Stata / SPSS
- Build a Data Pipeline
- Stats → Insights
- Data-Quality Signals with moarstats
- Group By
- Fetch & Cache
- Larger-than-RAM CSV
- Diff & Audit
- Multi-table Joins
- Synthesize Fake Data
- Performance Tuning
- Benchmarks
- Tuned csv Fork Benchmarks
- Security & Dependency Audits
- Environment Variables
- Stats Cache & Caching
- Lookup Tables
- MiniJinja Templating