CLI Reference
@flowrag/cli provides a command-line interface for local usage.
Installation
Section titled “Installation”npm install -g @flowrag/cliCommands
Section titled “Commands”flowrag init
Section titled “flowrag init”Initialize the data directory:
flowrag initflowrag init --data /custom/pathflowrag index
Section titled “flowrag index”Index documents from a directory:
flowrag index <path> [options]| Option | Description |
|---|---|
-d, --data <path> |
Data storage path (default: ./data) |
-f, --force |
Re-index all documents (ignore hashes) |
-i, --interactive |
Review extracted entities interactively |
Examples:
flowrag index ./content # Incremental indexflowrag index ./content --force # Re-index everythingflowrag index ./content --interactive # Review entitiesflowrag index ./content --data /tmp/mydata # Custom data pathflowrag search
Section titled “flowrag search”Search the indexed knowledge base:
flowrag search <query> [options]| Option | Description |
|---|---|
--type <type> |
Search type: chunks, entities (semantic), relations |
--mode <mode> |
Query mode: hybrid, local, global, naive |
--limit <n> |
Max results (default: 10) |
-d, --data <path> |
Data storage path (default: ./data) |
Examples:
flowrag search "how does OCPP work"flowrag search "OCPP" --type entitiesflowrag search "ServiceA" --type relationsflowrag search "query" --mode local --limit 20flowrag stats
Section titled “flowrag stats”Show index statistics:
flowrag statsflowrag stats --data /custom/pathflowrag graph
Section titled “flowrag graph”Knowledge graph operations:
flowrag graph stats # Entity/relation breakdownflowrag graph export # Export as DOT formatflowrag graph export --format dot # Explicit DOT formatInteractive Mode
Section titled “Interactive Mode”When indexing with --interactive, you review each extraction:
📄 Chunk chunk:abc123 — doc:readme
? Entities — select to keep: ◉ [SERVICE] becky-ocpp16 — "Backend OCPP 1.6..." ◉ [PROTOCOL] OCPP 1.6 — "Open Charge Point Protocol..." ◯ [OTHER] WebSocket — "Communication protocol..."
? What next? → Continue to relations ✏️ Edit an entity ➕ Add new entity 📄 Show chunk contentYou can accept, reject, edit entities, or add new ones before they’re stored.