id = "duckdb"
name = "DuckDB"
homepage = "https://duckdb.org/docs/stable/clients/cli/overview"
description = "DuckDB is an in-process SQL OLAP database management system."
executables = ["duckdb"]
[dotfiles]
paths = ["~/.duckdbrc"]
secret = []
side_effect = false
[commands]
format = 1
label = "Run DuckDB"
description = "Open a database file in the DuckDB shell, or run one SQL command or script and exit with a chosen output format. Server, UI and extension options are not covered."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = false, short_attached = false, short_bundles = false }
[[commands.source]]
id = "docs"
kind = "manual"
url = "https://duckdb.org/docs/2.0/clients/cli/arguments.html"
revision = "2026-10-27"
evidence = """
-c COMMAND Run COMMAND and exit
-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)
-box Set output mode to box
-csv Set output mode to csv
-json Set output mode to json
-markdown Set output mode to markdown
-table Set output mode to table
-header Turn headers on
-noheader Turn headers off
-nullvalue TEXT Set text string for NULL values. Default: NULL
-readonly Open the database read-only. This option also supports attaching to remote databases via HTTPS
-safe Enable safe mode
-separator SEP Set output column separator to SEP.
-unsigned Allow loading of unsigned extensions.
"""
[[commands.field]]
id = "database"
label = "Database file"
description = "Leave empty for a transient in-memory database."
type = "path"
position = 0
path = { kind = "file", role = "input", must_exist = false }
sources = ["docs"]
[[commands.field]]
id = "command"
label = "SQL command"
description = "Run this SQL and exit."
type = "string"
option = ["-c"]
sources = ["docs"]
[[commands.field]]
id = "script"
label = "SQL script file"
description = "Run this script and exit."
type = "path"
option = ["-f"]
path = { kind = "file", role = "input", must_exist = true }
sources = ["docs"]
[[commands.field]]
id = "readonly"
label = "Open read-only"
type = "boolean"
option = ["-readonly"]
sources = ["docs"]
[[commands.field]]
id = "csv"
label = "CSV output"
type = "boolean"
option = ["-csv"]
sources = ["docs"]
[[commands.field]]
id = "json"
label = "JSON output"
type = "boolean"
option = ["-json"]
sources = ["docs"]
[[commands.field]]
id = "markdown"
label = "Markdown output"
type = "boolean"
option = ["-markdown"]
sources = ["docs"]
[[commands.field]]
id = "box"
label = "Box output"
type = "boolean"
option = ["-box"]
sources = ["docs"]
[[commands.field]]
id = "table"
label = "Table output"
type = "boolean"
option = ["-table"]
sources = ["docs"]
[[commands.field]]
id = "header"
label = "Print headers"
type = "boolean"
option = ["-header"]
sources = ["docs"]
[[commands.field]]
id = "noheader"
label = "Omit headers"
type = "boolean"
option = ["-noheader"]
sources = ["docs"]
[[commands.field]]
id = "separator"
label = "Column separator"
type = "string"
option = ["-separator"]
sources = ["docs"]
[[commands.field]]
id = "nullvalue"
label = "NULL text"
type = "string"
option = ["-nullvalue"]
sources = ["docs"]
[[commands.field]]
id = "init"
label = "Startup script"
description = "Used instead of ~/.duckdbrc."
type = "path"
option = ["-init"]
path = { kind = "file", role = "input", must_exist = true }
sources = ["docs"]
[[commands.field]]
id = "safe"
label = "Safe mode"
type = "boolean"
option = ["-safe"]
sources = ["docs"]
[[commands.task]]
id = "open"
label = "Open a database"
fields = ["database", "readonly"]
required = []
[[commands.task]]
id = "query-csv"
label = "Run a query to CSV"
set = { csv = [true], header = [true] }
fields = ["database", "command", "csv", "header", "readonly"]
required = ["command"]
[[commands.task]]
id = "run-script"
label = "Run a script"
fields = ["database", "script", "json", "csv", "readonly"]
required = ["script"]
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["database", "command", "script", "readonly", "csv", "json", "markdown", "box", "table"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["header", "noheader", "separator", "nullvalue", "init", "safe"]