pyrite

CLI Reference

Command-line interface for searching, reading, writing, and managing knowledge bases.

All commands support --format json for agent consumption. pyrite --version (or -V) prints the installed version.

A command prints its result and nothing else. Add -v (INFO) or -vv (DEBUG) anywhere on the command line for log lines, or set PYRITE_LOG_LEVEL.

# Keyword search
pyrite search "immigration policy"

# Scoped to a KB, type, and mode
pyrite search "immigration" --kb=timeline --type=event --mode=hybrid

# Semantic search (vector similarity)
pyrite search "career transition" --mode=semantic

Read

# Get an entry by ID
pyrite get stephen-miller

# Find what links to an entry
pyrite backlinks stephen-miller --kb=research

# Browse by time
pyrite timeline --from=2025-01-01 --to=2025-06-30

# List collections
pyrite collections list --kb=research

Write

# Create an entry
pyrite create --kb=research --type=person --title="Jane Doe" \
  --body="Senior policy advisor." --tags="policy,doj"

Tasks

pyrite task create -k research --title "Check the 2024 filings"
pyrite task list -k research
pyrite task claim <task-id> -k research -a agent:claude   # atomic: parallel agents never take the same task
pyrite task update <task-id> -k research --status review
pyrite task get <task-id>

The task commands print JSON by default. Pass --format rich, or set PYRITE_FORMAT=rich, for text.

Admin

# Re-index after editing files directly
pyrite index sync

# Check for stale or missing entries. Exits 1 when unhealthy, so CI can
# gate on it; --no-fail restores the always-0 behaviour. -k scopes to one KB.
pyrite index health
pyrite index health -k research

# Embed queued entries (semantic search is eventually consistent)
pyrite index embed

# Auto-discover KBs by kb.yaml presence
pyrite kb discover

# Files with no id: line, and the id each has today (from its title)
pyrite ids missing -k research

# Pin those ids into the files, changing no other byte
pyrite ids pin -k research --dry-run
pyrite ids pin -k research

Schema management

# Show type versions and field changes
pyrite schema diff --kb=research

# Apply migrations to entries
pyrite schema migrate --kb=research

Deploy

# Self-host on a VPS (multi-user is experimental — see /docs/status)
git clone https://github.com/pyrite-wiki/pyrite.git && cd pyrite
bash deploy/selfhost/setup.sh kb.example.com

Install extras

git clone https://github.com/pyrite-wiki/pyrite.git
cd pyrite
pip install -e .                  # Core
pip install -e ".[all]"           # Everything
pip install -e ".[ai]"            # LLM providers
pip install -e ".[semantic]"      # Vector search