From 604203a5ec66fabe0d5a4f35a7241ec228149c73 Mon Sep 17 00:00:00 2001 From: dean Date: Fri, 5 Jun 2026 19:16:15 -0300 Subject: [PATCH 1/2] fix(cli): read kctx version from package metadata --- src/context_cli/cli.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/context_cli/cli.py b/src/context_cli/cli.py index b70a27f..54072c0 100644 --- a/src/context_cli/cli.py +++ b/src/context_cli/cli.py @@ -4,6 +4,7 @@ import json import sys from dataclasses import asdict +from importlib.metadata import PackageNotFoundError, version as _package_version from pathlib import Path from context_cli import PROJECT_ROOT, RESEARCH_STORE_DIR, STORE_DIR @@ -26,6 +27,14 @@ SOURCE_CHOICES = ("all", "docs", "research") +def _kctx_version() -> str: + """Return the kctx version string from the installed package metadata.""" + try: + return f"kctx {_package_version('king-context')}" + except PackageNotFoundError: + return "kctx (version unknown)" + + class AmbiguousDocError(RuntimeError): """Raised when a doc slug exists in multiple stores.""" @@ -284,7 +293,7 @@ def _build_parser() -> argparse.ArgumentParser: description="File-based documentation search for AI agents", ) parser.add_argument( - "--version", action="version", version="kctx 0.1.0" + "--version", action="version", version=_kctx_version() ) subparsers = parser.add_subparsers(dest="command") From 6a329b8f53f28478a659659d4d44f8285a40c11d Mon Sep 17 00:00:00 2001 From: dean Date: Fri, 5 Jun 2026 19:16:15 -0300 Subject: [PATCH 2/2] chore: fix stale docstring and package description --- pyproject.toml | 5 +++-- src/king_context/db.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dd461a6..28f7fc6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "king-context" version = "0.4.0" -description = "Local-first, token-efficient documentation server for LLM context injection" +description = "Local-first, token-efficient retrieval layer for AI agents" readme = "README.md" license = { file = "LICENSE" } requires-python = ">=3.10" @@ -9,7 +9,7 @@ authors = [ { name = "deandevz", email = "bruucetscontact@gmail.com" }, ] keywords = [ - "mcp", + "cli", "llm", "documentation", "search", @@ -17,6 +17,7 @@ keywords = [ "claude", "ai-agents", "rag", + "mcp", ] classifiers = [ "Development Status :: 4 - Beta", diff --git a/src/king_context/db.py b/src/king_context/db.py index 20e55f6..c74ffa9 100644 --- a/src/king_context/db.py +++ b/src/king_context/db.py @@ -673,7 +673,7 @@ def _rerank_with_embeddings( Note: - Returns None if _embedding_model or _embeddings is None - - Filters results by similarity threshold of 0.5 + - Filters results by similarity threshold of 0.3 - Sorts by similarity descending - Skips sections not found in _section_id_to_idx """