Skip to content

CLI Reference

HeliosDB Lite is one binary, heliosdb-lite. Run heliosdb-lite --help or heliosdb-lite <command> --help to print the flags your build accepts.

CommandPurpose
startStart the server (PostgreSQL wire protocol plus the REST API)
stopStop a server started with --daemon
statusReport whether a daemonised server is running
initCreate an empty database directory
replOpen the interactive SQL shell on an embedded database
dumpWrite a database to a dump file
restoreLoad a dump file into a database
skillsInstall the bundled agent skills catalog

start

Terminal window
HELIOSDB_JWT_SECRET=<secret> heliosdb-lite start (--data-dir <PATH> | --memory) [OPTIONS]

start needs either --data-dir or --memory. It serves the PostgreSQL wire protocol on the main port and the REST API on the HTTP port.

The REST API signs and verifies tokens with HELIOSDB_JWT_SECRET. The server refuses to start when that variable is unset or empty, so export it first:

Terminal window
export HELIOSDB_JWT_SECRET="$(openssl rand -hex 32)"
heliosdb-lite start --data-dir ./mydb
FlagDescriptionDefault
-d, --data-dir <PATH>Data directory (required unless --memory is used)none
-m, --memoryRun with an in-memory storeoff
-p, --port <PORT>PostgreSQL wire port (overrides [server].port)5432
--listen <ADDR>Listen address (overrides [server].listen_addr)127.0.0.1
-c, --config <PATH>Configuration filenone
--daemonRun the server in the backgroundoff
--pid-file <PATH>PID file, used with --daemon./heliosdb.pid
--dump-on-shutdownWrite a dump when an in-memory server shuts downoff
--dump-schedule <CRON>Periodic dump schedule. Planned: the flag is accepted but not yet acted onnone
--tls-cert <PATH>TLS certificate (PEM); requires --tls-keynone
--tls-key <PATH>TLS private key (PEM); requires --tls-certnone
--auth <METHOD>trust, password, md5 or scram-sha-256trust
--password <PASS>Password, required by every method except trustnone
-v, --verboseDebug logging (unless RUST_LOG is set)off

--auth trust accepts every connection without a password and is meant for local development. For anything reachable from another host, use --auth scram-sha-256 --password ... and keep --listen on 127.0.0.1 unless clients must connect from elsewhere.

Replication flags

Replication needs a binary built with cargo build --release --features ha-tier1; other builds refuse to start with any role except standalone.

FlagDescriptionDefault
--replication-role <ROLE>standalone, primary, standby or observer (the observer role starts no service yet; observer-based split-brain protection is planned)standalone
--replication-port <PORT>WAL streaming port5433
--primary-host <HOST:PORT>Primary that a standby connects tonone
--standby-hosts <LIST>Accepted and printed at startup; standbys connect to the primary without itnone
--observer-hosts <LIST>Accepted; observer-based split-brain protection is plannednone
--sync-mode <MODE>async, semi-sync or syncasync
--http-port <PORT>HTTP port for the REST API and health checks8080
--node-id <UUID>Node identifier, generated when omittedgenerated
--replication-tls <BOOL>Encrypt WAL replication trafficon when --tls-cert is set

Examples

Terminal window
export HELIOSDB_JWT_SECRET="$(openssl rand -hex 32)"
# Persistent server on the default ports (5432 and 8080), loopback only
heliosdb-lite start --data-dir /var/lib/heliosdb
# Password authentication and TLS, reachable from other hosts
heliosdb-lite start --data-dir /var/lib/heliosdb \
--listen 0.0.0.0 \
--auth scram-sha-256 --password "$HELIOSDB_ADMIN_PASSWORD" \
--tls-cert server.crt --tls-key server.key
# In-memory server that writes a dump on shutdown
heliosdb-lite start --memory --dump-on-shutdown
# Background server
heliosdb-lite start --data-dir /var/lib/heliosdb --daemon --pid-file /var/run/heliosdb.pid

Primary and standby:

Terminal window
export HELIOSDB_JWT_SECRET="$(openssl rand -hex 32)"
# Primary
heliosdb-lite start --data-dir /var/lib/heliosdb \
--replication-role primary --replication-port 5433 \
--standby-hosts standby1.example.com:5433 --sync-mode semi-sync
# Standby
heliosdb-lite start --data-dir /var/lib/heliosdb \
--replication-role standby --primary-host primary.example.com:5433

