Commands
Complete reference for all LoreHub CLI commands.
Global Options
These options work with any command:
| Option | Description |
|---|---|
--help, -h | Show help for any command |
--version, -v | Show LoreHub version |
Main Commands
lh / lorehub
The main command. Running without arguments shows help.
lh --help
lh --versionBrowse 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/realmInteractive Controls
| Key | Action |
|---|---|
↑/↓ or j/k | Navigate up/down |
/ | Filter (literal search) |
m | Switch search mode (literal/semantic/hybrid) |
d | Delete selected lore |
s | View similar lores |
? | Show help |
q or Esc | Quit |
Add Lores
lh add
Add a new lore to the current realm.
Interactive Mode (Recommended):
lh addOpens 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 95Options
| Option | Description | Default |
|---|---|---|
--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
lh search
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 20Options
| Option | Description | Default |
|---|---|---|
--type <type> | Filter by lore type | - |
--province <name> | Filter by province | - |
--realm <path> | Search specific realm | - |
--current | Current realm only | false |
--limit <n> | Max results | 10 |
--semantic | Use semantic search | - |
--hybrid | Use hybrid search | - |
Wildcard 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 50Options
| Option | Description | Default |
|---|---|---|
--type <type> | Filter by type | - |
--province <name> | Filter by province | - |
--realm <path> | List from specific realm | - |
--current | Current realm only | false |
--limit <n> | Max results | 20 |
Realm Management
lh realm
Show information about realms.
lh realm # Current realm info
lh realm stats # Detailed statistics
lh realm list # List all realmsDelete Lores
lh delete
Delete (archive) a lore.
lh delete <lore-id>
lh delete abc-123 --hard # Permanent deletionOptions
| Option | Description |
|---|---|
--hard | Permanent 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.jsonOptions
| Option | Description | Default |
|---|---|---|
--format <json|md> | Output format | json |
--realm <path> | Export specific realm | - |
--output <file> | Output file | stdout |
lh import
Import lores from a backup.
lh import backup.json
lh import --realm /path/to/project data.jsonOptions
| Option | Description |
|---|---|
--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/projectOptions
| Option | Description |
|---|---|
--force | Regenerate all embeddings |
--realm <path> | Specific realm only |
MCP Server
lh serve-mcp
Start the MCP server for AI assistant integration.
lh serve-mcpThis 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.jsonSearch Strategies
-
Exact matches: Use literal search
lh search "redis" -
Conceptual queries: Use semantic search
lh search "how to make the app faster" --semantic -
Best overall results: Use hybrid search (default)
lh search "authentication best practices" --hybrid
Tips
- Use the interactive
lh addmode for a better experience - Semantic search finds conceptually related lores even with different wording
- Use wildcards (
*,?) for flexible literal searches - Browse mode (
lh browse) provides the richest interface - Export regularly to backup your knowledge base