# CLI: tabalyst insights > Every option of tabalyst insights, the files it writes for CSV, JSON, JSONL and Excel files, and how it runs the second pass. Source: https://docs.tabalyst.com/reference/cli/insights/ (Tabalyst 0.8.3) ```console tabalyst insights INPUT... [OPTIONS] ``` Analyzes CSV, JSON, JSONL or Excel (`.xlsx`, `.xlsm`) files and writes, for each one, the pages of [Tabalyst Insights](https://docs.tabalyst.com/insights.md): a main page with the table of every column, a page for each column and the JSON profile, plus an `executions.json` history in the same folder. The sources are never modified. Insights always runs the [second pass](https://docs.tabalyst.com/scan/deep.md), as `tabalyst report --deep` does: it asks first when it is costly. See [Second pass](#second-pass). ## Output files | Source | Main page | Profile | Column pages | | --- | --- | --- | --- | | `data.csv`, `data.json`, `data.xlsx` | `data.insights.html` | `data.insights.json` | `data.insights/col-01-.html` | | With `--all-collections`: `shop.xlsx` | `shop..insights.html` | `shop..insights.json` | `shop..insights/` | | With `-o out.html` | `out.html` | `out.json` | `out/` | The files go beside the source, or in the folder of `-d`. They never replace the files of [`tabalyst report`](https://docs.tabalyst.com/reference/cli/report.md), so both commands can write beside the same source. With `--force`, the pages of columns the source no longer has are removed. ## Options `INPUT...` is required: one or more files, scan documents with `--scan`, or non-recursive glob patterns. | Option | Description | | --- | --- | | `-o`, `--output PATH` | HTML filename of the main page, ending in `.html`, for a single input. The profile takes the same name with `.json`. Not with `-d` or `--all-collections` | | `-d`, `--output-dir PATH` | Folder for the pages, named after their sources. Required by `--all-collections` with several inputs | | `-c`, `--config PATH` | JSON [configuration file](https://docs.tabalyst.com/reference/configuration.md). `deep.mode` set to `off` is an error | | `-f`, `--force` | Replace existing Insights files | | `-q`, `--quiet` | Suppress success messages; warnings and errors remain | | `-v`, `--verbose` | Also show the profile and history paths, and the encoding and delimiter of a CSV file | | `--no-progress` | Disable the progress line | | `--workers N` | Worker processes that analyze values: `1` for one process. Files of 16 MiB or more use one per spare processor by default. Not with `--scan` | | `-y`, `--yes` | Start a costly second pass without asking. Outside a terminal, a costly second pass needs it | | `--dedup-report PATH` | A [Dedup](https://docs.tabalyst.com/dedup.md) report, or the folder holding the one of each source, that proves the copies of rows behind the uniqueness of identifier columns. CSV sources only. As for [`tabalyst report`](https://docs.tabalyst.com/reference/cli/report.md) | | `--delimiter TEXT` | CSV: one-character delimiter, instead of the detected one | | `--encoding TEXT` | CSV: text encoding, instead of the detected one | | `--collection TEXT` | JSON or Excel: the part of the file to analyze. See [Choosing a collection or a table](https://docs.tabalyst.com/reference/cli.md#choosing-a-collection-or-a-table). Not with `--scan` or `--all-collections` | | `--all-collections` | JSON or Excel: the pages of every visible collection of each file, as `..insights.html`. Not with `-o`, `--collection` or `--scan` | | `--scan` | The inputs are scan documents written by `tabalyst scan`. The second pass still reads each source again. Not with `--delimiter`, `--encoding`, `--collection`, `--all-collections` or `--workers` | | `--help` | Show the options and exit | An option that a kind of file cannot use is ignored, with a warning, as for [`tabalyst report`](https://docs.tabalyst.com/reference/cli/report.md#options-by-format). ## Second pass The second pass reads each source again for the exact analyses the scan lacks: distinct counts, frequencies, medians, patterns counted on every value and more. Insights always runs it, so its profile is the one `tabalyst report --deep` writes. When its estimate passes the thresholds (several minutes, or more memory than the budget), Insights shows the estimate and asks once for the whole batch: - in a terminal, answer the question, or give `--yes` to skip it; - outside a terminal (a script, a pipe, CI), a costly pass stops with exit code `3` and nothing is started, unless `--yes` is given. The line after the path says what the second pass did: ```text Second pass (forced): 160 analyses, 160 computed, 0 reused. ``` A second pass stored beside the scan is reused while the source is unchanged. ## Examples ```console tabalyst insights customers.csv tabalyst insights data/*.csv -d insights tabalyst insights customers.csv -o out/customers.html --force tabalyst insights orders.json tabalyst insights shop.xlsx --all-collections -d insights tabalyst insights big.csv --yes ``` ## Exit codes The codes of the [command line](https://docs.tabalyst.com/reference/cli.md#exit-codes): `0` success, `1` analysis or output failure, `2` invalid configuration or a collection to choose, `3` a costly second pass not confirmed, `4` input error.