Skip to main content

Command

Enum Command 

Source
pub enum Command {
Show 24 variants Version, Init { path: Option<PathBuf>, }, Ingest { path: Option<PathBuf>, stdin: bool, uri: Option<String>, kind: Option<String>, append: bool, store: Option<PathBuf>, no_ignore: bool, include_ext: Vec<String>, follow: bool, follow_interval_secs: u64, follow_idle_timeout_secs: Option<u64>, format: Format, }, Diff { path: Option<PathBuf>, store: Option<PathBuf>, format: Format, }, Export { store: Option<PathBuf>, path: Option<String>, query: Option<String>, output: Option<PathBuf>, }, Forget { pattern: String, store: Option<PathBuf>, apply: bool, format: Format, }, Inspect { store: Option<PathBuf>, limit: usize, format: Format, }, Entities { store: Option<PathBuf>, kind: Option<EntityKindArg>, value_contains: Option<String>, session_id: Option<String>, limit: usize, show_chunks: usize, show_sessions: usize, show_projects: usize, show_users: usize, show_topics: usize, format: Format, }, EntityNeighbors { id: String, store: Option<PathBuf>, kind: Option<EntityKindArg>, session_id: Option<String>, limit: usize, show_chunks: usize, show_sessions: usize, show_projects: usize, show_users: usize, format: Format, }, EntitySessionNeighbors { id: String, store: Option<PathBuf>, kind: Option<EntityKindArg>, session_id: Option<String>, limit: usize, show_sessions: usize, show_projects: usize, show_users: usize, show_chunks: usize, format: Format, }, Sessions { store: Option<PathBuf>, limit: usize, format: Format, }, RelatedSessions { session_id: String, store: Option<PathBuf>, limit: usize, show_entities: usize, format: Format, }, TemporalSessions { session_id: String, store: Option<PathBuf>, window_secs: Option<i64>, limit: usize, format: Format, }, Stash { store: Option<PathBuf>, format: Format, }, Memory { command: MemoryCommand, }, Feedback { chunk_id: String, vote: FeedbackVote, store: Option<PathBuf>, format: Format, }, QuerySuccess { chunk_id: String, store: Option<PathBuf>, format: Format, }, Compact { store: Option<PathBuf>, half_life_secs: u64, minimum_age_secs: u64, dry_run: bool, format: Format, }, Reindex { store: Option<PathBuf>, format: Format, }, Show { id: String, store: Option<PathBuf>, show_entities: usize, format: Format, }, Embed { store: Option<PathBuf>, model: String, ollama_url: String, limit: Option<usize>, format: Format, }, Search {
Show 14 fields query: String, store: Option<PathBuf>, limit: usize, kind: Option<String>, path: Option<String>, session_id: Option<String>, format: SearchFormat, semantic: bool, vec_semantic: bool, hybrid: bool, model: String, instruction: Option<String>, ollama_url: String, min_confidence: Option<f64>,
}, Mcp { store: Option<PathBuf>, port: Option<u16>, }, Query { query: String, store: Option<PathBuf>, limit: usize, kind: Option<String>, path: Option<String>, session_id: Option<String>, format: SearchFormat, min_confidence: Option<f64>, },
}

Variants§

§

Version

Print the lantern version (same output as --version)

§

Init

Initialize a local Lantern store

Fields

§path: Option<PathBuf>

Directory to create (default: ./.lantern)

§

Ingest

Ingest files/directories, or content piped in via stdin

Fields

§path: Option<PathBuf>

File or directory to ingest (omit when using –stdin)

§stdin: bool

Read content from stdin instead of the filesystem

§uri: Option<String>

URI or label to record for stdin content (required with –stdin)

§kind: Option<String>

Kind for stdin content (default: text/plain). Use application/jsonl to trigger the transcript extractor.

§append: bool

Append-only stdin ingest: preserve each batch as its own source under a unique derivative of –uri. Use for session transcripts streamed in chunks under a stable session label.

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§no_ignore: bool

Bypass .lantern-ignore rules (and built-in defaults)

§include_ext: Vec<String>

