---
title: "CLI Reference"
description: "Command reference for xio-lucent, the XI Lucent terminal tool for scripting ingestion, querying, and collection management."
published: 2026-05-14T12:11:12.970589+00:00
updated: 2026-05-14T12:11:12.970589+00:00
tags: ["api", "cli", "lucent", "reference"]
url: https://xiobjects.com/docs/xio/lucent/api/cli
source: XI Objects
---

<!-- xion:doctype xion+markdown -->
<!-- xion:metadata
{
  "version": "1.0",
  "content_type": "application/xion\u002Bmarkdown",
  "source_type": "xi-content/doc",
  "generator": "xio-content-publisher/1.0.0",
  "generated": "2026-05-14T12:10:17.6289790\u002B00:00",
  "encoding": "utf-8",
  "render_intent": "markdown",
  "title": "CLI Reference",
  "slug": "xio/lucent/api/cli",
  "copyright": "\u00A9 2026 XI Objects Inc"
}
-->

# CLI Reference

`xio-lucent` is the XI Lucent terminal tool. Install it as a .NET global tool, point it at a running Lucent API server, and use it to script ingestion, run queries, and manage collections from the command line.

## Install

```bash
dotnet tool install -g Xio.Lucent.Cli
```

## Connect to a server

Store credentials for a server. Credentials are saved locally and reused for subsequent commands.

```bash
xio-lucent login --url https://lucent.example.com/ --api-key sk_live_…
```

---

## Commands

### login

```bash
xio-lucent login --url <url> --api-key <key>
```

Saves the server URL and API key for subsequent commands. Use `--url` to switch between environments.

---

### provision

Downloads and verifies the ONNX model and sqlite-vec extension on the remote server. Call this once after deploying a fresh server.

```bash
xio-lucent provision
```

---

### warmup

Warms up the embedder on the remote server. Call after a cold start if the first query latency matters.

```bash
xio-lucent warmup
```

---

### docs add

Ingests a document from a file or stdin.

```bash
# From a file
xio-lucent docs add <collection> --file spec.pdf

# From stdin
cat notes.md | xio-lucent docs add <collection> --file-name notes.md

# With an explicit document ID
xio-lucent docs add <collection> --file report.docx --document-id q1-report

# With metadata
xio-lucent docs add <collection> --file policy.pdf \
  --meta category=legal --meta status=approved

# As XION-signed content
xio-lucent docs add <collection> --file signed.xion.md --xion
```

**Options:**

| Option | Description |
|--------|-------------|
| `--file <path>` | File to ingest |
| `--file-name <name>` | File name (used with stdin for content type detection) |
| `--document-id <id>` | Explicit document ID |
| `--content-type <type>` | Override content type detection |
| `--meta <key=value>` | Add metadata; repeat for multiple pairs |
| `--xion` | Trigger XION verification before ingestion |

---

### docs list

Lists documents in a collection.

```bash
xio-lucent docs list <collection>
```

Output includes document ID, content type, chunk count, model ID, and ingest timestamp.

---

### docs delete

Removes a document and all its chunks.

```bash
xio-lucent docs delete <collection> <document-id>
```

---

### docs source

Retrieves the preserved XION bytes for a document and writes them to a file.

```bash
xio-lucent docs source <collection> <document-id> -o restored.xion.md
```

Returns an error if the document wasn't ingested as XION content.

---

### query

Runs a hybrid search and prints ranked results.

```bash
# Basic query
xio-lucent query <collection> "what is the cancellation policy"

# Limit results
xio-lucent query <collection> "rate limiting" --top-k 5

# Set score threshold
xio-lucent query <collection> "authentication flow" --threshold 0.4

# Output as JSON
xio-lucent query <collection> "data retention" --json
```

**Options:**

| Option | Description |
|--------|-------------|
| `--top-k <n>` | Maximum results (default 10) |
| `--threshold <score>` | Minimum score cutoff (0–1) |
| `--json` | Output full result as JSON |

Default output shows score, source (`vector`/`text`/`hybrid`), chunk content excerpt, and provenance (file, page number, heading).

---

### export

Streams a collection backup to a file.

```bash
xio-lucent export <collection> -o backup.lucent
```

---

### import

Restores a collection from a backup file.

```bash
xio-lucent import <collection> --file backup.lucent
```

---

## Scripting examples

Ingest all PDFs in a directory:

```bash
for f in docs/*.pdf; do
  xio-lucent docs add specs --file "$f" --meta source=docs-folder
done
```

Export a collection and import it into another environment:

```bash
xio-lucent export my-collection -o backup.lucent
xio-lucent login --url https://staging.lucent.example.com/ --api-key sk_staging_…
xio-lucent import my-collection --file backup.lucent
```

Verify the count after import:

```bash
xio-lucent docs list my-collection | wc -l
```
<!-- xion:trust
{
  "v": 1,
  "canon_v": 1,
  "ctx": "xiobjects.com/content",
  "hash_blake3_hex": "fab189f26e8f96da72a704863510623d16985c082883a2403d9f0e085b13f073",
  "hash_sha256_hex": null,
  "sig_alg": "ed25519",
  "sig_b64": "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lcANBAO6QeydOFNrN75qNyftggYudsxMyl4w9qWkSdZ6hlhrRcbSr\r\niG9Si0kbrIJOwYB/LTBU0RM4Rl\u002Bo9PM3Qp0mPwo=\r\n-----END CERTIFICATE-----\r\n"
  ],
  "key_id": "SDyVO7FvlAM-6CvQ62VZYOBO7JADFqLquUunUABRgKg",
  "created_at": "2026-05-14T12:10:17Z"
}
-->