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, --source attribution
he show Visualize knowledge graph β€”
he export obsidian Export to an Obsidian vault -o output, --name, -f force
he export graphml Export a pairwise graph to GraphML -o output file
he export csv Export nodes/edges as CSV tables -o directory, -f force
he search Semantic search in knowledge abstract -n top-k results, --source, --tag
he talk Chat with knowledge abstract -i interactive, -q query
he feed Add documents incrementally --source attribution
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 remove Delete nodes/edges by key, or soft-remove a single fact --node, --edge, --edit-node, --fact, --dry-run, --document, --strategy
he tag Manage source tags --source, --add, --remove, --list
he list List templates and methods template or method
he template validate Validate a template YAML file --json, --all
he config Manage configuration init, show, llm, embedder

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 -p openai -k YOUR_OPENAI_API_KEY
he config init -p bailian -k YOUR_BAILIAN_API_KEY
he config llm -p deepseek -k YOUR_DEEPSEEK_API_KEY
he config embedder -p openai -k YOUR_OPENAI_API_KEY

Anthropic provides LLM only β€” pair with an OpenAI-compatible embedder:

he config llm -p anthropic -k YOUR_ANTHROPIC_API_KEY
he config embedder -p openai -k YOUR_OPENAI_API_KEY

First install vLLM and start both services:

# Start LLM service (~8GB VRAM)
vllm serve Qwen/Qwen3.5-9B --port 8000 --api-key dummy

# Start Embedding service (~2GB VRAM)
vllm serve BAAI/bge-m3 --task embed --port 8001

Then configure Hyper-Extract:

he config llm -p vllm \
  -u http://localhost:8000/v1 \
  -k dummy \
  -m Qwen/Qwen3.5-9B

he config embedder -p vllm \
  -u http://localhost:8001/v1 \
  -k dummy \
  -m BAAI/bge-m3

Full deployment options (quantization, Docker, etc.) see Provider System.

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

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