Command Reference - dathere/qsv GitHub Wiki

Command Reference

Tier: Beginner

Every qsv command, grouped by category. This page is the index โ€” each row links to the category page (workflow-level discussion + non-trivial real-world example) and to the canonical per-command help in /docs/help/ (flags, arguments, full examples).

The exact set of commands in your binary depends on the variant and its enabled feature flags โ€” run qsv --list to see what's available.

Note

How to read this table. The category page tells you when to reach for a command and how it composes. The /docs/help/<cmd>.md page tells you exactly which flags exist. Use both. Since 24.0.0 the binary can also print it: qsv <command> --help --format md (help Markdown) or --format json (a JSON tool definition) โ€” see AI & Documentation.

Legend

Commands inherit symbols from the README legend. The most useful ones to know:

  • ๐Ÿ“‡ Faster with an index. Create one with qsv index <file>.
  • ๐Ÿš€ Multithreaded by default (even without an index).
  • ๐ŸŽ๏ธ Multithreaded when an index exists.
  • ๐Ÿปโ€โ„๏ธ Powered/accelerated by Polars.
  • ๐Ÿคฏ Loads entire file into memory (consider streaming alternatives for huge files).
  • ๐Ÿช„ "Automagical" โ€” uses the stats / frequency cache to work smarter.
  • ๐Ÿ“š Supports runtime lookup tables.
  • ๐ŸŒ Has remote / URL options.
  • ๐Ÿ”ฃ Requires UTF-8 input.
  • ๐Ÿ‘† Has the powerful column selector syntax โ€” see select.
  • โœจ Behind a feature flag โ€” see Binary Variants and docs/FEATURES.md.

Selection & Inspection โ€” category page

Daily-driver commands for looking at and slicing a CSV.

Command Symbols One-liner Help
headers ๐Ÿ—„๏ธ Show column names (and union across many files) docs/help
count ๐Ÿ“‡๐Ÿปโ€โ„๏ธ๐ŸŽ๏ธ Row count (instant with an index) docs/help
sample ๐Ÿ“‡๐ŸŽ๏ธ๐ŸŒ Random sample with 10 methods (reservoir, indexed, bernoulli, systematic, stratified, weighted, varopt, mergeable-reservoir, cluster, timeseries); mergeable sketch I/O docs/help
slice ๐Ÿ“‡๐Ÿ—ƒ๏ธ๐ŸŽ๏ธ Slice by row range docs/help
select ๐Ÿ‘† Pick / re-order / drop columns docs/help
search ๐Ÿ“‡๐ŸŽ๏ธ๐Ÿ‘† Filter rows by regex docs/help
searchset ๐Ÿ“‡๐ŸŽ๏ธ๐Ÿ‘† Run many regexes in a single pass (PII scanning) docs/help
flatten Show one record per line (vertical view) docs/help
table ๐Ÿคฏ Elastic-tab table view + leftendtab / Fixed-Width output docs/help
color โœจ๐Ÿคฏ๐Ÿปโ€โ„๏ธ๐Ÿ–ฅ๏ธ Colorized table โ€” type-coded, terminal-fit, light/dark theme auto docs/help
lens โœจ๐Ÿ—ƒ๏ธ๐Ÿปโ€โ„๏ธ๐Ÿ–ฅ๏ธ Interactive viewer (csvlens) โ€” CSV, Parquet, Arrow, JSONL docs/help
clipboard โœจ๐Ÿ–ฅ๏ธ Read from / write to OS clipboard docs/help
sniff ๐Ÿ“‡๐Ÿค–๐ŸŒ Infer delimiter, headers, schema, MIME type โ€” even for remote files docs/help

Transform & Reshape โ€” category page

Clean, rename, sort, reshape โ€” the pre-analysis layer.

