Skip to content

CLI Reference

Complete reference for the uni command-line interface. The CLI provides tools for data import, query execution, and snapshot management.

Synopsis

uni <COMMAND> [OPTIONS]

Global Options

Option Description
-h, --help Print help information
-V, --version Print version information

Environment Variables

Variable Description
RUST_LOG Log level filter (e.g., info, debug, uni=debug)
AWS_REGION / AWS_DEFAULT_REGION AWS region for S3 access
AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY AWS credentials
AWS_SESSION_TOKEN AWS session token (optional)
AWS_ENDPOINT_URL Custom S3 endpoint (MinIO/LocalStack)
GOOGLE_APPLICATION_CREDENTIALS GCP service account JSON path
AZURE_STORAGE_ACCOUNT Azure storage account
AZURE_STORAGE_ACCESS_KEY Azure access key
AZURE_STORAGE_SAS_TOKEN Azure SAS token

Commands

import — Import Data

Import data from JSONL files into a new or existing database.

Synopsis

uni import <NAME> --papers <PATH> --citations <PATH> [--output <PATH>]

Arguments

Argument Description
<NAME> Dataset name identifier (e.g., semantic-scholar)

Options

Option Description Default
--papers <PATH> Path to vertices JSONL file
--citations <PATH> Path to edges JSONL file
--output <PATH> Output directory for storage ./storage

Examples

uni import semantic-scholar \
  --papers demos/demo01/data/papers.jsonl \
  --citations demos/demo01/data/citations.jsonl \
  --output ./storage

query — Execute Queries

Run OpenCypher queries against a database.

Synopsis

uni query <STATEMENT> [--path <PATH>]

Options

Option Description Default
--path <PATH> Storage directory path ./storage

Example

uni query "MATCH (n:Person) RETURN n.name LIMIT 10" --path ./social-graph

repl — Interactive Shell

Start the interactive UniDB shell for running Cypher queries.

Synopsis

uni repl [--path <PATH>]
# or simply
uni

Options

Option Description Default
--path <PATH> Storage directory path ./storage

Shell Commands

Command Description
help Show available commands
clear Clear the screen
exit, quit Exit the REPL
<cypher> Execute a Cypher query

snapshot — Manage Snapshots

Create, list, and restore database snapshots.

Synopsis

uni snapshot <SUBCOMMAND> [--path <PATH>]

Subcommands

list — List all available snapshots.

uni snapshot list --path ./storage

create — Create a new named snapshot.

uni snapshot create --path ./storage
# or
uni snapshot create "nightly" --path ./storage

restore — Restore the database to a specific snapshot ID.

uni snapshot restore <ID> --path ./storage


Schema and Index Management

Schema inspection and index management are available through Cypher queries in the REPL or via the query command:

# View labels
uni query "CALL uni.schema.labels() YIELD label RETURN label" --path ./graph

# View relationship types
uni query "CALL uni.schema.relationshipTypes() YIELD relationshipType RETURN relationshipType" --path ./graph

# View indexes
uni query "SHOW INDEXES" --path ./graph

Create indexes:

# Vector index (HNSW)
uni query "CREATE VECTOR INDEX paper_embeddings FOR (p:Paper) ON p.embedding OPTIONS { type: 'hnsw' }" --path ./graph

# Scalar index
uni query "CREATE INDEX author_name FOR (a:Author) ON (a.name)" --path ./graph


See Also