Skip to main content

Command Line Arguments

The table below summarizes Goose's command line options. To list all command line options, use the command:

goose -help

For a list of dot commands available in the CLI shell, see the Dot Commands page.

ArgumentDescription
-appendAppend the database to the end of the file
-asciiSet output mode to ascii
-bailStop after hitting an error
-batchForce batch I/O
-boxSet output mode to box
-columnSet output mode to column
-cmd COMMANDRun COMMAND before reading stdin
-c COMMANDRun COMMAND and exit
-csvSet output mode to csv
-echoPrint commands before execution
-f FILENAMERun the script in FILENAME and exit. Note that the ~/.gooserc is read and executed first (if it exists)
-init FILENAMERun the script in FILENAME upon startup (instead of ~/.gooserc)
-headerTurn headers on
-helpShow this message
-htmlSet output mode to HTML
-interactiveForce interactive I/O
-jsonSet output mode to json
-lineSet output mode to line
-listSet output mode to list
-markdownSet output mode to markdown
-newline SEPSet output row separator. Default: \n
-nofollowRefuse to open symbolic links to database files
-noheaderTurn headers off
-no-stdinExit after processing options instead of reading stdin
-nullvalue TEXTSet text string for NULL values. Default: NULL
-quoteSet output mode to quote
-readonlyOpen the database read-only. This option also supports attaching to remote databases via HTTPS
-s COMMANDRun COMMAND and exit
-separator SEPSet output column separator to SEP. Default: `
-storage-version VERDatabase storage compatibility version to use.
-tableSet output mode to table
-uiLoads and starts the Goose UI. If the UI is not yet installed, it installs the ui extension
-unsignedAllow loading of unsigned extensions. This option is intended to be used for developing extensions. Consult the Securing Goose page for guidelines on how set up Goose in a secure manner
-versionShow Goose 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:

goose -csv -c 'SELECT 42 AS hello' -json -c 'SELECT 84 AS world'

Returns the following:

hello
42
[{"world":84}]