This article is part of the [[Getting Started]] Guide.
Each BaseX [[Startup]] mode has one or more command-line options , which are described in this article.
Command-line options can be specified multiple times. Please note that all options will be evaluated in the given order. The standard input can be parsed by specifying a single dash ({{Code|-}}) as an argument. {{Announce|Updated with Version 11}}: The Clark notation was replaced with the [[XQuery 3.0#Expanded QNames|Expanded QNames]] notation.
=Standalone=
|- valign="top"
| {{Code|-b<args>}}
| Binds external variables to XQuery expressions. This flag may be specified multiple times. Variables names and their values are delimited by equality signs (<code>=</code>). The names may be optionally prefixed with dollar signs. If a variable uses a namespace different to from the default namespace, it can be specified with the [http://www[XQuery 3.jclark.com/xml/xmlns.htm Clark Notation0#Expanded QNames|Expanded QNames]]notation.
| {{Option|BINDINGS}}
|
|• <code>-bv=example "declare variable $v external; $v"</code><br/>• <code>-bbQ{URL}ln=value<br/>"declare namespace ns='URL'; declare variable $ns:ln external; $ns:ln"</code>
|- valign="top"
| {{Code|-c<input>}}
| Executes [[commands]]. If the specified input is a valid URI or file reference, this file will be is evaluated as [[Commands#Command_Scripts|Command Script]].
|
|
|• {{Code|-c list}}<br/>• {{Code|-ccommands.txt}}<br/>• {{Code|-c"<info/>"}}
|- valign="top"
| {{Code|-C<file>}}
| Evaluates the contents of the specified file as [[Commands#Command_Scripts|Command Script]].
|
|
|
|- valign="top"
| {{Code|-d}}
=Server=
{{Announce|Added with Version 11:}} {{Code|-C}}
The following options are available for the [[Database Server]]:
stop Stop running server
-c<input> Execute commands from file or string
-C<file> Execute command script file
-d Enable debugging output
-n<name> Set host the server is bound to
|- valign="top"
| {{Code|-c<input>}}
| Executes [[commands]]. If the specified input is a valid URI or file reference, this file will be is evaluated as [[Commands#Command_Scripts|Command Script]].
|
|
| {{Code|-c"open database;info"}}
|- valign="top"
| {{Code|-C<file>}}
| Evaluates the contents of the specified file as [[Commands#Command_Scripts|Command Script]].
|
|
|
|- valign="top"
| {{Code|-d}}
|- valign="top"
| {{Code|-b<args>}}
| Binds external variables to XQuery expressions. This flag may be specified multiple times. Variables names and their values are delimited by equality signs (<code>=</code>). The names may be optionally prefixed with dollar signs. If a variable uses a namespace different to from the default namespace, it can be specified with the [http://www.jclark.com/xml/xmlns.htm Clark Notation] or [https://wwwXQuery 3.w3.org/TR/xquery-30/0#id-basics Expanded QName NotationQNames|Expanded QNames]]notation.
| {{Option|BINDINGS}}
|
|• <code>-b$v=example "declare variable $v external; $v"</code><br/>• <code>-bbQ{URL}ln=value<br/>"declare namespace ns='URL'; declare variable $ns:ln external; $ns:ln"</code>
|- valign="top"
| {{Code|-c<input>}}
|
|• {{Code|-c list}}<br/>• {{Code|-ccommands.txt}}<br/>• {{Code|-c"<info/>"}}
|- valign="top"
| {{Code|-C<file>}}
| Evaluates the contents of the specified file as [[Commands#Command_Scripts|Command Script]].
|
|
|
|- valign="top"
| {{Code|-d}}
=HTTP Server=
{{Announce|With Added with Version 10, the default ports have been changed from 8984/8985 to 8080/8081.11:}} {{Code|-C}}
The following options are available for the [[Web Application|HTTP Server]]:
stop Stop running server
-c<input> Execute commands from file or string
-C<file> Execute command script file
-d Enable debugging output
-g Enable GZIP support
|- valign="top"
| {{Code|-c<input>}}
| Executes [[commands]]. If the specified input is a valid URI or file reference, this file will be is evaluated as [[Commands#Command_Scripts|Command Script]].
|
|
| {{Code|-c"open database"}}
|- valign="top"
| {{Code|-C<file>}}
| Evaluates the contents of the specified file as [[Commands#Command_Scripts|Command Script]].
|
|
|
|- valign="top"
| {{Code|-e}}
;Version 11.0
* Added: {{Code|-C}}(standalone, server, client, HTTP server).* Added: {{Code|-Q}}, {{Code|-W}} in (standalone and , client mode).* Updated: The Clark notation was replaced with the [[XQuery 3.0#Expanded QNames|Expanded QNames]] notation.
;Version 10.0