Skip to content

CLI Guide

The Hyper-Extract CLI (he) provides a powerful, easy-to-use interface for knowledge extraction directly from your terminal.


Installation

uv tool install hyperextract
pipx install hyperextract

Verify installation:

he --version

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
  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


Getting Started

1. Configure API Key

he config init -k YOUR_OPENAI_API_KEY

2. Extract Knowledge

he parse document.md -t general/biography_graph -o ./output/ -l en

3. Visualize

he show ./output/

Commands in Detail

Knowledge Extraction

  • he parse — Extract knowledge from documents
  • he feed — Add documents to existing knowledge abstract

Exploration

  • he show — Visualize knowledge graph
  • he search — Semantic search
  • he talk — Chat with knowledge abstract
  • he info — View knowledge abstract statistics

Management


Configuration

The CLI stores configuration in ~/.he/config.toml.

Configuration Reference


Template vs Method

Hyper-Extract offers two ways to extract knowledge:

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


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/
# 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
  • Troubleshooting