CLI Reference

Global Options

lore --version    # Print version
lore --help       # Show help

Commands

lore update

Update Lore CLI to the latest release (or install a specific version).

lore update [--version <semver>]

lore init

Initialize a new Lore database and install AI skill files.

lore init [options]
FlagDescription
--platforms <list>Comma-separated platforms: claude, cursor, codex, opencode, openclaw
--no-skillsSkip skill file generation
--no-heartbeatSkip OpenClaw heartbeat setup
--force-newDelete existing database and start fresh
--yesAccept all defaults (all platforms)
--jsonOutput JSON result

lore clean

Remove all Lore-generated skill files and managed blocks.

lore clean [--yes] [--json]

lore schema

Print the current database schema.

lore schema [<table>]

Without arguments, prints all tables with their columns, types, and constraints. With a table name, prints only that table’s schema. The output includes the baseSchemaHash needed for plans.

lore plan

Dry-run a plan without applying changes.

lore plan -f <file|->

Pass - to read from stdin. Returns risk level, predicted effects, and any validation errors.

lore apply

Apply a plan to the database.

lore apply -f <file|->

Pass - to read from stdin. Executes all operations atomically and creates a versioned commit.

lore read

Query the database with a SELECT statement.

lore read --sql "<SELECT ...>" [--json]

Only SELECT statements are allowed. Use --json for machine-readable output.

lore status

Show the current database status.

lore status [--json]

Reports the current commit, table count, row counts, remote sync state, and last verification time.

lore history

List commit history.

lore history [--verbose] [--json]

Shows all commits in reverse chronological order. With --verbose, includes parent count, revert target, state hash, and revertibility.

lore revert

Create an inverse commit that undoes a previous commit.

lore revert <commit_id>

Revert checks for conflicts with later commits. If later changes touch the same rows or schema, the revert is rejected with conflict details.

lore verify

Check database integrity and hash chain validity.

lore verify [--full]

Quick mode (default) recomputes all commit IDs and runs PRAGMA quick_check. Full mode adds a complete B-tree integrity scan with PRAGMA integrity_check.

lore recover

Restore the database from a snapshot and replay commits.

lore recover <commit_id>

Finds the snapshot for the given commit, copies it, then replays all subsequent commits with full hash verification.

lore remote connect

Configure a remote database for syncing.

# Interactive
lore remote connect

# Non-interactive
lore remote connect --platform <turso|libsql> --url <url> [--token <token>|--clear-token]

lore remote status

Show remote connection and sync state.

lore remote status

lore push

Push local commits to the remote.

lore push

Fails with SYNC_NON_FAST_FORWARD if the remote has commits you don’t have locally. Run lore pull first.

lore pull

Pull remote commits to the local database.

lore pull

lore sync

Pull then push — synchronize in both directions.

lore sync

lore clone

Clone a remote database to a new local instance.

lore clone <url> --platform <turso|libsql> [--force-new]

Creates a fresh local database, connects to the remote, and pulls all commits.

lore studio

Open a web-based database viewer.

lore studio [--port <n>] [--no-open]

Configuration Files

FilePurpose
~/.lore/lore.dbYour database
~/.lore/config.jsonRemote connection settings
~/.lore/credentials.jsonAuth tokens (chmod 600)
~/.lore/snapshots/Automatic database snapshots

Environment Variables

VariableDescription
TURSO_AUTH_TOKENAuth token fallback for Turso (useful in CI)
LORE_INSTALL_DIROverride binary install location
LORE_VERSIONPin installer to a specific release