Sign In

CLI Tools

CLI Tools

Reference for the three SurrealDB command-line tools: surrealctl for the control plane, surreal for the data plane, and surqlfmt for formatting SurrealQL.

SurrealDB ships three command-line tools. They are installed separately and cover different jobs, so most workflows use more than one of them.

ToolCoversReference
surrealctlThe control plane: organisations, instances, members, tokens, and billing.surrealctl
surrealThe data plane: run a server, query it, and move data in and out.SurrealDB CLI
surqlfmtFormatting .surql files to a consistent style.SurrealQL formatter

surrealctl manages SurrealDB Cloud from the command line: it signs you in, selects an organisation, and creates, scales, pauses, and deletes instances. Every command can emit JSON, so it is the scriptable path for CI pipelines and provisioning scripts.

surrealctl auth login
surrealctl instance create api --type shared-1 --region aws-euw1

surrealctl never replaces surreal. For SurrealQL work against a Cloud instance it resolves the endpoint and credentials, then hands off to the surreal binary.

See the surrealctl reference for installation, authentication, global flags, and every command.

The surreal binary is the data-plane tool. It starts a server, opens an interactive SurrealQL shell, imports and exports data, validates query files, and reports the version in use.

surreal start --user root --pass secret
surreal sql --username root --password secret --pretty

See the SurrealDB CLI reference for a walkthrough, the command list for each subcommand, and environment variables for the SURREAL_* variables that mirror its flags.

surqlfmt reformats .surql files to a consistent style. It is distributed as an npm package rather than as part of the surreal binary, which makes it easy to pin in a project and run in CI.

npm install -g @surrealdb/surql-fmt
surqlfmt --check ./src/**/*.surql

See the SurrealQL formatter reference for its options and usage patterns.

Was this page helpful?