/surrealdb:surrealdb-clifrom surrealdb
Drives the `surreal` CLI to start a SurrealDB server, run SQL REPL, import/export databases, install and pin multiple versions, check readiness, repair storage, and manage SurrealML models.
Ships in surrealdb. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A skill for driving the surreal command-line binary — SurrealDB's all-in-one launcher for running a server, querying it, moving data in and out, and installing multiple database versions side by side.
This skill covers operating the surreal binary itself. To write the SurrealQL that you run with it, use the surrealql skill; for declarative schema migrations and type generation, use the surrealkit skill.
Reference these guidelines when:
surreal db start)surreal db sql)surreal db import / surreal db export)surreal db is-ready)surreal install, surreal use, surreal +4.0.1 db …)cloud, memory, kit, lsp, ent or ext components (surreal install cloud, surreal memory --help)surreal upgrade / surreal db fix)surreal db ml, db 3.x only)| Method | Command |
|---|---|
| curl (macOS / Linux) | curl -sSf https://install.surrealdb.com | sh |
| Windows (PowerShell) | iwr https://windows.surrealdb.com -useb | iex |
| Homebrew | brew install surrealdb/tap/surreal |
| Docker | docker run --rm --pull always -p 8000:8000 surrealdb/surrealdb:latest start |
Verify with surreal --version (launcher) and surreal list (installed components and versions). Pin a specific image tag (not latest) for production. See the install docs for the current set of methods.
surreal is a launcher (v1.x) that dispatches to separately installed
components: db (the database), ent, memory, cloud, ext, kit, lsp.
Server commands live under db: surreal db start, not surreal start. The
bare forms (surreal start, surreal sql, surreal version, …) still run but
are deprecated and print a warning.
Several db versions can be installed at once. Prefix any command with
+VERSION to run that version for just that command:
surreal list # components, default version, installed versions
surreal install [email protected] # install beside existing versions
surreal +4.0.1 db start --user root --pass root memory # run 4.0.1 once
surreal +3.3.5 db export --ns main --db main > dump.surql
surreal use [email protected] # make 4.0.1 the default (no download)
+VERSION must already be installed; otherwise the CLI tells you to run
surreal install db@VERSION. Use +VERSION to try a new major against a copy
of your data, or to export from an old server and import into a new one. See
maintenance.md for install, use, upgrade and
uninstall.
The db surface differs by version — 4.x has no ml, module, upgrade or
v2 subcommands. Check surreal +VERSION db --help.
Besides db, the launcher fronts these components. They are not installed by
default: running one that is missing fails with an install hint (it will not
download without confirmation). Install on demand, and learn each one's
arguments from its own --help rather than guessing — their surface changes
independently of db.
| Component | Purpose | Install |
|---|---|---|
cloud | SurrealDB Cloud: organisations, instances, backups, teams | surreal install cloud |
memory | Agent memory: remember, recall, reflect | surreal install memory |
kit | Schema migrations, seed data, typegen, tests (see the surrealkit skill) | surreal install kit |
lsp | SurrealQL language server for editors (see the surrealql-functions skill) | surreal install lsp |
ent | SurrealDB Enterprise, the licensed edition of the database | surreal install ent |
ext | Build and run WebAssembly extensions | surreal install ext |
surreal list # which components are installed
surreal install cloud # install (add -y to skip the prompt)
surreal cloud --help # discover subcommands and flags
surreal memory --help
When a task needs one of these (managing a Cloud instance, storing or recalling
agent memory), check surreal list, install the component if the user's task
calls for it, then use surreal <component> --help and
surreal <component> <subcommand> --help to work out the arguments. Both
cloud and memory act on remote accounts or data, so confirm destructive
operations (deleting instances, forgetting memories) with the user first.
| Command | Purpose | Reference |
|---|---|---|
surreal db start [PATH] | Run the database server with a chosen storage backend | start.md |
surreal db sql | Interactive REPL or piped, non-interactive querying | sql.md |
surreal db import <FILE> | Load a SurrealQL script into a database | import-export.md |
surreal db export [FILE] | Dump a database to SurrealQL (file or stdout) | import-export.md |
surreal db is-ready | Exit 0 when the server is accepting connections (alias isready) | maintenance.md |
surreal db version | Print the db version and remote server version | maintenance.md |
surreal list / install / use / uninstall | Manage installed component versions | maintenance.md |
surreal upgrade [COMPONENT[@VERSION]] | Upgrade the launcher and components | maintenance.md |
surreal db fix [PATH] | Migrate on-disk storage to the current format | maintenance.md |
surreal db ml <sub> | Import / export SurrealML models (db 3.x only) | maintenance.md |
surreal db validate (SurrealQL file checking) and formatting are covered by the surrealql skill. surreal db mcp (MCP server over stdio) also exists — run surreal db --help to confirm the surface of the installed version. Other components are covered under "Other components" above.
db sql, db import, db export, and db ml share the same connection flags. Each flag has a SURREAL_* environment variable fallback; an explicit flag wins.
| Flag (aliases) | Env var | Notes |
|---|---|---|
-e, --endpoint | — | ws://localhost:8000 for sql; http://localhost:8000 for import/export |
--namespace (--ns) | SURREAL_NAMESPACE | Required for import/export/ml |
--database (--db) | SURREAL_DATABASE | Required for import/export/ml |
-u, --username (--user) | SURREAL_USER | |
-p, --password (--pass) | SURREAL_PASS | |
-t, --token | SURREAL_TOKEN | JWT; use instead of username/password |
--auth-level | SURREAL_AUTH_LEVEL | root (default), namespace/ns, or database/db |
Pass secrets via env vars rather than flags so they do not leak into shell history or process listings.
# 1. Start an authenticated in-memory server (foreground)
surreal db start --user root --pass root memory
# 2. In another shell, open the SQL REPL on namespace/database "main"
surreal db sql --endpoint ws://localhost:8000 \
--user root --pass root --ns main --db main --pretty
# 3. Load a dump into that database
surreal db import --endpoint http://localhost:8000 \
--user root --pass root --ns main --db main backup.surql
surreal db start needs --user/--pass; only use --unauthenticated for throwaway local instances.memory (the default) is ephemeral — data vanishes on exit. Use rocksdb:/surrealkv:// for persistence and tikv:// for distributed clusters. See start.md.surreal db export writes to - (stdout) unless you give a file path; redirect or pipe accordingly.is-ready. It returns a non-zero exit code until the server accepts connections — ideal in healthchecks and scripts.surreal db fix after a major upgrade if the server reports an incompatible storage version, pointing it at the same PATH used by start.+VERSION (or surreal use) so scripts do not change behaviour when the default moves; back up with export before running a new major against existing data.surreal db <command> --help (or surreal +VERSION db …); this skill reflects launcher 1.2 with db 3.3 / 4.0.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
surrealdb-cli, database-server, cli-tool, database-management
10 skills in this plugin
/surrealdb-agent-memory-docsLook up official SurrealDB Agent Memory (formerly Spectron) documentation from surrealdb.com as markdown: quickstarts, mental model, ingest, sessions, recall, reasoning, SDKs, framework integrations, MCP server, REST API, CLI, and configuration. Use when building with or answering questions about SurrealDB Agent Memory. Read-only; sends only search terms and doc paths./surrealdb-docsLook up official SurrealDB documentation (SurrealQL, SDKs, CLI, deployment) from surrealdb.com as markdown. Read-only; sends only search terms and doc paths./surrealdb-jsUsing SurrealDB from JavaScript and TypeScript with the official surrealdb SDK, covering connecting (WebSocket/HTTP and embedded engines), authentication, CRUD, parameterized queries, and live queries. Use when connecting to SurrealDB from Node, Deno, Bun, or the browser, using the surrealdb npm package, or performing CRUD and real-time operations from JS/TS code. Triggers: surrealdb JS, surrealdb.js, new Surreal(), db.query, db.create, db.live, TypeScript SDK, npm i surrealdb./surrealdb-pythonUsing SurrealDB with the Python SDK, covering both client/server mode (WebSocket) and embedded mode (in-memory or file-based). Use when connecting to SurrealDB from Python, using the surrealdb Python package, running SurrealDB embedded without a server, or performing CRUD operations from Python code. Triggers: surrealdb Python, Surreal(), AsyncSurreal(), Python SDK, embedded SurrealDB, mem://, file://./surrealdb-vectorVector search with SurrealDB using HNSW indexes, KNN queries, and similarity scoring. Use when creating vector indexes, querying vectors with KNN distance operators, building semantic search or RAG pipelines, tuning HNSW parameters (EFC, M, M0, distance function, type), or implementing recommendation systems with SurrealDB. Triggers: HNSW, vector, embedding, KNN, cosine, euclidean, semantic search, RAG, vector::distance./surrealkitUse SurrealKit, SurrealDB's schema-management and migration CLI, to scaffold projects from templates, sync schema in development, plan and execute production rollouts (with rollback), statically check SurrealQL without a database, generate JSON/TypeScript types, and write declarative TOML test suites for schemas, permissions, and API endpoints. Use this skill whenever users set up, migrate, type, check, or test a SurrealDB schema with SurrealKit.npx claudepluginhub surrealdb/agent-skills --plugin surrealdbOther plugins' skills for the same job