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: 75% of system RAM). Affects chunk size, concurrency, and run budget when creating a ledger with --from.
--parallelism <N>Number of parallel parse threads for bulk import (0 = auto: system cores, default cap 6). 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
insertInsert data into a ledger
upsertUpsert data (insert or update existing)
updateUpdate with WHERE/DELETE/INSERT patterns
queryQuery a ledger
historyShow change history for an entity
exportExport ledger data
logShow commit log
showShow decoded commit contents (flakes with resolved IRIs)
indexBuild or update the binary index (incremental)
reindexFull reindex from commit history

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
trackTrack remote-only ledgers (no local data)

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)

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)

Configuration

CommandDescription
configManage configuration
prefixManage IRI prefix mappings
completionsGenerate shell completions

Developer Memory

CommandDescription
memoryStore and recall facts, decisions, constraints, preferences, and artifact references
mcpMCP server for IDE agent integration

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, 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
  • Files with .ttl extension → Turtle
  • Files with .json or .jsonld extension → JSON-LD

You can override with --format turtle or --format jsonld.