Command Symbols One-liner Help
apply โœจ๐Ÿ“‡๐Ÿง ๐Ÿค–๐Ÿš€๐Ÿ”ฃ๐Ÿ‘† String/date/math/currency/NLP transformations docs/help
applydp ๐Ÿ“‡๐Ÿš€๐Ÿ”ฃ๐Ÿ‘† Slim apply for DataPusher+ (qsvdp only) docs/help
behead Drop the header row docs/help
cat ๐Ÿ—„๏ธ Concatenate CSVs by row or column docs/help
datefmt ๐Ÿ“‡๐Ÿš€๐Ÿ‘† Reformat dates (19 input formats recognized) docs/help
denull ๐Ÿ‘† Detect null sentinels (NULL/N/A) that block numeric typing; --apply blanks them per-column docs/help
edit Update a single cell at row ร— column docs/help
enum ๐Ÿ‘† Add a row-number / UUID / constant column docs/help
explode ๐Ÿ”ฃ๐Ÿ‘† Split a multi-valued column into multiple rows docs/help
fill ๐Ÿ‘† Fill missing values (forward, backward, constant) docs/help
fixedwidth Fixed-width text โ†’ CSV; positions auto-detected from a #1,10,15 header comment docs/help
fixlengths Pad or truncate ragged rows docs/help
fmt Reformat delimiters / terminators / quoting docs/help
implode ๐Ÿ˜ฃ๐Ÿ‘† Inverse of explode โ€” collapse rows by key docs/help
input Normalize: encoding, comments, trim, skip preamble docs/help
pseudo ๐Ÿ”ฃ๐Ÿ‘† Pseudonymize a column with incremental IDs docs/help
rename Rename columns docs/help
replace ๐Ÿ“‡๐ŸŽ๏ธ๐Ÿ‘† Regex replace across fields docs/help
reverse ๐Ÿ“‡๐Ÿคฏ Reverse row order (constant memory with index) docs/help
safenames Make column names DB-/CKAN-safe docs/help
sort ๐Ÿคฏ๐Ÿš€๐Ÿ‘† Lex / natural / numeric / unique / random sort docs/help
sortcheck ๐Ÿ‘† Verify sort order; report duplicates and breaks docs/help
transpose ๐Ÿคฏ๐Ÿ‘† Swap rows โ†” columns docs/help

Aggregation & Statistics โ€” category page

Numbers, distributions, dedup, ext-* commands.

Command Symbols One-liner Help
stats ๐Ÿ“‡๐Ÿคฏ๐ŸŽ๏ธ๐Ÿ‘†๐Ÿช„ 48 summary stats + guaranteed type inference docs/help
moarstats ๐Ÿ“‡๐ŸŽ๏ธ +73 more stats (outliers, robust, L-moments, Benford, bivariate) docs/help
frequency ๐Ÿ“‡๐Ÿ˜ฃ๐ŸŽ๏ธ๐Ÿ‘†๐Ÿช„ Frequency distribution per column docs/help
pragmastat ๐Ÿ“‡๐Ÿคฏ๐Ÿช„ Pragmatic stats (date/datetime aware) docs/help
dedup ๐Ÿคฏ๐Ÿš€๐Ÿ‘† Drop duplicate rows (streaming & full) docs/help
extdedup ๐Ÿ‘† On-disk dedup for files > RAM docs/help
extsort ๐Ÿ“‡๐Ÿš€๐Ÿ‘† Multithreaded external merge sort docs/help

Joins & Set Ops โ€” category page

Combine, exclude, partition, split.

Command Symbols One-liner Help
join ๐Ÿ“‡๐Ÿ˜ฃ๐Ÿ‘† In-memory inner/outer/cross/anti/semi joins docs/help
joinp โœจ๐Ÿปโ€โ„๏ธ๐Ÿš€๐Ÿช„ Polars-powered: non-equi, asof, larger-than-RAM docs/help
exclude ๐Ÿ“‡๐Ÿ‘† Remove rows of one CSV from another docs/help
partition ๐Ÿ‘† Split into one file per value of a column docs/help
split ๐Ÿ“‡๐ŸŽ๏ธ Split by rows / chunks / size (multithreaded with index) docs/help