Additional file extensions to treat as ingestible. Accepts a comma-separated list like proto,sql,tf and normalizes away any leading dots.

§follow: bool

Poll the target path and re-ingest new or modified files on a fixed interval. Runs until interrupted (Ctrl-C). Useful for live transcript directories where agent sessions keep appearing.

§follow_interval_secs: u64

Seconds between polling passes in --follow mode.

§follow_idle_timeout_secs: Option<u64>

Optional idle TTL in seconds. When set, --follow exits after this much time has passed without ingesting a fresh source.

§format: Format

Output format

§

Diff

Compare indexed filesystem sources against the current filesystem

Fields

§path: Option<PathBuf>

Directory to scope the comparison against (also used to find supported files that are not yet indexed). Omit to check every file:// source the store knows about.

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§format: Format

Output format

§

Export

Export sources and chunks as JSON (optionally filtered)

Fields

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§path: Option<String>

Only include sources whose path or URI contains this substring

§query: Option<String>

Only include sources with at least one chunk matching this query

§output: Option<PathBuf>

Write the JSON document to this file instead of stdout

§

Forget

Remove indexed sources (and their chunks) whose path or URI matches

Fields

§pattern: String

Substring to match against source path or URI (required)

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§apply: bool

Actually delete matching sources. Without this flag, forget runs in dry-run mode and only reports what would be removed.

§format: Format

Output format

§

Inspect

Report store status: schema version, counts, recent sources

Fields

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§limit: usize

Maximum number of recent sources to list

§format: Format

Output format

§

Entities

