sqlite3 data.db -csv 'SELECT * FROM employees LIMIT 2;'
Run a query with CSV output via a flag
The -csv flag is the command-line shortcut for .mode csv, producing comma-separated output without typing a dot command. The query selects all columns but limits the result to 2 rows. Use -header with it to include column names in the first line. This form fits pipelines better than the interactive dot-command variant.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.