SQL & Polars โ€” category page

Polars LazyFrame, SQL, pivots, score-before-run.

Command Symbols One-liner Help
sqlp โœจ๐Ÿ“‡๐Ÿ—„๏ธ๐Ÿปโ€โ„๏ธ๐Ÿš€๐Ÿช„ Polars SQL across CSVs/Parquet/JSONL/Arrow docs/help
joinp โœจ๐Ÿปโ€โ„๏ธ๐Ÿš€๐Ÿช„ Polars joins (see Joins category) docs/help
pivotp โœจ๐Ÿปโ€โ„๏ธ๐Ÿš€๐Ÿช„ Pivot with smart aggregation auto-selection docs/help
scoresql โœจ๐Ÿปโ€โ„๏ธ๐Ÿช„ Score a SQL query BEFORE running it (Polars / DuckDB modes) docs/help

Validation & Schema โ€” category page

Infer, validate, sniff.

Command Symbols One-liner Help
validate ๐Ÿ“‡๐Ÿ—„๏ธ๐Ÿš€๐ŸŒ๐Ÿ“š JSON Schema 2020-12 validation (up to 780k rows/sec) docs/help
schema ๐Ÿ“‡๐Ÿ˜ฃ๐Ÿปโ€โ„๏ธ๐ŸŽ๏ธ๐Ÿ‘†๐Ÿช„ Infer JSON Schema 2020-12 or Polars schema docs/help
profile โœจ๐Ÿ“‡๐Ÿง ๐Ÿค–๐Ÿช„๐ŸŒ๐Ÿ“šโ›ฉ๏ธ Profile a CSV โ†’ DCAT-US v3 / DCAT-AP v3 / Croissant / Geoconnex / CKAN metadata (FAIRification) docs/help
sniff ๐Ÿ“‡๐Ÿค–๐ŸŒ Quick metadata inference (see Selection category) docs/help

Conversion & I/O โ€” category page

Move between formats: Parquet, Excel, ODS, SAS/Stata/SPSS, JSON, JSONL, SQLite, Postgres, GeoJSON, Snappy.

Command Symbols One-liner Help
excel ๐Ÿš€ Export Excel/ODS sheets to CSV docs/help
readstat โœจ๐Ÿคฏ๐Ÿปโ€โ„๏ธ๐Ÿš€ SAS/Stata/SPSS โ†’ CSV โ€” codes by default, --value-labels to decode, --metadata to dump the variable metadata, --dictionary to write a JSON Schema data dictionary (24.0.0); streams except SPSS portable .por, which is read whole (new in 23.0.1) docs/help
writestat โœจ๐Ÿคฏ๐Ÿปโ€โ„๏ธ CSV โ†’ SPSS (.sav/.por), Stata (.dta) or SAS transport (.xpt); with a readstat --dictionary, restores labels & missing values (new in 24.0.0) docs/help
to โœจ๐Ÿ—„๏ธ๐Ÿปโ€โ„๏ธ๐Ÿš€ CSV โ†’ Parquet, SQLite, Postgres, Excel, ODS, Data Package docs/help
json ๐Ÿ‘† JSON array โ†’ CSV docs/help
jsonl ๐Ÿš€๐Ÿ”ฃ JSONL โ†’ CSV docs/help
tojsonl ๐Ÿ“‡๐Ÿ˜ฃ๐Ÿ—ƒ๏ธ๐Ÿš€๐Ÿ”ฃ๐Ÿช„ CSV โ†’ JSONL with smart type inference docs/help
snappy ๐Ÿš€๐ŸŒ Streaming Snappy compress/decompress docs/help
geoconvert โœจ๐ŸŒŽ Spatial formats โ†” CSV (GeoJSON, SHP, SVGโ€ฆ) docs/help
prompt โœจ๐Ÿปโ€โ„๏ธ๐Ÿ–ฅ๏ธ OS file-picker dialog docs/help
clipboard โœจ๐Ÿ–ฅ๏ธ OS clipboard I/O (see Selection category) docs/help

