|-
| '''Summary'''
|Creates the database {{Code|[name]}} with an optional {{Code|[input]}} and opens it. An existing database will be overwritten.<br />The input may either be a reference to a single XML document, a directory, a remote URL, or a string containing XML:* {{Code|[name]}} must be a [[#Valid Names|valid database name]]
* several additional [[Options#Create Options|Create Options]] can be set to influence the creation process.
|-
|-
| '''Summary'''
|Opens the database specified by {{Code|[name]}}. The documents to be opened can be specified by the [path] argument.
|-
| '''Errors'''
|-
| '''Summary'''
|This convenience command combines [[#OPEN|OPEN]] and [[#CREATE DB|CREATE DB]]: if a database with the name {{Code|[input]}} exists, it is opened. Otherwise, a new database is created; if the specified input points to an existing resource, it is stored as initial content.
|-
| '''Errors'''
|-
| '''Summary'''
|Exports all documents in the database to the specified file {{Code|[path]}}, using the serializer options specified by the <code>[[Options#EXPORTER|EXPORTER]]</code> option.
|-
| '''Errors'''
|-
| '''Summary'''
|Renames the database specified by {{Code|[name]}} to {{Code|[newname]}}. {{Code|[newname]}} must be a [[#Valid Names|valid database name]].
|-
| '''Errors'''
|-
| '''Summary'''
|Drops the database with the specified {{Code|[name]}}. The [[#Glob Syntax|Glob Syntax]] can be used to address more than one database.
|-
| '''Errors'''
|-
| '''Summary'''
|Creates a zipped backup of the database specified by {{Code|[name]}}. The backup file will be suffixed with the current timestamp and stored in the database directory. The [[#Glob Syntax|Glob Syntax]] can be used to address more than one database.<br/>Please note that Java 7 is required to handle ''ZIP files larger than 4 GB''.
|-
| '''Errors'''
|-
| '''Summary'''
|Restores a database with the specified {{Code|[name]}}. The name may include the timestamp of the backup file.
|-
| '''Errors'''
|-
| '''Summary'''
|Drops all backups of the database with the specified {{Code|[name]}}. The [[#Glob Syntax|Glob Syntax]] can be used to address more than one database.
|-
| '''Examples'''
|-
| '''Summary'''
|Creates a copy of the database specified by {{Code|[name]}}. {{Code|[newname]}} must be a [[#Valid Names|valid database name]].
|-
| '''Errors'''
|-
| '''Summary'''
|Lists all available databases. If {{Code|[name]}} is specified, the resources of a database are listed. The output can be further restricted to the resources matching the specified {{Code|[path]}}.
|-
| '''Errors'''
|-
| '''Summary'''
|Runs the specified {{Code|[query]}} and prints the result.
|-
| '''Errors'''
|-
| '''Summary'''
|Retrieves a raw file from the opened database at the specified {{Code|[path]}}.
|-
| '''Errors'''
|-
| '''Summary'''
|Builds and runs a query for the specified {{Code|[query]}} terms. Keywords can be enclosed in quotes to look for phrases. The following modifiers can be used to further limit search:
<code>=</code> looks for exact text nodes<br/><code>~</code> looks for approximate hits<br/><code>@=</code> looks for exact attribute values<br/><code>@</code> looks for attributes
|-
|-
| '''Summary'''
|Runs all [[Unit Module|XQUnit tests]] in the specified {{Code|[path]}}. The path can point to a single file or a directory.<br/>Unit testing can also be triggered via {{Code|-t}} on [[Command-Line Options#BaseX Standalone|command line]].
|-
| '''Errors'''
|-
| '''Summary'''
| Installs the package with path {{Code|[path]}}.
|-
| '''Errors'''
|-
| '''Summary'''
| Deletes the package with name {{Code|[name]}}, optionally followed by a version.
|-
| '''Errors'''
|-
| '''Summary'''
|Adds a file, directory or XML string specified by {{Code|[input]}} to the currently opened database at the specified {{Code|[path]}}. A document with the same path may occur than once in a database. If this is unwanted, [[#REPLACE|REPLACE]] can be used.<br/>{{Code|[input]}} may either be a single XML document, a directory, a remote URL or a plain XML string.
|-
| '''Errors'''
|-
| '''Summary'''
|Deletes all documents from the currently opened database that start with the specified {{Code|[path]}}.
|-
| '''Errors'''
|-
| '''Summary'''
|Renames all document paths in the currently opened database that start with the specified {{Code|[path]}}. The command may be used to either rename single documents or directories.
|-
| '''Errors'''
|-
| '''Summary'''
|Replaces a document in the currently opened database, addressed by {{Code|[path]}}, with the file or XML string specified by {{Code|[input]}}, or adds a new document if the resource does not exist yet.
|-
| '''Errors'''
|-
| '''Summary'''
|Stores a raw file in the opened database to the specified {{Code|[path]}}. {{Code|[input]}} may either be a file reference, a remote URL, or a plain string. If the path denotes a directory, it needs to be suffixed with a slash ({{Code|/}}).
|-
| '''Errors'''
|-
| '''Summary'''
|Shows all users that are registered in the database. If a {{Code|[database]}} is specified, all user will be shown for which a pattern was specified that matches the database name.
|-
| '''Errors'''
|-
| '''Summary'''
|Kills sessions of a user or an IP:port combination, specified by {{Code|[target]}}. The [[#Glob Syntax|Glob Syntax]] can be used to address more than one user.
|-
| '''Errors'''
|-
| '''Summary'''
|Evaluates the contents of {{Code|[file]}} as XQuery expression. If the file ends with the suffix {{Code|.bxs}}, the file content will be evaluated as [[#Basics|command script]]. This command can be used to run several commands in a single transaction.
|-
| '''Errors'''
|-
| '''Summary'''
|Evaluates the specified {{Code|[input]}} as [[#Basics|command script]]. This command can be used to run several commands in a single transaction.
|-
| '''Errors'''
|-
| '''Summary'''
|Returns the current value of the [[Options|Option]] specified via {{Code|[option]}}. Global options can only be requested by users with ADMIN permissions.
|-
| '''Errors'''
|-
| '''Summary'''
|Sets the [[Options|Option]] specified by {{Code|[option]}} to a new {{Code|[value]}}. Only local options can be modified. If no value is specified, and if the value is boolean, it will be inverted.
|-
| '''Errors'''
|-
| '''Summary'''
|If {{Code|[command]}} is specified, information on the specific command is printed; otherwise, all commands are listed.
|-
| '''Errors'''