See High Availability for the replication model.

stop

Terminal window
heliosdb-lite stop [--pid-file <PATH>]

Stops the server whose PID is in the PID file (default ./heliosdb.pid). The command asks the process to shut down and, if it is still running after the grace period, kills it.

status

Terminal window
heliosdb-lite status [--pid-file <PATH>]

Prints Status: RUNNING with the PID, or Status: NOT RUNNING when the PID file is missing or the process is gone.

init

Terminal window
heliosdb-lite init [DATA_DIR]

Creates an empty database in DATA_DIR (default ./heliosdb-data).

repl

Terminal window
heliosdb-lite repl [--data-dir <PATH> | --memory] [OPTIONS]
FlagDescriptionDefault
-d, --data-dir <PATH>Data directory./heliosdb-data
-m, --memoryUse an in-memory databaseoff
--dump-on-shutdownWrite a dump when an in-memory session exitsoff
--dump-file <PATH>Dump file used with --dump-on-shutdownnone

Inside the shell, \h lists the meta-commands; see REPL Commands.

dump

Terminal window
heliosdb-lite dump (--data-dir <PATH> | --connection <CONN>) [OPTIONS]
FlagDescriptionDefault
-o, --output <PATH>Dump filebackup.heliodump
-d, --data-dir <PATH>Dump an embedded database directorynone
--connection <CONN>Dump a running server through its PostgreSQL port (PostgreSQL connection string)none
-a, --appendAppend incremental changes to an existing dumpoff
--compression <TYPE>zstd, gzip, brotli or nonezstd
--tables <LIST>Comma-separated tables to include (embedded mode only)all
--tlsEncrypt the server connection; requires --tls-caoff
--tls-ca <PATH>CA certificate (PEM) that signed the server certificatenone
-v, --verboseProgress outputoff
Terminal window
# Embedded database directory
heliosdb-lite dump --data-dir ./mydb --output backup.heliodump
# Selected tables
heliosdb-lite dump --data-dir ./mydb --output users.heliodump --tables users,sessions
# Running server, over TLS
heliosdb-lite dump --connection "host=db.example.com port=5432 user=postgres" \
--tls --tls-ca ca.crt --output remote.heliodump

restore

Terminal window
heliosdb-lite restore --input <PATH> [OPTIONS]
FlagDescriptionDefault
-i, --input <PATH>Dump file to loadrequired
-t, --target <PATH>Target data directory./heliosdb-data-restored
--verifyCheck the dump’s integrity before loading itoff
--connection <CONN>Restore into a running server through its PostgreSQL portnone
--tables <LIST>Comma-separated tables to restoreall
--tlsEncrypt the server connection; requires --tls-caoff
--tls-ca <PATH>CA certificate (PEM) that signed the server certificatenone
-v, --verboseProgress outputoff
Terminal window
heliosdb-lite restore --input backup.heliodump --target ./mydb --verify

See Dump and Restore for workflows.

skills

Terminal window
heliosdb-lite skills install <TARGET> [--symlink] [--catalog claude|codex] [--force]
heliosdb-lite skills list

install copies the bundled agent skills into TARGET (for example ~/.claude/skills). --symlink links instead of copying, --catalog picks the claude (default) or codex catalog, and --force overwrites existing files. list prints the skills bundled with the binary.

Environment variables

VariableUsed byPurpose
HELIOSDB_JWT_SECRETstartSigning secret for REST API tokens. Required: the server will not start without it
HELIOSDB_CORS_ALLOWED_ORIGINSstartComma-separated origins allowed to call the REST API from a browser; when unset, cross-origin requests are denied
HELIOSDB_METRICS_KEYstartRead-only key that unlocks /metrics and the detailed /health body
RUST_LOGallLog filter, for example RUST_LOG=info or RUST_LOG=debug

Checking the version

The CLI has no version subcommand. Use the \version meta-command in the REPL, or GET /version on the HTTP port of a running server:

Terminal window
curl http://127.0.0.1:8080/version