CLI

CLI Usage

Manage Liven from the command line.

Basic Commands

Liven provides a comprehensive CLI for managing your database server.

Start Server

liven start
liven start --no-ui # Start without web interface

Stop Server

liven stop

Check Status

liven status

Shows server status including PID, ports, active connections, and broadcast subscribers.

Query Operations

List Streams

liven list
liven list --auth-key YOUR_AUTH_KEY

Interactive Query Shell

liven vibe
liven vibe --auth-key YOUR_AUTH_KEY

Tail Stream

liven tail "stream_name"
liven tail "stream_name" --format json
liven tail "stream_name" --auth-key YOUR_AUTH_KEY

Data Management

Import Data

liven import --path data.jsonl
liven import --path data.jsonl --dry-run
liven import --path data.jsonl --auth-key YOUR_AUTH_KEY

Export Data

liven export --stream "stream_name" --path output.jsonl
liven export --all --path all_data.jsonl
liven export --stream "stream_name" --auth-key YOUR_AUTH_KEY

Security Management

Reset Authentication Key

liven reset-key

Warning: This will invalidate all existing authentication keys and generate a new root key.

Advanced Usage

Environment Variables

# Set log level (info, debug, trace)
RUST_LOG=debug liven start
# Custom data directory
LIVEN_DATA_DIR=/custom/path liven start
# Custom configuration file
liven start --config /path/to/liven.toml

Service Management

Liven integrates with system services for production deployments:

Linux (systemd)

# Install service
sudo cp liven.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable liven
sudo systemctl start liven
# View logs
journalctl -u liven -f
# Manage service
sudo systemctl stop liven
sudo systemctl restart liven
sudo systemctl status liven

macOS (launchd)

# Install launchd service
sudo cp com.livendb.liven.plist /Library/LaunchDaemons/
sudo launchctl load /Library/LaunchDaemons/com.livendb.liven.plist
sudo launchctl start com.livendb.liven
# View logs
tail -f /usr/local/var/log/liven/stdout.log

Windows

# Using NSSM (recommended)
nssm install Liven "C:\liven\liven.exe" start
nssm set Liven AppStdout "C:\liven\logs\stdout.log"
nssm set Liven AppStderr "C:\liven\logs\stderr.log"
nssm start Liven
# Using built-in service manager
sc create Liven binPath= "C:\liven\liven.exe start"
sc start Liven