qi-cli

A guide to qi, a local command-line tool for indexing documents and finding information in them. It supports keyword search, meaning-based search, and answers generated from the indexed sources with citations.

In plain words
What is it for?
Use it to set up a local knowledge base, index or refresh files, search for matching documents, and ask questions about the stored material.
Why use it?
It helps developers search their own documents without sending the whole knowledge base to a remote search service. It separates finding source passages from generating a summarized answer.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/itsmostafa/qi/qi-cli
Any agent
npx skills add itsmostafa/qi --skill qi-cli
Clone the repo
git clone --depth 1 https://github.com/itsmostafa/qi

Made for: Claude Code, Codex.

Per session 125 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,575 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00125 $0.02575
Opus 5 $0.00063 $0.01288
Sonnet 5 $0.00025 $0.00515
Haiku 4.5 $0.00013 $0.00258

Measured yesterday against content hash 0dd3ca209dc7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

qi-cli scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl http://localhost:11434/v1/embeddings -H "Content-Type: application/json" \
skills/qi-cli/SKILL.md · 308 lines

How it starts

The opening of the file, as written. The whole thing — 308 lines — stays where its author put it; the contents beside it link to each section on GitHub.

qi is a local-first knowledge search CLI. It indexes documents into SQLite and supports BM25 full-text search, vector/hybrid search (with a local or remote embedding provider), and LLM-powered Q&A with citations.

Quick Start

qi init                                   # Create config + database
$EDITOR ~/.config/qi/config.yaml         # Add collections and (optionally) providers
qi index                                  # Index the current directory, or a collection
qi doctor                                 # Verify setup
qi search "your query"                    # BM25 keyword search (no provider needed)
qi query "your semantic question"         # Hybrid search (needs embedding provider)
qi ask "what does X do?"                  # RAG Q&A; use sparingly (needs generation provider)

Command selection guidance

Prefer qi index when the task is about adding, refreshing, or organizing source material. Prefer qi search or qi query when the task is about finding relevant documents, passages, or citations. Use qi ask sparingly, only when the user specifically needs a synthesized answer from an LLM rather than retrieved source results.


Commands

qi init

Writes ~/.config/qi/config.yaml (if absent) and initializes the SQLite database.

qi init

qi index [path|collection]

Indexes documents. SHA-256 content hashing means unchanged files are skipped. Embeddings are generated at index time — if you add an embedding provider to config after an initial index run, re-run qi index to populate the missing embeddings.

qi index                              # indexes current working directory
qi index ~/notes                      # any absolute or relative path
qi index notes                        # generated collection name from config

qi search <query>

BM25 full-text search. Fast, offline, no provider needed.

qi search "authentication"
qi search "deploy" -c wiki -n 5

qi query <query>

Semantic/hybrid search. Falls back gracefully to BM25 if the embedding provider is unavailable.

Read the full file on GitHub · 308 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 308 lines · 125 tokens per session scan A 0dd3ca209dc7

Subscribe to this mod's changes

qi-cli is a skill published in the GitHub repository itsmostafa/qi (39 stars, last pushed 21d ago), licensed MIT. It adds 125 tokens to every session and 2,575 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

wegent-knowledge

Knowledge base management and search tools for Wegent. Provides capabilities to list, create, update, and search knowledge bases and documents using RAG retrieval. Use this skill when the user wants to manage knowledge bases, documents, or search for information programmatically.

wecode-ai/Wegent · 51 tokens

openlore

Query and publish to an OpenLore knowledge base over SSH using ordinary shell commands. Use when a task needs project documentation, runbooks, shared team knowledge, or a place to publish findings.

aakarim/OpenLore · 42 tokens

openlore-housekeeping

Audit and maintain a shared OpenLore knowledge base. Use on a schedule or on request to find stale docs, broken links, unreviewed inbox items, and missing skill coverage, then publish an audit report.

aakarim/OpenLore · 48 tokens

kb-document

Document and refresh a software repository in an OKF knowledge bundle. Use when the user asks to document this repo, codebase, architecture, developer workflows, or operational behavior; create repository knowledge; or bring existing repository documentation up to date after code changes. Treats the repository as…

stjbrown/agent-knowledge · 73 tokens

kb-lint

Health-check a knowledge bundle for conformance and drift; optionally auto-fix safe issues.

stjbrown/agent-knowledge · 22 tokens

kb-visualize

Render a knowledge bundle as an interactive graph — native UI where the host supports it, otherwise a self-contained HTML artifact.

stjbrown/agent-knowledge · 29 tokens