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.
| 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. |
For installation and a minimal end-to-end example, see the SurrealDB CLI overview. For environment variables that mirror CLI flags, see Environment variables.