surrealdb-cli
Skill27 starsChanged 2 months agoMITView on GitHub
Use the `surreal` command-line binary to run a SurrealDB server (in-memory, RocksDB, SurrealKV, or TiKV), open an interactive or piped SQL REPL, import and export databases, check server readiness, upgrade the binary, repair storage, and manage SurrealML models. Use this skill whenever users run, connect to, back up, restore, or operate SurrealDB from the terminal. Triggers: surreal start, surreal sql, surreal import, surreal export, surreal isready, surreal upgrade, surreal fix, surreal ml, SurrealDB CLI, surreal server.
- Pipes a download into a shell
- Installs packages
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- Quad4-Software/skillsedited, first seen Oct 3, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- Quad4-Software/skills★ 1100% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- surrealdb-agent-memory-docsSkill
- surrealdb-docsSkill
- surrealdb-jsSkill
- surrealdb-pythonSkill
- surrealdb-vectorSkill
- surrealkitSkill
- surrealql-functionsSkill
- surrealql-performanceSkill
- surrealqlSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
Verify with surreal version.
- Very specific: line 90
Run
fixafter a major upgrade: if the server reports an incompatible storage version, pointing it at the same PATH used by start.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SurrealDB CLI
A skill for driving the surreal command-line binary — SurrealDB's all-in-one tool for running a server, querying it, and moving data in and out.
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.
When to use this skill
Reference these guidelines when:
- Starting a SurrealDB server, locally or in a container (
surreal start) - Opening the SQL shell or piping queries from a file (
surreal sql) - Importing or exporting a database for backups, seeding, or migration (
surreal import/surreal export) - Gating scripts or CI on server availability (
surreal is-ready) - Upgrading the binary or repairing on-disk storage after an upgrade (
surreal upgrade/surreal fix) - Importing or exporting SurrealML models (
surreal ml)
Installation
| 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. Pin a specific image tag (not latest) for production. See the install docs for the current set of methods.
Command map
| Command | Purpose | Reference |
surreal start [PATH] | Run the database server with a chosen storage backend | start.md |
surreal sql | Interactive REPL or piped, non-interactive querying | sql.md |
surreal import <FILE> | Load a SurrealQL script into a database | import-export.md |
surreal export [FILE] | Dump a database to SurrealQL (file or stdout) | import-export.md |
surreal is-ready | Exit 0 when the server is accepting connections (alias isready) | maintenance.md |
surreal version | Print local tool and remote server versions | maintenance.md |
surreal upgrade | Replace the binary with a newer release | maintenance.md |
surreal fix [PATH] | Migrate on-disk storage to the current format | maintenance.md |
surreal ml <sub> | Import / export SurrealML models | maintenance.md |
surreal validate (SurrealQL file checking) and formatting are covered by the surrealql skill. Newer subcommands (mcp, module) also exist — run surreal help and surreal <command> --help to confirm the surface of an installed version.
Connection flags & env vars
sql, import, export, and 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.
Quick start
# 1. Start an authenticated in-memory server (foreground)
surreal start --user root --pass root memory
# 2. In another shell, open the SQL REPL on namespace/database "main"
surreal sql --endpoint ws://localhost:8000 \
--user root --pass root --ns main --db main --pretty
# 3. Load a dump into that database
surreal import --endpoint http://localhost:8000 \
--user root --pass root --ns main --db main backup.surqlRules & conventions
- Authentication is on by default.
surreal startneeds--user/--pass; only use--unauthenticatedfor throwaway local instances. - Choose a storage backend deliberately.
memory(the default) is ephemeral — data vanishes on exit. Userocksdb:/surrealkv://for persistence andtikv://for distributed clusters. See start.md. - Export defaults to stdout.
surreal exportwrites to-(stdout) unless you give a file path; redirect or pipe accordingly. - Gate CI with
is-ready. It returns a non-zero exit code until the server accepts connections — ideal in healthchecks and scripts. - Run
fixafter a major upgrade if the server reports an incompatible storage version, pointing it at the samePATHused bystart. - The CLI evolves. Confirm flags and subcommands against
surreal <command> --helpfor the installed version; this skill reflects v3.x.
References
- Running a server and storage backends — references/start.md
- Interactive and piped querying — references/sql.md
- Importing and exporting data — references/import-export.md
- Versioning, upgrades, readiness, repair, and ML models — references/maintenance.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

