CLI Usage¶
LORG provides a powerful command-line interface for AI-powered searches.
Basic Usage¶
Commands¶
Search (Default)¶
Run a search query:
With options:
Server Mode¶
Start LORG as an API server:
With custom port:
Help¶
Display help information:
Options¶
Global Options¶
| Option | Short | Description |
|---|---|---|
--version | -V | Display version number |
--help | -h | Display help information |
Search Options¶
| Option | Short | Default | Description |
|---|---|---|---|
--api-key | -k | $OPENAI_API_KEY | OpenAI API key |
--model | -m | gpt-4o-mini | Model to use |
--results | -r | 5 | Max results to return |
Server Options¶
| Option | Short | Default | Description |
|---|---|---|---|
--port | -p | 3000 | Server port |
--api-key | -k | $OPENAI_API_KEY | OpenAI API key |
Examples¶
Basic Search¶
Search with Custom Model¶
Search with More Results¶
Using API Key Directly¶
Start Server on Custom Port¶
Output Format¶
The CLI outputs structured results:
Searching for: "your query"
=== LLM Answer ===
[AI-generated answer to your query]
=== Knowledge Graph ===
{
"entities": [...],
"relationships": [...]
}
=== Keywords ===
keyword1, keyword2, keyword3
=== Search Results ===
1. Result Title
Score: 0.95
Source: https://example.com
Content: Extracted content preview...
Total tokens used: 1234
Error Handling¶
Missing API Key¶
Error: OpenAI API key is required. Please provide it with -k option
or set OPENAI_API_KEY environment variable.
Solution: Set your API key:
No Query Provided¶
Solution: Provide a search query:
Tips¶
-
Quote your queries: Use quotes for multi-word queries
-
Use specific queries: More specific queries yield better results
-
Adjust result count: Use fewer results for faster searches
Next Steps¶
- Server Mode - Run as an API server
- Library Usage - Use in your code