dtlv
Datalevin database CLI, REPL, and server
TLDR
SYNOPSIS
dtlv [options] [command] [arguments]
DESCRIPTION
dtlv is the native command-line tool for Datalevin, a durable Datalog database built on LMDB. One binary covers an interactive Clojure REPL, shell-oriented database maintenance, query/transaction execution, an optional networked server, and a stdio MCP server for AI clients.Without arguments (or with repl), dtlv starts a SCI-based interactive console where Datalevin public functions are available without requiring namespaces—the same Clojure APIs used in libraries. exec runs code from arguments or stdin for scripting. Maintenance commands include copy (hot-capable backup, optional compact), dump/load (text or nippy export/import), drop, and stat. serv listens for client connections (default 127.0.0.1:8898, data root /var/lib/datalevin on POSIX). mcp exposes Datalevin over the Model Context Protocol.Install via Homebrew (huahaiy/brew/datalevin), release binaries, Docker (huahaiy/datalevin), or the JVM uberjar. The same executable can also load as a Babashka pod.
PARAMETERS
repl
Enter the interactive shell (default when no command is given).exec [code]
Execute Datalevin/Clojure code from the argument or standard input.copy
Copy a database directory. Requires -d source path; destination is the argument. -c/--compact copies only pages in use.dump
Dump database content to stdout or -f file. -g Datalog-only; -n nippy binary; -a all sub-databases; -l list sub-database names.load
Load data from stdin or -f into the database at -d.drop
Clear or (-D) delete sub-databases.stat
Display database statistics.serv
Run as a server. --host, -p/--port, -r/--root, -v verbose.mcp
Run an MCP server over stdio. -w/--allow-writes enables write tools (off by default).help [command]
Show usage.-d, --dir PATH
Database directory path.-f, --file PATH
Input/output file for dump/load and related operations.-V, --version
Show Datalevin version and exit.
CAVEATS
Native dtlv is built with GraalVM SerialGC and may be less suitable than the JVM uberjar for long-running, highly concurrent servers. Binding serv to a non-loopback address requires DATALEVIN_DEFAULT_PASSWORD. Default server account credentials must be changed for any exposed deployment. mcp write tools stay disabled until --allow-writes.
HISTORY
Datalevin is an open-source Datalog store (Eclipse Public License) by Huahai Yang and contributors, developed for simple durable Datalog with competitive query performance. The dtlv native image and server mode landed early in the project roadmap and remain the primary ops interface.