Geospatial โ€” category page

Command Symbols One-liner Help
geocode โœจ๐Ÿ“‡๐Ÿง ๐Ÿš€๐ŸŒ๐Ÿ”ฃ๐Ÿ‘†๐ŸŒŽ Forward / reverse geocode โ€” offline (Geonames + Maxmind), 360k/sec, or online via the OpenCage API docs/help
geoconvert โœจ๐ŸŒŽ Spatial format conversions docs/help

Visualization โ€” category page

Command Symbols One-liner Help
viz โœจ๐Ÿช„๐Ÿ‘† Interactive Plotly charts (bar/line/scatter/scatter3d/histogram/box/violin/pie/heatmap/contour/candlestick/ohlc/sankey/ radar/treemap/sunburst/icicle/splom/parcats/funnel/map/geo/choropleth) + a smart auto-dashboard that produces a Data Schematic docs/help

HTTP & Web โ€” category page

Command Symbols One-liner Help
get โœจ๐ŸŒ Fetch local/URL/CKAN/cloud data into a managed disk cache (delimiter sniffing, glob batch fetch, --sample preview); read back via the dc: prefix docs/help
fetch โœจ๐Ÿ“‡๐Ÿง ๐ŸŒ HTTP GET per row, HTTP/2 flow control, jaq, Redis/disk cache docs/help
fetchpost โœจ๐Ÿ“‡๐Ÿง ๐ŸŒโ›ฉ๏ธ HTTP POST per row, MiniJinja body templating docs/help

Scripting (Luau / Python) โ€” category page

Command Symbols One-liner Help
luau โœจ๐Ÿ“‡๐ŸŒ๐Ÿ”ฃ๐Ÿ“š Luau 0.720 DSL: BEGIN/MAIN/END, lookup tables, random access docs/help
py โœจ๐Ÿ“‡๐Ÿ”ฃ Python expression per row (requires Python 3.10+) docs/help
foreach โœจ Run a shell command per row docs/help
template ๐Ÿ“‡๐Ÿš€๐Ÿ”ฃ๐Ÿ“šโ›ฉ๏ธ MiniJinja-render CSV rows into any text format docs/help

Indexing, Compression & Diff โ€” category page

Performance primitives.

Command Symbols One-liner Help
index Build an index for instant random access docs/help
clean Remove qsv-generated cache files (index/stats/frequency; --stale, --dry-run default) docs/help
diff ๐Ÿš€ Diff two CSVs (1M ร— 9 in <600 ms); --drop-equal-columns to focus on what changed docs/help
blake3 ๐Ÿš€ BLAKE3 hash for cache keys / pipeline gating docs/help
extsort ๐Ÿ“‡๐Ÿš€๐Ÿ‘† External merge sort (see Aggregation category) docs/help
extdedup ๐Ÿ‘† On-disk dedup (see Aggregation category) docs/help
snappy ๐Ÿš€๐ŸŒ Streaming Snappy compression (see Conversion category) docs/help

AI & Documentation โ€” category page

Command Symbols One-liner Help
describegpt ๐Ÿ“‡๐Ÿ—ƒ๏ธ๐Ÿค–๐ŸŒ๐Ÿช„๐Ÿ“šโ›ฉ๏ธ Neuro-symbolic data dictionary + SQL RAG via any OpenAI-compatible LLM; Markdown/JSON/TOON/JSONSchema/SemanticMd output docs/help
synthesize โœจ๐Ÿ“‡๐Ÿค–๐Ÿช„ Generate a statistically-faithful synthetic CSV from a source CSV (20.1.0+) docs/help

Integrations & Bridges โ€” category page

Command Symbols One-liner Help
pro Bridge to the qsv pro desktop API docs/help

Built-in

Command One-liner
help Show qsv's top-level usage (run qsv help or qsv --help)

See also

โš ๏ธ **GitHub.com Fallback** โš ๏ธ