Help command
The help command displays help information and instructions on the command-line tool and its arguments.
Make sure you’ve installed SurrealDB — it should only take a second!
Show the command-line help information
To see the general help information for the command-line tool, in a terminal run the surreal help
command without any further arguments. This command gives general information on the other functionality which can be run with the command-line tool.
user@localhost % surreal help
.d8888b. 888 8888888b. 888888b.
d88P Y88b 888 888 'Y88b 888 '88b
Y88b. 888 888 888 888 .88P
'Y888b. 888 888 888d888 888d888 .d88b. 8888b. 888 888 888 8888888K.
'Y88b. 888 888 888P' 888P' d8P Y8b '88b 888 888 888 888 'Y88b
'888 888 888 888 888 88888888 .d888888 888 888 888 888 888
Y88b d88P Y88b 888 888 888 Y8b. 888 888 888 888 .d88P 888 d88P
'Y8888P' 'Y88888 888 888 'Y8888 'Y888888 888 8888888P' 8888888P'
SurrealDB command-line interface and server
To get started using SurrealDB, and for guides on connecting to and building applications
on top of SurrealDB, check out the SurrealDB documentation (https://surrealdb.com/docs).
If you have questions or ideas, join the SurrealDB community (https://surrealdb.com/community).
If you find a bug, submit an issue on Github (https://github.com/surrealdb/surrealdb/issues).
We would love it if you could star the repository (https://github.com/surrealdb/surrealdb).
----------
USAGE:
surreal [SUBCOMMAND]
OPTIONS:
-h, --help Print help information
SUBCOMMANDS:
start Start the database server
backup Backup data to or from an existing database
import Import a SQL script into an existing database
export Export an existing database into a SQL script
version Output the command-line tool version information
sql Start an SQL REPL in your terminal with pipe support
help Print this message or the help of the given subcommand(s)
Show the start
command help information
To see the help information and usage instructions for the start
command, in a terminal run the surreal help start
command without any further arguments. This command gives general information on the arguments, inputs, and additional options for starting a SurrealDB database server instance.
user@localhost % surreal start --help
Start the database server
Usage: surreal start [OPTIONS] [PATH]
Arguments:
[PATH] Database path used for storing data [env: SURREAL_PATH=] [default: memory]
Options:
-l, --log <LOG> The logging level for the database server [env: SURREAL_LOG=] [default: info] [possible values: none,
full, error, warn, info, debug, trace]
--no-banner Whether to hide the startup banner [env: SURREAL_NO_BANNER=]
-h, --help Print help (see more with '--help')
Database:
--tick-interval <TICK_INTERVAL>
The interval at which to run node agent tick (including garbage collection) [env: SURREAL_TICK_INTERVAL=]
[default: 10s]
-s, --strict
Whether strict mode is enabled on this database instance [env: SURREAL_STRICT=]
--query-timeout <QUERY_TIMEOUT>
The maximum duration that a set of statements can run for [env: SURREAL_QUERY_TIMEOUT=]
--transaction-timeout <TRANSACTION_TIMEOUT>
The maximum duration that any single transaction can run for [env: SURREAL_TRANSACTION_TIMEOUT=]
Authentication:
-u, --username <USERNAME> The username for the initial database root user. Only if no other root user exists [env:
SURREAL_USER=] [aliases: user]
-p, --password <PASSWORD> The password for the initial database root user. Only if no other root user exists [env:
SURREAL_PASS=] [aliases: pass]
--auth Whether to enable authentication [env: SURREAL_AUTH=]
Datastore connection:
--kvs-ca <KVS_CA> Path to the CA file used when connecting to the remote KV store [env: SURREAL_KVS_CA=]
--kvs-crt <KVS_CRT> Path to the certificate file used when connecting to the remote KV store [env:
SURREAL_KVS_CRT=]
--kvs-key <KVS_KEY> Path to the private key file used when connecting to the remote KV store [env:
SURREAL_KVS_KEY=]
HTTP server:
--web-crt <WEB_CRT> Path to the certificate file for encrypted client connections [env: SURREAL_WEB_CRT=]
--web-key <WEB_KEY> Path to the private key file for encrypted client connections [env: SURREAL_WEB_KEY=]
--client-ip <CLIENT_IP> The method of detecting the client's IP address [env: SURREAL_CLIENT_IP=] [default:
socket] [possible values: none, socket, CF-Connecting-IP, Fly-Client-IP,
True-Client-IP, X-Real-IP, X-Forwarded-For]
-b, --bind <LISTEN_ADDRESSES> The hostname or ip address to listen for connections on [env: SURREAL_BIND=] [default:
0.0.0.0:8000]
Capabilities:
-A, --allow-all [<ALLOW_ALL>...] Allow all capabilities [env: SURREAL_CAPS_ALLOW_ALL=] [possible values:
true, false]
--allow-scripting [<ALLOW_SCRIPTING>...] Allow execution of scripting functions [env: SURREAL_CAPS_ALLOW_SCRIPT=]
[possible values: true, false]
--allow-guests [<ALLOW_GUESTS>...] Allow guest users to execute queries [env: SURREAL_CAPS_ALLOW_GUESTS=]
[possible values: true, false]
--allow-funcs [<ALLOW_FUNCS>...] Allow execution of all functions. Optionally, you can provide a
comma-separated list of function names to allow [env:
SURREAL_CAPS_ALLOW_FUNC=]
--allow-net [<ALLOW_NET>...] Allow all outbound network access. Optionally, you can provide a
comma-separated list of targets to allow [env: SURREAL_CAPS_ALLOW_NET=]
-D, --deny-all [<DENY_ALL>...] Deny all capabilities [env: SURREAL_CAPS_DENY_ALL=] [possible values:
true, false]
--deny-scripting [<DENY_SCRIPTING>...] Deny execution of scripting functions [env: SURREAL_CAPS_DENY_SCRIPT=]
[possible values: true, false]
--deny-guests [<DENY_GUESTS>...] Deny guest users to execute queries [env: SURREAL_CAPS_DENY_GUESTS=]
[possible values: true, false]
--deny-funcs [<DENY_FUNCS>...] Deny execution of all functions. Optionally, you can provide a
comma-separated list of function names to deny [env:
SURREAL_CAPS_DENY_FUNC=]
--deny-net [<DENY_NET>...] Deny all outbound network access. Optionally, you can provide a
comma-separated list of targets to deny [env: SURREAL_CAPS_DENY_NET=]
Show the import
command help information
To see the help information and usage instructions for the import
command, in a terminal run the surreal help import
command without any further arguments. This command gives general information on the arguments, inputs, and additional options for importing a SurrealQL script file into a local or remote SurrealDB database server instance.
user@localhost % surreal import --help
Import a SurrealQL script into an existing database
USAGE:
surreal import [OPTIONS] <file>
ARGS:
<file> Path to the sql file to import
OPTIONS:
-c, --conn <conn> Remote database server url to connect to [default: https://cloud.surrealdb.com]
--db <db> The database to import the data into
-h, --help Print help information
--ns <ns> The namespace to import the data into
-p, --pass <pass> Database authentication password to use when connecting [default: root]
-u, --user <user> Database authentication username to use when connecting [default: root]
Show the export
command help information
To see the help information and usage instructions for the export
command, in a terminal run the surreal help export
command without any further arguments. This command gives general information on the arguments, inputs, and additional options for export a SurrealQL script file from a local or remote SurrealDB database server instance.
user@localhost % surreal help export
Export an existing database as a SurrealQL script
USAGE:
surreal export [OPTIONS] <file>
ARGS:
<file> Path to the sql file to export
OPTIONS:
-c, --conn <conn> Remote database server url to connect to [default: https://cloud.surrealdb.com]
--db <db> The database to export the data from
-h, --help Print help information
--ns <ns> The namespace to export the data from
-p, --pass <pass> Database authentication password to use when connecting [default: root]
-u, --user <user> Database authentication username to use when connecting [default: root]