Start
Starts the TuringDB server. This is the default command, running turingdb without a subcommand is equivalent to turingdb start.
turingdb start [options]Options
| Flag | Description | Default |
|---|---|---|
-demon | Run TuringDB as a background daemon | off |
-p <port> | HTTP server listen port | 6666 |
-i <addr> | HTTP server listen address | 127.0.0.1 |
-turing-dir <path> | Root Turing home directory | ~/.turing |
-load <graph> | Load a graph at startup (can be repeated) | |
-in-memory | Run without writing graphs to disk | off |
-reset-default | Delete the default graph before starting | off |
-ui | Launch the built-in visualizer proxy | off |
-ui-port <port> | Visualizer proxy port | 8080 |
-auth-on | Require a bearer token on every request. The token is read from the TURINGDB_AUTH_TOKEN environment variable, and must be set when you use this flag | off |
-start-timeout <ms> | Time to wait for daemon readiness | 500 |
Examples
Interactive mode (default):
turingdbDaemon mode on a custom port:
turingdb start -demon -p 7777Daemon mode with the visualizer:
turingdb -demon -uiLoad a graph at startup:
turingdb -load mygraphRequire authentication:
TURINGDB_AUTH_TOKEN=s3cret turingdb start -demon -auth-onServe the binary protocol instead of JSON (see Environment variables):
USE_TURING_PROTO=1 turingdb start -demonServer logs are written to <turing-dir>/logs/turingdb.log. Additional details about an import, such as a LOAD JSONL, are written there.
Interactive shell
Without -demon, turingdb start serves HTTP and opens an interactive Cypher shell. Besides Cypher queries and engine commands, the shell has a few local commands:
| Command | Description |
|---|---|
cd <graph> | Switch the active graph |
checkout change-<id> | Work on a change. checkout <commit> opens a past commit, and checkout returns to the latest commit of main |
read <file> | Run the queries in a file |
help | List the available commands |
quit / exit | Leave the shell |
UI
Launches the built-in graph visualizer.
turingdb start -ui [options]Once started, open the visualizer at http://127.0.0.1:8080 (or the port set via -ui-port).
Options
| Flag | Description | Default |
|---|---|---|
-ui | Launch the built-in visualizer | off |
-ui-port <port> | Visualizer port | 8080 |
Examples
Start TuringDB with the UI:
turingdb -uiStart TuringDB as a daemon with the UI on a custom port:
turingdb -demon -ui -ui-port 9090Stop
Gracefully stops a TuringDB instance running as a daemon. It sends a stop signal through the Unix socket and waits for the process to shut down gracefully.
turingdb stop [options]Options
| Flag | Description | Default |
|---|---|---|
-turing-dir <path> | Root Turing directory of the instance to stop | ~/.turing |
-timeout <ms> / -t <ms> | Time to wait for the process to release its lock | 3000 |
Examples
Stop the default instance:
turingdb stopStop an instance running in a custom directory:
turingdb stop -turing-dir /data/myturingEnvironment variables
| Variable | Read by | Effect |
|---|---|---|
USE_TURING_PROTO | server | 1 makes the server speak TuringDB’s binary protocol instead of JSON over HTTP. The server then serves the binary protocol only: connect with TuringDB(type="native"), and use a server in the default mode for curl, the JSON client and the visualizer. See client backends |
TURINGDB_AUTH_TOKEN | server and Python SDK | With -auth-on, the token the server requires. The SDK sends it as a bearer token when set |
TURINGDB_TYPE | Python SDK | Default client backend (json, native or embedded) when type is not passed |
HTTP API
The Python SDK is a thin client over a single endpoint, so you can query a server from any language. With the default (JSON) server:
curl -s -X POST 'http://localhost:6666/query?graph=mygraph' -d "MATCH (n) RETURN count(n)"- The request body is the query text. The optional query-string parameters
change=<hex change id>andcommit=<hash>target a change or a past commit. - With
-auth-on, sendAuthorization: Bearer <token>. A missing or incorrect token returns HTTP401with an empty body. - A successful response is
{"header": {"column_names": [...], "column_types": [...]}, "data": [chunk, ...], "time": <ms>}, where each chunk is a list of columns. - An error response is
{"error": "PARSE_ERROR", "error_details": "...", "time": <ms>}. The code is one ofPARSE_ERROR,ANALYZE_ERROR,PLAN_ERROR,EXEC_ERROR,CHANGE_NOT_FOUNDorCOMMIT_NOT_FOUND. - Queries on a non-HEAD commit need
LOAD COMMIT '<hash>'first when you talk to the API directly. The CLI and the SDK do this for you.

