Meta commands (also called dot commands) are special commands that start with a dot (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/duckdb/duckdb/llms.txt
Use this file to discover all available pages before exploring further.
.) and control the behavior of the DuckDB CLI.
Getting Help
.help
Display help information for all commands:Database Operations
.open
Open a database file:.databases
List all attached databases:.tables
List all tables:.schema
Show CREATE statements for all tables:.indexes
Show all indexes:Import and Export
.import
Import data from a file into a table:- If the table doesn’t exist, it will be created automatically
- If no format is specified, it’s inferred from the file extension
- Additional parameters can be passed with
--parameter valuesyntax
.dump
Dump database schema and data as SQL:Output Control
.mode
Set output mode:ascii- Columns/rows delimited by ASCII separators (0x1F and 0x1E)box- Tables using Unicode box-drawing characterscolumn- Left-aligned columns (see.width)csv- Comma-separated valuesduckbox- Tables with extensive formatting features (default)html- HTML<table>formatinsert- SQL INSERT statementsjson- Results as JSON arrayjsonlines- Results as newline-delimited JSONlatex- LaTeX tabular environmentline- One value per linelist- Values delimited by|markdown- Markdown table formatquote- Escape values as for SQLtable- ASCII-art tabletabs- Tab-separated valuestcl- TCL list elementstrash- No output (useful for benchmarking)
.headers
Toggle display of column headers:.separator
Set column separator:.nullvalue
Set the string to display for NULL values:.width
Set column widths for column mode:.maxrows
Set maximum number of rows to display (duckbox mode only):.maxwidth
Set maximum display width in characters (duckbox mode only):File Operations
.read
Execute SQL from a file:.output
Redirect output to a file:--bom- Add UTF-8 byte-order mark-e- Send to system text editor-x- Send as CSV to spreadsheet
.once
Redirect output for next command only:.excel
Display next query result in spreadsheet:Display and Formatting
.echo
Toggle command echo:.timer
Toggle SQL timer:.changes
Show number of rows changed by SQL:.bail
Stop after hitting an error:Rendering and Highlighting
.highlight
Toggle syntax highlighting:.highlight_mode
Set highlighting mode:auto- Automatically detect terminal colorsdark- Dark mode colorslight- Light mode colorsmixed- Mixed mode
.highlight_errors
Toggle error highlighting:.highlight_results
Toggle result highlighting:.highlight_colors
Configure highlighting colors:.display_colors
Display all available terminal colors:Number Formatting (duckbox mode)
.large_number_rendering
Configure readable rendering of large numbers:all- Format all large numbersfooter- Show formatted numbers in footer onlyoff- Disable formatting
.decimal_sep
Set decimal separator:.thousand_sep
Set thousands separator:Pager Control
.pager
Configure pager for output:Prompt Customization
.prompt
Customize prompts:- Main prompt
- Continuation prompt
- Selected continuation prompt (optional)
- Scroll up prompt (optional)
- Scroll down prompt (optional)
Progress Bar
.progress_bar
Configure progress bar display:System Commands
.shell (or .system)
Run system command:.cd
Change working directory:Information Display
.show
Show current configuration:.version
Show DuckDB version:.about
Show information about DuckDB:.last
Render the last result without truncation:Special Features
.columns and .rows
Switch between column-wise and row-wise rendering:.log
Turn logging on or off:.edit
Open external text editor to edit a query:DUCKDB_EDITOREDITORVISUAL- Default:
vi
\e
Session Control
.quit or .exit
Exit the DuckDB CLI:Safe Mode
Safe mode disables potentially dangerous operations:.import.open.cd.shell/.system.log