The surreal executable exposes a single entry point with subcommands for running the server, executing SurrealQL, importing and exporting data, and maintenance tasks. Each page documents that subcommand’s arguments, related environment variables, and typical usage.
surreal [OPTIONS] <COMMAND>| Subcommand | Purpose |
|---|---|
start | Run a SurrealDB server (in memory, on disk, or clustered). |
sql | Open an interactive SurrealQL shell or run queries from scripts. |
export | Dump a database to SurrealQL. |
fix | Apply data or schema fixes offline. |
help | Show help for the CLI or a subcommand. |
import | Load SurrealQL from a file into a database. |
isready | Health check for readiness probes. |
mcp Available since: v3.1.0 | Start the Model Context Protocol server on stdio for IDE integrations. |
ml | Work with machine-learning features from the CLI. |
module | Build and manage WASM modules (including Surrealism). |
upgrade | Upgrade between SurrealDB versions. |
validate | Validate SurrealQL or configuration. |
version | Print CLI and server version information. |
Sidebar order: start and sql first, then remaining subcommands alphabetically.
Shared options
Every subcommand accepts -h / --help, which prints its arguments and options and exits, and the logging option group (-l / --log, --log-format, --log-file-*, and the socket and OpenTelemetry overrides). Each page lists --log alongside the command's own flags and shows the full group in its command help output.
Most flags have an equivalent environment variable, listed in the tables on each page and in full on the environment variables page.
What is not here
These subcommands act on a database that already exists or that you start yourself. Provisioning, pausing, scaling, and deleting SurrealDB Cloud instances is the control plane, handled by surrealctl instance instead. surrealctl calls out to surreal for SQL, imports, and exports, so the pages here still describe what happens once a Cloud instance has been resolved.
For installation and a minimal end-to-end example, see the SurrealDB CLI overview.