CLI Guide¶
The Hyper-Extract CLI (he) provides a powerful, easy-to-use interface for knowledge extraction directly from your terminal.
Installation¶
Verify installation:
Quick Command Reference¶
| Command | Purpose | Common Flags |
|---|---|---|
he parse |
Extract knowledge from documents | -t template, -o output, -l language |
he show |
Visualize knowledge graph | — |
he search |
Semantic search in knowledge abstract | -n top-k results |
he talk |
Chat with knowledge abstract | -i interactive, -q query |
he feed |
Add documents incrementally | — |
he info |
Show knowledge abstract statistics | — |
he build-index |
Build/rebuild search index | -f force rebuild |
he list |
List templates and methods | template or method |
he config |
Manage configuration | init, show, set |
Complete Workflow¶
The typical workflow for extracting and interacting with knowledge:
flowchart TB
subgraph Create ["🚀 Create"]
D[📄 Document] -->|he parse| KA[(💡 Knowledge Abstract)]
end
subgraph Enhance ["✨ Enhance (Optional)"]
KA -->|he feed| KA
KA -->|he build-index| IDX[(🔍 Index)]
end
subgraph Explore ["🔍 Explore"]
KA -->|he show| VIS[👁️ Visualize]
IDX -->|he search| SRCH[🔎 Search]
IDX -->|he talk| CHAT[💬 Chat]
end
subgraph Save ["💾 Save"]
KA -->|he dump| DISK[💾 Disk]
end
- Create — Extract knowledge from documents (
he parse) - Enhance — Add documents incrementally (
he feed), build index (he build-index) - Explore — Visualize (
he show), search (he search), chat (he talk) - Save — Persist to disk (
he dump)
→ Detailed Workflow Walkthrough
Getting Started¶
1. Configure API Key¶
2. Extract Knowledge¶
3. Visualize¶
Commands in Detail¶
Knowledge Extraction¶
Exploration¶
he show— Visualize knowledge graphhe search— Semantic searchhe talk— Chat with knowledge abstracthe info— View knowledge abstract statistics
Management¶
he build-index— Build search indexhe list— List available templates/methodshe config— Configuration management
Configuration¶
The CLI stores configuration in ~/.he/config.toml.
Template vs Method¶
Hyper-Extract offers two ways to extract knowledge:
Templates (Recommended for Most Users)¶
Domain-specific, ready-to-use configurations:
Methods (Advanced)¶
Underlying extraction algorithms:
Language Support¶
Templates support multiple languages:
# English
he parse doc.md -t general/biography_graph -l en
# Chinese
he parse doc.md -t general/biography_graph -l zh
Method templates always use English prompts.
Examples by Use Case¶
Research¶
# Extract from a research paper
he parse paper.md -t general/concept_graph -o ./paper_kb/ -l en
# Ask questions about it
he talk ./paper_kb/ -q "What are the main contributions?"
Biography Analysis¶
# Extract from a biography
he parse biography.md -t general/biography_graph -o ./bio_kb/ -l en
# Visualize life events
he show ./bio_kb/
Legal Document Analysis¶
# Extract contract obligations
he parse contract.md -t legal/contract_obligation -o ./contract_kb/ -l en
# Search for specific clauses
he search ./contract_kb/ "termination conditions"
Tips and Best Practices¶
- Use templates for domain-specific tasks — They're optimized for specific use cases
- Build the index — Required for search and chat functionality
- Feed incrementally — Add documents over time without reprocessing
- Choose the right language — Improves extraction quality for non-English documents
Getting Help¶
- View help for any command:
he <command> --help - List all templates:
he list template - List all methods:
he list method - FAQ
- Troubleshooting