Skip to navigation

CLI

Search your Interlace collections, manage sources, and trigger syncs, all from the terminal.

The Interlace CLI lets you interact with your collections from the command line. It’s designed for both developers and AI agents: interactive mode gives you rich output with spinners and prompts, while piped or non-TTY mode outputs clean JSON for scripting.

Installation

Verify the installation:

interlace --version

Authentication

Before using the CLI, authenticate with your Interlace account. There are two methods: browser-based login (OAuth) and API key.

Browser login

interlace auth login

This opens a browser window where you sign in via Auth0. The CLI stores the access token and organization ID in ~/.interlace/config.json.

API key login

interlace auth login --api-key

You’ll be prompted for your API key, base URL, and an optional default collection. The key is validated before being saved.

Check auth status

interlace auth status

Log out

interlace auth logout

Searching

The primary use case — search any collection from your terminal:

interlace search "quarterly revenue figures" --collection finance-data
FlagShortDescription
--collection-cCollection readable ID to search
--mode-mSearch mode: instant, classic, or agentic (default: classic)
--top-k-kNumber of results to return (default: 10)
--offsetNumber of results to skip, for pagination (instant/classic only)
--strategy-sRetrieval strategy for instant mode: hybrid, neural, keyword
--thinking-tEnable extended reasoning (agentic mode only)
--filter-fJSON filter groups for narrowing results (all modes)

If you’ve set a default collection (via login or environment variable), you can omit --collection:

interlace search "how does authentication work?"

Search modes

The CLI supports three search modes:

ModeDescription
instantDirect vector search. Fastest, best for simple lookups.
classicAI-optimized search with LLM-generated search plans. (default)
agenticFull agent loop that iteratively searches and reasons over your data.
# Fast vector search
interlace search "error logs" --mode instant
# Keyword search for exact terms
interlace search "ERR-4032" --mode instant --strategy keyword
# AI-planned search (default)
interlace search "how does authentication work?"
# Agentic search — the agent reasons over your data
interlace search "summarize Q4 decisions" --mode agentic
# Agentic with extended thinking
interlace search "compare our auth design with the RFC" --mode agentic --thinking

Agentic search uses a streaming connection and shows real-time progress as the agent works:

▶ Search started
◆ Thinking (iter 1) (2340ms): Analyzing query...
⚡ Tool: search (iter 1) (890ms)
◆ Thinking (iter 2) (1560ms): Evaluating results...
⇅ Reranking: 25 → 10 results (320ms)
✔ Done — 10 results (8432ms)

Filtering

Use --filter to narrow results by source, entity type, date, or other fields:

# Filter to a specific source
interlace search "bugs" --filter '{"conditions": [
{"field": "interlace_system_metadata.source_name", "operator": "equals", "value": "jira"}
]}'
# Filter by date
interlace search "updates" --filter '{"conditions": [
{"field": "created_at", "operator": "greater_than", "value": "2026-01-01T00:00:00Z"}
]}'

Filterable fields include entity_id, name, created_at, updated_at, breadcrumbs.name, interlace_system_metadata.source_name, interlace_system_metadata.entity_type, and more. Operators: equals, not_equals, contains, in, not_in, greater_than, less_than, etc. Conditions within a group are AND’d; multiple groups are OR’d.

Piping results

When stdout is not a TTY (e.g. piped to another command), the CLI automatically outputs JSON:

interlace search "refund policy" | jq -r '.results[0].textual_representation'

You can also force JSON output in interactive mode:

interlace search "deploy steps" --json | jq '.results[0]'

Collections

List collections

interlace collections list

Create a collection

interlace collections create --name "My Data" --readable-id my-data
FlagShortDescription
--name-nDisplay name for the collection (required)
--readable-id-rCustom readable ID (optional, auto-generated if omitted)

Get collection details

interlace collections get my-data-x7k9m

Sources

List source connections

interlace sources list --collection my-data

Add a source connection

interlace sources add slack --collection my-data --name "Team Slack"
FlagShortDescription
--collection-cCollection readable ID
--name-nDisplay name for the connection
--credentialsJSON string with authentication credentials
--configJSON string with source-specific configuration
--sync / --no-syncWhether to trigger a sync after creation (default: sync)

Trigger a sync

interlace sources sync <source-connection-id>

Use --force for a full re-sync instead of incremental:

interlace sources sync <source-connection-id> --force

Global flags

These flags work with any command:

FlagShortDescription
--version-vPrint version and exit
--jsonForce JSON output
--quiet-qSuppress spinners and interactive output (implies --json)

Configuration

The CLI resolves configuration in this order: CLI flags → environment variables → config file → defaults.

Environment variables

VariableDescription
INTERLACE_API_KEYAPI key (overrides config file)
INTERLACE_BASE_URLAPI base URL (default: https://api.useinterlace.com)
INTERLACE_COLLECTIONDefault collection readable ID

Config file

Stored at ~/.interlace/config.json:

{
"api_key": "sk-...",
"base_url": "https://api.useinterlace.com",
"collection": "my-default-collection"
}

Self-hosted instances

Point the CLI at your own Interlace deployment:

interlace auth login --api-key --base-url https://your-interlace-instance.com

Or set the environment variable:

export INTERLACE_BASE_URL="https://your-interlace-instance.com"

For custom Auth0 configurations, set these additional variables:

VariableDescription
INTERLACE_AUTH0_DOMAINAuth0 domain for browser login
INTERLACE_AUTH0_CLIENT_IDAuth0 client ID
INTERLACE_AUTH0_AUDIENCEAuth0 audience

Output behavior

The CLI adapts its output based on context:

ContextBehavior
Interactive terminalRich output with colors, spinners, and tables
Piped or redirectedClean JSON on stdout
--json flagForces JSON output
--quiet flagSuppresses all interactive elements, implies --json

Errors always go to stderr. In JSON mode, errors are formatted as:

{
"error": {
"message": "Collection not found",
"code": "not_found"
}
}

Exit codes: 0 for success, 1 for failure.


Command reference

interlace [--version] [--json] [--quiet] <command>
Commands:
search Search a collection (instant, classic, or agentic)
auth Authentication management
login Authenticate (browser or API key)
status Print current auth state
logout Clear stored credentials
collections Collection management
list List all collections
create Create a new collection
get Get collection details
sources Source connection management
list List source connections
add Add a new source connection
sync Trigger a sync