Sign In

SurrealDB CLI

/

CLI commands

Overview

How the SurrealDB CLI is organised into subcommands, with links to each command’s flags and examples.

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.

Usage
surreal [OPTIONS] <COMMAND>
SubcommandPurpose
startRun a SurrealDB server (in memory, on disk, or clustered).
sqlOpen an interactive SurrealQL shell or run queries from scripts.
exportDump a database to SurrealQL.
fixApply data or schema fixes offline.
helpShow help for the CLI or a subcommand.
importLoad SurrealQL from a file into a database.
isreadyHealth check for readiness probes.
mcp
Available since: v3.1.0
Start the Model Context Protocol server on stdio for IDE integrations.
mlWork with machine-learning features from the CLI.
moduleBuild and manage WASM modules (including Surrealism).
upgradeUpgrade between SurrealDB versions.
validateValidate SurrealQL or configuration.
versionPrint CLI and server version information.

Sidebar order: start and sql first, then remaining subcommands alphabetically.

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.

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.

Was this page helpful?