List entities extracted from ingested chunks (URLs, repository slugs, domains, emails, file paths, @-mentions, #hashtags). Ordered by chunk-reference count, then value.

Fields

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§kind: Option<EntityKindArg>

Restrict to a single entity kind (url, repo, domain, email, filepath, mention, hashtag)

§value_contains: Option<String>

Only include entities whose value contains this substring (literal, case-sensitive — % and _ are matched literally).

§session_id: Option<String>

Restrict to entities that appear in chunks tagged with this exact session_id. When set, chunk counts (and any sampled chunk refs) reflect the within-session count, not the global tally.

§limit: usize

Maximum number of entries to return. Total match count is reported independently so truncation is visible.

§show_chunks: usize

Include up to N linked chunk references per entity (chunk id, source uri, short snippet). Default 0 — chunk references are omitted, preserving the cheap flat listing. Set this to walk the entity → chunk graph edge in one call.

§show_sessions: usize

Include up to N sampled session_id values per entity as concrete evidence of which sessions reference it. Default 0 — evidence is omitted, preserving the cheap default listing. Under --session-id the sample collapses to that single id.

§show_projects: usize

Include up to N distinct upstream project values per entity as concrete evidence of which projects reference it. Default 0 — evidence is omitted, preserving the cheap default listing. Under --session-id the sample is scoped to that session’s chunks but does NOT collapse to one project: a session may legitimately span multiple projects.

§show_users: usize

Include up to N distinct upstream user values per entity as concrete evidence of which users reference it. Default 0 — evidence is omitted, preserving the cheap default listing. Under --session-id the sample is scoped to that session’s chunks but does NOT collapse to one user: a single session may legitimately span multiple users (e.g. a shared agent thread).

§show_topics: usize

Include up to N distinct upstream topic values per entity as concrete evidence of which topics reference it. Default 0 — evidence is omitted, preserving the cheap default listing. Under --session-id the sample is scoped to that session’s chunks but does NOT collapse to one topic: a single session may legitimately span multiple topics.

§format: Format

Output format

§

EntityNeighbors

List entities that co-occur with the given entity id (i.e. share at least one chunk with it), ranked by shared-chunk count.

Fields

§id: String

Entity id to look up neighbors for (32-hex value from lantern entities)

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§kind: Option<EntityKindArg>

Restrict neighbors to a single entity kind

§session_id: Option<String>

Restrict the traversal to chunks tagged with this exact session_id. When set, both shared-chunk counts and any sampled shared-chunk evidence are scoped to that session, so a neighbor only surfaces if it co-occurs with the source inside the session.

§limit: usize

Maximum number of neighbors to return

§show_chunks: usize

Include up to N shared chunk references per neighbor (chunk id, source uri, short snippet). Default 0 keeps the flat neighbor view.

§show_sessions: usize

Include up to N sampled distinct session_id values per neighbor, drawn from the chunks shared with the source entity. Default 0 keeps the cheap default shape; under --session-id the sample collapses to that single id.

§show_projects: usize

Include up to N sampled distinct non-NULL project values per neighbor, drawn from the chunks shared with the source entity. Default 0 keeps the cheap default shape; under --session-id the sample is scoped to that session’s chunks but does NOT collapse to one project (a session may legitimately span multiple projects).

§show_users: usize

Include up to N sampled distinct non-NULL user values per neighbor, drawn from the chunks shared with the source entity. Default 0 keeps the cheap default shape; under --session-id the sample is scoped to that session’s chunks but does NOT collapse to one user (a single session may legitimately span multiple users — e.g. a shared agent thread).

§format: Format

Output format

§

EntitySessionNeighbors

List entities that share at least one session with the given entity id, ranked by shared-session count. Unlike entity-neighbors, two entities can surface here without ever sharing a chunk — it is enough that both appear inside the same session. Chunks with no session_id are excluded on both sides.

Fields

§id: String

Entity id to look up session-neighbors for (32-hex value from lantern entities).

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§kind: Option<EntityKindArg>

Restrict neighbors to a single entity kind

§session_id: Option<String>

Restrict the traversal to chunks tagged with this exact session_id. When set, the source must appear in that session for any neighbors to surface, and every surviving neighbor must also appear in that session. source_session_count, per-neighbor shared_sessions, and session_count all collapse to 0 or 1 by construction (the filter pins everything to a single session).

§limit: usize

Maximum number of session-neighbors to return. Total count is reported independently so truncation is visible.

§show_sessions: usize

Include up to N sampled shared session_id values per neighbor as concrete evidence for the same-session edge. Defaults to 0 (no evidence in text or JSON) so the cheap default shape is preserved. When a --session-id filter is set the sample collapses to that single id.

§show_projects: usize

Include up to N sampled distinct non-NULL project values per neighbor, drawn from the chunks (containing the source or neighbor) within the sessions they share. Default 0 keeps the cheap default shape; under --session-id the sample is scoped to that session’s chunks but does NOT collapse to one project (a session may legitimately span multiple projects).

§show_users: usize

Include up to N sampled distinct non-NULL user values per neighbor, drawn from the chunks (containing the source or neighbor) within the sessions they share. Default 0 keeps the cheap default shape; under --session-id the sample is scoped to that session’s chunks but does NOT collapse to one user (a single session may legitimately span multiple users — e.g. a shared agent thread).

§show_chunks: usize

Include up to N sampled chunk references (chunk id, source uri, short snippet) per neighbor as concrete evidence for the same-session edge. Each sampled chunk lives inside a session shared by both entities and references at least one of them — unlike entity-neighbors, the chunk need NOT contain both. Default 0 keeps the cheap default shape; under --session-id the sample is scoped to that single session’s chunks.

§format: Format

Output format

§

Sessions

List sessions grouped from chunk session_id metadata. Read-only; chunks without a session_id are excluded.

Fields

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§limit: usize

Maximum number of sessions to list. Total session count is reported independently so truncation is visible.

§format: Format

Output format

§

RelatedSessions

List sessions that share at least one entity with the given session, ranked by shared-entity count.

Fields

§session_id: String

Source session_id to look up related sessions for.

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§limit: usize

Maximum number of related sessions to return. Total count is reported independently so truncation is visible.

§show_entities: usize

Include up to N sampled shared entities per related session. Default 0 keeps the cheap count-only report.

§format: Format

Output format

§

TemporalSessions

List sessions whose timestamp ranges are closest to the given session.

Fields

§session_id: String

Source session_id to look up temporally related sessions for.

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§window_secs: Option<i64>

Maximum temporal gap in seconds. Omit to rank every timestamped session by gap and session id.

§limit: usize

Maximum number of related sessions to return. Total count is reported independently so truncation is visible.

§format: Format

Output format

§

Stash

Snapshot the current store to a dated tar.gz archive under /stashes/

Fields

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§format: Format

Output format

§

Memory

Create, list, and archive first-class memory records.

Fields

§

Feedback

Record user feedback (thumbs-up / thumbs-down) for a chunk.

The chunk id is the 32-hex value shown in search --format json hits (and the detailed text output). Feedback is additive — repeated up votes keep lifting the score, down votes subtract. Net scores feed into the search confidence blend via compute_confidence.

Fields

§chunk_id: String

Chunk id (full 32-hex value from search output)

§vote: FeedbackVote

Vote direction

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§format: Format

Output format

§

QuerySuccess

Record an observed query-success for a chunk.

This increments query_success_count, the positive-only signal used by confidence scoring to reflect that a chunk actually helped answer a query.

Fields

§chunk_id: String

Chunk id (full 32-hex value from search output)

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§format: Format

Output format

§

Compact

Compact stale access metadata so old reads stop dominating confidence.

Fields

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§half_life_secs: u64

Half-life in seconds for stale access-count decay.

§minimum_age_secs: u64

Minimum age in seconds before a chunk is eligible for decay.

§dry_run: bool

Preview the decay outcome without mutating the store.

§format: Format

Output format

§

Reindex

Rebuild the full-text index from stored chunks

Fields

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§format: Format

Output format

§

Show

Display full provenance and chunk text for a single source

Fields

§id: String

Source id (full 32-hex value or any unambiguous prefix)

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§show_entities: usize

Include up to N extracted entities per chunk (default 0 = off)

§format: Format

Output format

§

Embed

Generate embeddings for chunks that don’t have them yet (via Ollama)

Fields

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§model: String

Ollama embedding model (must be pulled locally)

§ollama_url: String

Ollama base URL

§limit: Option<usize>

Stop after embedding this many chunks (default: no cap)

§format: Format

Output format

§

Search

Keyword, semantic, or hybrid search over ingested chunks

Fields

§query: String

Query string (whitespace-delimited tokens, implicit AND for keyword mode)

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§limit: usize

Maximum number of results to return

§kind: Option<String>

Only include hits whose source kind matches exactly (e.g. text/markdown, text/plain, application/jsonl)

§path: Option<String>

Only include hits whose source path or URI contains this substring

§session_id: Option<String>

Restrict results to an exact session_id match from chunk metadata.

§format: SearchFormat

Output format: summary (compact, default), text (per-hit provenance block), or json (machine-readable envelope)

§semantic: bool

Use dense-embedding cosine similarity instead of FTS5 keyword search

§vec_semantic: bool

Use the vec0-backed semantic helper instead of the brute-force path

§hybrid: bool

Blend keyword BM25 with semantic cosine similarity

§model: String

Ollama embedding model (semantic/hybrid mode)

§instruction: Option<String>

Query-side instruction override for supported embedding models

§ollama_url: String

Ollama base URL (semantic/hybrid mode)

§min_confidence: Option<f64>

Drop hits whose confidence score is below this threshold (0.0-1.0). Filtered chunks do not count as retrievals, so their access metadata is left untouched.

§

Mcp

Expose Lantern over the Model Context Protocol (stdio by default).

Fields

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§port: Option<u16>

Listen on this TCP port instead of stdio (for debugging with MCP clients that can’t launch a child process).

§

Query

Alias for search tuned for broader exploration: defaults to a limit of 20 and the compact summary format. Supports the same filters as search.

Fields

§query: String

Query string (whitespace-delimited tokens, implicit AND)

§store: Option<PathBuf>

Override the store directory (default: nearest ancestor .lantern)

§limit: usize

Maximum number of results to return

§kind: Option<String>

Only include hits whose source kind matches exactly

§path: Option<String>

Only include hits whose source path or URI contains this substring

§session_id: Option<String>

Restrict results to an exact session_id match from chunk metadata.

§format: SearchFormat

Output format

§min_confidence: Option<f64>

Drop hits whose confidence score is below this threshold (0.0-1.0).

Trait Implementations§

Source§

impl Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Command

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Command

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more