Command Line Arguments
The table below summarizes DuckDB’s command line options. To list all command line options, use the command:
duckdb -helpFor a list of dot commands available in the CLI shell, see the Dot Commands page.
| Argument | Description |
|---|---|
-append |
Append the database to the end of the file |
-ascii |
Set output mode to ascii |
-bail |
Stop after hitting an error |
-batch |
Force batch I/O |
-box |
Set output mode to box |
-column |
Set output mode to column |
-cmd COMMAND |
Run COMMAND before reading stdin |
-c COMMAND |
Run COMMAND and exit |
-csv |
Set output mode to csv |
-echo |
Print commands before execution |
-f FILENAME |
Run the script in FILENAME and exit. Note that the ~/.duckdbrc is read and executed first (if it exists) |
-init FILENAME |
Run the script in FILENAME upon startup (instead of ~/.duckdbrc) |
-header |
Turn headers on |
-help |
Show this message |
-html |
Set output mode to HTML |
-interactive |
Force interactive I/O |
-json |
Set output mode to json |
-line |
Set output mode to line |
-list |
Set output mode to list |
-markdown |
Set output mode to markdown |
-newline SEP |
Set output row separator. Default: \n |
-nofollow |
Refuse to open symbolic links to database files |
-noheader |
Turn headers off |
-no-stdin |
Exit after processing options instead of reading stdin |
-nullvalue TEXT |
Set text string for NULL values. Default: NULL |
-quote |
Set output mode to quote |
-readonly |
Open the database read-only. This option also supports attaching to remote databases via HTTPS |
-s COMMAND |
Run COMMAND and exit |
-separator SEP |
Set output column separator to SEP. Default: ` |
-storage-version VER |
Database storage compatibility version to use. To use the latest storage version, pass -storage-version latest |
-table |
Set output mode to table |
-ui |
Loads and starts the DuckDB UI. If the UI is not yet installed, it installs the ui extension |
-unsigned |
Allow loading of unsigned extensions. This option is intended to be used for developing extensions. Consult the Securing DuckDB page for guidelines on how to set up DuckDB in a secure manner |
-version |
Show DuckDB version |
Passing a Sequence of Arguments
Note that the CLI arguments are processed in order, similarly to the behavior of the SQLite CLI. For example:
duckdb -csv -c 'SELECT 42 AS hello' -json -c 'SELECT 84 AS world'Returns the following:
hello42[{"world":84}]