Skip to content

CLI Reference

The ltm binary provides a comprehensive CLI for managing memories.

Global Options

  • --scope <name>: Set the active scope for the command.
  • LTM_SCOPE: Environment variable to set the default scope.
  • LTM_DB: Environment variable to override the SQLite database path.

Commands

list

List memories, pinned first, archived hidden.

sh
ltm list [limit]

pinned

List only pinned entries.

sh
ltm pinned [limit]

get

Retrieve the full record for a key.

sh
ltm get <key>

Search memories. Uses FTS5 by default, or hybrid (FTS5 + vector) when an embedding endpoint is configured — see Hybrid Retrieval.

sh
ltm search <query> [limit]

save

Insert or update a memory.

sh
ltm save <key> <value|-> [tags]

Use - to read the value from stdin.

delete

Remove a memory and its incident links.

sh
ltm delete <key>

rename

Atomic rename of a key within a scope. Cascades through links.

sh
ltm rename <old_key> <new_key>

verify

Mark a memory as "still current".

sh
ltm verify <key>

supersede

Archive an old memory and link it to a new one.

sh
ltm supersede <old> <new> <value|-> [tags]

pin / unpin

Toggle the pinned flag for a memory.

sh
ltm pin <key>
ltm unpin <key>

Manage directional, typed edges between memories.

sh
ltm link <from_key> <rel> <to_key>
ltm unlink <from_key> <rel> <to_key>

traverse

View the knowledge graph starting from a node.

sh
ltm traverse <key> [depth]

reembed

Backfill embeddings for hybrid retrieval. Embeds rows that don't have a vector yet, or all rows with --force. Requires a configured embedding endpoint.

sh
ltm reembed [--force]

path

Print the path to the SQLite database.

sh
ltm path

serve

Start a local HTTP REST API server — the backend for the web clipper.

sh
ltm serve [port]

Runs on port 8080 by default, bound only to 127.0.0.1. Every route except GET /health requires a bearer token (X-LTM-Token or Authorization: Bearer) — 127.0.0.1 binding alone does not stop a malicious web page from calling the server. The token is generated once, stored 0600 at <db-dir>/serve-token (override with LTM_SERVE_TOKEN), and printed on startup; CORS is returned only for browser-extension origins.

doctor

Print a one-shot health check of the whole setup.

sh
ltm doctor

Reports, as a ✓/✗/⚠ checklist: binary version, store path + memory count, embeddings config/reachability, REST server liveness + token, and the Claude Code recall hook. Reach for it first when something isn't wired up.

Crafted with precision for AI assistants. · Privacy & legal