Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

REPL (Interactive Mode)

The REPL provides an interactive session for exploring your index without typing the full laurus command each time.

Starting the REPL

laurus --data-dir ./my_index repl
Laurus REPL (type 'help' for commands, 'quit' to exit)
laurus>

The REPL opens the index at startup and keeps it loaded throughout the session.

Available Commands

CommandDescription
search <query> [limit]Search the index
doc add <id> <json>Add a document
doc get <id>Get a document by ID
doc delete <id>Delete a document by ID
commitCommit pending changes
statsShow index statistics
helpShow available commands
quit / exitExit the REPL

Usage Examples

Searching

laurus> search body:rust
╭──────┬────────┬────────────────────────────────────╮
│ ID   │ Score  │ Fields                             │
├──────┼────────┼────────────────────────────────────┤
│ doc1 │ 0.8532 │ body: Rust is a systems..., title… │
╰──────┴────────┴────────────────────────────────────╯

Adding and Committing Documents

laurus> doc add doc4 {"title":"New Document","body":"Some content here."}
Document 'doc4' added.
laurus> commit
Changes committed.

Retrieving Documents

laurus> doc get doc4
╭──────┬───────────────────────────────────────────────╮
│ ID   │ Fields                                        │
├──────┼───────────────────────────────────────────────┤
│ doc4 │ body: Some content here., title: New Document │
╰──────┴───────────────────────────────────────────────╯

Deleting Documents

laurus> doc delete doc4
Document 'doc4' deleted.
laurus> commit
Changes committed.

Viewing Statistics

laurus> stats
Document count: 3

Features

  • Line editing — Arrow keys, Home/End, and standard readline shortcuts
  • History — Use Up/Down arrows to recall previous commands
  • Ctrl+C / Ctrl+D — Exit the REPL gracefully