• Start

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.

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

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.

For installation and a minimal end-to-end example, see the SurrealDB CLI overview. For environment variables that mirror CLI flags, see Environment variables.

Was this page helpful?