Skip to Content
LoreHub is now in open beta! 🎉
DocsCommands

Commands

Complete reference for all LoreHub CLI commands.

Global Options

These options work with any command:

OptionDescription
--help, -hShow help for any command
--version, -vShow LoreHub version

Main Commands

lh / lorehub

The main command. Running without arguments shows help.

lh --help lh --version

Browse Mode

lh browse

Launch the interactive TUI (Terminal User Interface) for browsing lores.

lh browse lh browse --current # Current realm only lh browse --realm /path/to/realm

Interactive Controls

KeyAction
↑/↓ or j/kNavigate up/down
/Filter (literal search)
mSwitch search mode (literal/semantic/hybrid)
dDelete selected lore
sView similar lores
?Show help
q or EscQuit

Add Lores

lh add

Add a new lore to the current realm.

Interactive Mode (Recommended):

lh add

Opens a conversational UI with:

  • 📝 Content prompt
  • đź“‚ Type selection
  • ✨ Confidence adjustment (0-100%)

Inline Mode:

lh add "Content of the lore" lh add "Decided to use Redis for session storage" --type decree lh add "User auth tokens expire after 1 hour" --confidence 95

Options

OptionDescriptionDefault
--type <type>Lore type (decree, wisdom, belief, etc.)other
--confidence <number>Confidence level (0-100)80
--why <reason>Additional context-
--provinces <list>Comma-separated provinces-
--sigils <list>Comma-separated sigils-

The interactive mode provides a better experience with visual feedback and easier navigation between fields.

Search for lores across all realms.

lh search "redis" lh search "cache*" # Wildcard search lh search "database decision" --semantic lh search "auth" --type decree lh search "payment" --province billing lh search "security" --realm /path/to/project lh search "api" --current # Current realm only lh search "performance" --limit 20

Options

OptionDescriptionDefault
--type <type>Filter by lore type-
--province <name>Filter by province-
--realm <path>Search specific realm-
--currentCurrent realm onlyfalse
--limit <n>Max results10
--semanticUse semantic search-
--hybridUse hybrid search-
  • * - Match any characters
  • ? - Match single character
  • Examples: redis*, *cache*, auth?

List Lores

lh list

List lores with filtering options.

lh list lh list --type decree lh list --province auth lh list --realm /path/to/project lh list --current lh list --limit 50

Options

OptionDescriptionDefault
--type <type>Filter by type-
--province <name>Filter by province-
--realm <path>List from specific realm-
--currentCurrent realm onlyfalse
--limit <n>Max results20

Realm Management

lh realm

Show information about realms.

lh realm # Current realm info lh realm stats # Detailed statistics lh realm list # List all realms

Delete Lores

lh delete

Delete (archive) a lore.

lh delete <lore-id> lh delete abc-123 --hard # Permanent deletion

Options

OptionDescription
--hardPermanent deletion (cannot be undone)

Restore Lores

lh restore

Restore an archived lore.

lh restore <lore-id>

Export/Import

lh export

Export lores in various formats.

lh export # Export all as JSON lh export --format md # Markdown format lh export --realm /path/to/project lh export --output backup.json

Options

OptionDescriptionDefault
--format <json|md>Output formatjson
--realm <path>Export specific realm-
--output <file>Output filestdout

lh import

Import lores from a backup.

lh import backup.json lh import --realm /path/to/project data.json

Options

OptionDescription
--realm <path>Import to specific realm

Embeddings Management

lh migrate-embeddings

Generate or regenerate embeddings for semantic search.

lh migrate-embeddings # Generate missing embeddings lh migrate-embeddings --force # Regenerate all lh migrate-embeddings --realm /path/to/project

Options

OptionDescription
--forceRegenerate all embeddings
--realm <path>Specific realm only

MCP Server

lh serve-mcp

Start the MCP server for AI assistant integration.

lh serve-mcp

This starts a Model Context Protocol server that AI assistants like Claude can connect to.

Examples

Common Workflows

# Add a technical decision lh add "Decided to use PostgreSQL for main database" --type decree --confidence 90 # Document a lesson learned lh add "Memory leak occurs when webhook retries exceed 10" --type wisdom --why "Discovered during incident on 2024-01-15" # Track a requirement lh add "GDPR compliance requires 30-day data retention" --type requirement --confidence 100 # Search for performance-related lores lh search "performance" --semantic # Find all security risks lh search "*" --type risk # Browse lores in current project lh browse --current # Export knowledge for backup lh export --output knowledge-backup.json

Search Strategies

  1. Exact matches: Use literal search

    lh search "redis"
  2. Conceptual queries: Use semantic search

    lh search "how to make the app faster" --semantic
  3. Best overall results: Use hybrid search (default)

    lh search "authentication best practices" --hybrid

Tips

  1. Use the interactive lh add mode for a better experience
  2. Semantic search finds conceptually related lores even with different wording
  3. Use wildcards (*, ?) for flexible literal searches
  4. Browse mode (lh browse) provides the richest interface
  5. Export regularly to backup your knowledge base
Last updated on