FlureeLabs

Fluree CLI

The fluree command-line interface provides a convenient way to manage ledgers, run queries, and perform transactions without running a server.

Installation

Build from source:

cargo build --release -p fluree-db-cli

The binary will be at target/release/fluree.

Quick Start

# Initialize a project directory
fluree init

# Create a ledger
fluree create myledger

# Insert data
fluree insert '@prefix ex: <http://example.org/> .
ex:alice a ex:Person ; ex:name "Alice" .'

# Query
fluree query 'SELECT ?name WHERE { ?s <http://example.org/name> ?name }'

Global Options

OptionDescription
-v, --verboseEnable verbose output
-q, --quietSuppress non-essential output
--no-colorDisable colored output (also respects NO_COLOR env var)
--config <PATH>Path to config file
--memory-budget-mb <MB>Memory budget in MB for bulk import (0 = auto: 80% of system RAM — sized for a dedicated machine). Affects chunk size, concurrency, and run budget when creating a ledger with --from. On a machine running anything else (IDE, Docker, a demo recorder), always pass an explicit budget — the auto default assumes it owns the box and can OOM a co-resident workload. Auto-detected thread count shrinks to fit the budget.
--parallelism <N>Number of parallel parse threads for bulk import (0 = auto: most logical cores, capped to fit the memory budget; explicit values honored as-is, floored at 1). Used when creating a ledger with --from.
-h, --helpPrint help
-V, --versionPrint version

Commands

Core Commands

CommandDescription
initInitialize a new Fluree project directory
createCreate a new ledger
useSet the active ledger
listList all ledgers
infoShow detailed information about a ledger
dropDrop (delete) a ledger
graphManage named graphs within a ledger (list, drop)
branchBranches: create, list, drop, rebase, merge, diff, revert
insertInsert data into a ledger
upsertUpsert data (insert or update existing)
syncMake a named graph's contents exactly the supplied data, committing only the delta
updateUpdate with WHERE/DELETE/INSERT patterns
loadStream a CSV into a ledger as batched Cypher/JSON-LD upserts (LOAD CSV)
queryQuery a ledger
multi-queryRun multiple queries against a single consistent snapshot
graphqlQuery a ledger through a schema derived from its data
validateValidate data against SHACL shapes (report)
modelGovernance model tooling — access profiles, SHACL entity shapes, class hierarchy
historyShow change history for an entity
exportExport ledger data
logShow commit log
verifyVerify commit-chain integrity and referenced objects
showShow decoded commit contents (flakes with resolved IRIs)
indexBuild or update the binary index (incremental)
reindexFull reindex from commit history
sweepReclaim index artifacts no index chain references
icebergMap and manage Iceberg tables as graph sources (map, list, info, drop)
sqlMap and manage SQL tables as graph sources through a Trino-protocol endpoint (map, check, list, info, drop)
materializeBuild a native ledger twin from a virtual (Iceberg/R2RML) graph source
bm25Manage BM25 full-text search indexes (create, list, sync, drop)
docIngest a folder of documents into a searchable graph (structure, chunks, embeddings, indexes) and search it

Remote Sync

CommandDescription
remoteManage remote servers
upstreamManage upstream tracking configuration
fetchFetch refs from a remote
cloneClone a ledger from a remote (full commit download)
pullPull commits from upstream
pushPush to upstream remote
publishCreate on the remote, push, and set upstream in one step
trackTrack remote-only ledgers (no local data)
cacheManage the remote content cache (status, clear)

Clone and pull transfer commits and, by default, binary index data from the remote (pack protocol), so the local ledger is query-ready without a separate reindex. Use --no-indexes to skip index transfer and reduce download size; run fluree reindex afterward if you need the index. Large transfers may prompt for confirmation before streaming.

Server Management

CommandDescription
serverManage the Fluree HTTP server (run, start, stop, status, restart, logs)
clusterRaft cluster administration (init, add, promote, status)

Start a server directly from a project directory — it inherits the same .fluree/ context (config, storage) as the CLI. See server for details.

Implementers

If you're building a custom server that must support the CLI end-to-end (for example, integrating into another app), see:

Authentication

CommandDescription
tokenCreate, inspect, and manage JWS tokens
authManage bearer tokens stored on remotes (login/logout/status/token)

Configuration

CommandDescription
configManage configuration
contextGet or set a ledger's default JSON-LD @context
prefixManage IRI prefix mappings
completionsGenerate shell completions

Developer Memory

CommandDescription
memoryStore and recall facts, decisions, constraints, preferences, and artifact references
mcpUnified MCP server for IDE agents — selectable memory / docs toolsets
docsSearch the embedded, version-pinned documentation (also the MCP docs toolset)

For background, IDE setup, team workflows, and the mem: schema, see the Memory section of the docs.

Project Structure

When you run fluree init, a .fluree/ directory is created with:

.fluree/
├── active          # Currently active ledger name
├── config.toml     # Configuration settings
├── prefixes.json   # IRI prefix mappings
└── storage/        # Ledger data storage

Input Resolution

Commands that accept data input (insert, upsert, sync, update, query) use flexible argument resolution:

ArgumentsBehavior
(none)Active ledger; provide input via -e, -f, or stdin
<arg>Auto-detected: if it looks like a query/data, uses it inline; if it's an existing file, reads from it; otherwise treats it as a ledger name
<ledger> <input>Specified ledger + inline input

Input is resolved in this priority order: -e flag > positional inline > -f flag > positional file > stdin.

Data Format Detection

The CLI auto-detects data format based on content:

  • Lines starting with @prefix or @base → Turtle
  • Content starting with { or [ → JSON-LD
  • Leading MATCH/MERGE/CREATE (/DETACH, or a .cypher/.cyp/.cql file → Cypher
  • SPARQL query/update keywords (SELECT/INSERT/DELETE/PREFIX) → SPARQL
  • Files with .ttl extension → Turtle
  • Files with .json or .jsonld extension → JSON-LD

You can override with --format turtle, --format jsonld, --format sparql, or --format cypher (see the per-command docs for the exact set each accepts).