CLI Guide - Hyper-Extract.md4.5 KBit/ai/CLI Guide - Hyper-Extract.md
--- title: "CLI Guide - Hyper-Extract" source_url: "https://yifanfeng97.github.io/Hyper-Extract/latest/cli/" source_site: "yifanfeng97.github.io" clipped_at: "2026-07-10T11:45:31.028416+00:00" clipper: "aiwiki-url-ingest" extractor: "readability_static" source_strategy: "normal_web_clip" source_strategy_label: "普通网页抓取" --- # 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 export obsidian` | Export to an Obsidian vault | `-o` output, `--name`, `-f` force | | `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 clean` | Remove a KA's index (or the whole KA) | `-a` all, `-y` yes | | `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 ``` 1. **Create** — Extract knowledge from documents (`he parse`) 2. **Enhance** — Add documents incrementally (`he feed`), build index (`he build-index`) 3. **Explore** — Visualize (`he show`), search (`he search`), chat (`he talk`) 4. **Save** — Persist to disk (`he dump`) → [Detailed Workflow Walkthrough](workflow/) --- ## Getting Started ### 1\. Configure API Key ``` he parse document.md -t general/biography_graph -o ./output/ -l en ``` ### 3\. Visualize --- ## Commands in Detail - **[`he parse`](commands/parse/)** — Extract knowledge from documents - **[`he feed`](commands/feed/)** — Add documents to existing knowledge abstract ### Exploration ### Management --- ## Configuration The CLI stores configuration in `~/.he/config.toml`. → [Configuration Reference](configuration/) --- ## Template vs Method Hyper\-Extract offers two ways to extract knowledge: ### Templates (Recommended for Most Users) Domain\-specific, ready\-to\-use configurations: ``` he parse doc.md -t general/biography_graph -l en ``` ### Methods (Advanced) Underlying extraction algorithms: ``` he parse doc.md -m light_rag ``` → [Learn when to use each](../concepts/architecture/) --- ## 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 1. **Use templates for domain\-specific tasks** — They're optimized for specific use cases 2. **Build the index** — Required for search and chat functionality 3. **Feed incrementally** — Add documents over time without reprocessing 4. **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](../resources/faq/) - [Troubleshooting](../resources/troubleshooting/)