docs-kit 0.1.3__tar.gz → 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. docs_kit-0.1.4/AGENTS.md +66 -0
  2. {docs_kit-0.1.3 → docs_kit-0.1.4}/CLAUDE.md +15 -15
  3. docs_kit-0.1.4/PKG-INFO +265 -0
  4. docs_kit-0.1.4/README.md +226 -0
  5. docs_kit-0.1.4/docs_kit/_version.py +1 -0
  6. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/cli/__main__.py +3 -5
  7. docs_kit-0.1.4/docs_kit/cli/commands.py +557 -0
  8. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/connectors/vector_stores/qdrant.py +81 -52
  9. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/core/config.py +0 -8
  10. docs_kit-0.1.4/docs_kit/templates/claude_code_skill.md +76 -0
  11. docs_kit-0.1.4/docs_kit/templates/claude_desktop_skill.md +31 -0
  12. docs_kit-0.1.4/docs_kit/templates/cursor_agents_md.md +27 -0
  13. docs_kit-0.1.4/docs_kit/templates/skill.md +66 -0
  14. {docs_kit-0.1.3 → docs_kit-0.1.4}/pyproject.toml +3 -5
  15. {docs_kit-0.1.3 → docs_kit-0.1.4}/tests/test_cli.py +6 -81
  16. docs_kit-0.1.4/tests/test_install_cmd.py +443 -0
  17. docs_kit-0.1.3/AGENTS.md +0 -64
  18. docs_kit-0.1.3/PKG-INFO +0 -316
  19. docs_kit-0.1.3/README.md +0 -271
  20. docs_kit-0.1.3/docs_kit/_version.py +0 -1
  21. docs_kit-0.1.3/docs_kit/cli/commands.py +0 -668
  22. docs_kit-0.1.3/docs_kit/mcp/server.py +0 -100
  23. docs_kit-0.1.3/docs_kit/mcp/tools.py +0 -10
  24. docs_kit-0.1.3/tests/test_install_cmd.py +0 -226
  25. docs_kit-0.1.3/tests/test_mcp_tools.py +0 -96
  26. {docs_kit-0.1.3 → docs_kit-0.1.4}/.github/workflows/ci.yml +0 -0
  27. {docs_kit-0.1.3 → docs_kit-0.1.4}/.github/workflows/publish.yml +0 -0
  28. {docs_kit-0.1.3 → docs_kit-0.1.4}/.gitignore +0 -0
  29. {docs_kit-0.1.3 → docs_kit-0.1.4}/CHANGELOG.md +0 -0
  30. {docs_kit-0.1.3 → docs_kit-0.1.4}/CONTRIBUTING.md +0 -0
  31. {docs_kit-0.1.3 → docs_kit-0.1.4}/LICENSE +0 -0
  32. {docs_kit-0.1.3 → docs_kit-0.1.4}/data/sample_docs/claude-code-changelog.md +0 -0
  33. {docs_kit-0.1.3 → docs_kit-0.1.4}/data/sample_docs/the-adventure-of-the-speckled-band.md +0 -0
  34. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs-kit.yaml +0 -0
  35. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/__init__.py +0 -0
  36. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/__main__.py +0 -0
  37. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/agent.py +0 -0
  38. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/cli/__init__.py +0 -0
  39. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/cli/help.py +0 -0
  40. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/connectors/__init__.py +0 -0
  41. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/connectors/embeddings/__init__.py +0 -0
  42. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/connectors/embeddings/base.py +0 -0
  43. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/connectors/embeddings/fastembed.py +0 -0
  44. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/connectors/fetchers/__init__.py +0 -0
  45. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/connectors/fetchers/base.py +0 -0
  46. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/connectors/fetchers/gitbook.py +0 -0
  47. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/connectors/fetchers/llms_txt.py +0 -0
  48. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/connectors/fetchers/mintlify.py +0 -0
  49. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/connectors/parsers/__init__.py +0 -0
  50. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/connectors/parsers/base.py +0 -0
  51. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/connectors/parsers/markdown.py +0 -0
  52. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/connectors/parsers/text.py +0 -0
  53. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/connectors/vector_stores/__init__.py +0 -0
  54. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/connectors/vector_stores/base.py +0 -0
  55. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/core/__init__.py +0 -0
  56. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/core/chunking.py +0 -0
  57. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/core/html_utils.py +0 -0
  58. {docs_kit-0.1.3 → docs_kit-0.1.4}/docs_kit/core/models.py +0 -0
  59. {docs_kit-0.1.3/docs_kit/mcp → docs_kit-0.1.4/docs_kit/templates}/__init__.py +0 -0
  60. {docs_kit-0.1.3 → docs_kit-0.1.4}/npx-wrapper/bin/docs-kit.js +0 -0
  61. {docs_kit-0.1.3 → docs_kit-0.1.4}/npx-wrapper/package.json +0 -0
  62. {docs_kit-0.1.3 → docs_kit-0.1.4}/scripts/smoke_test.sh +0 -0
  63. {docs_kit-0.1.3 → docs_kit-0.1.4}/tests/__init__.py +0 -0
  64. {docs_kit-0.1.3 → docs_kit-0.1.4}/tests/test_agent.py +0 -0
  65. {docs_kit-0.1.3 → docs_kit-0.1.4}/tests/test_chunking.py +0 -0
  66. {docs_kit-0.1.3 → docs_kit-0.1.4}/tests/test_config.py +0 -0
  67. {docs_kit-0.1.3 → docs_kit-0.1.4}/tests/test_embeddings_fastembed.py +0 -0
  68. {docs_kit-0.1.3 → docs_kit-0.1.4}/tests/test_fetcher_gitbook.py +0 -0
  69. {docs_kit-0.1.3 → docs_kit-0.1.4}/tests/test_fetcher_mintlify.py +0 -0
  70. {docs_kit-0.1.3 → docs_kit-0.1.4}/tests/test_models.py +0 -0
  71. {docs_kit-0.1.3 → docs_kit-0.1.4}/tests/test_parsers.py +0 -0
  72. {docs_kit-0.1.3 → docs_kit-0.1.4}/tests/test_vector_store_qdrant.py +0 -0
@@ -0,0 +1,66 @@
1
+ # docs-kit — Agent Instructions
2
+
3
+ ## Scope
4
+
5
+ This document applies to AI agents working on the **docs-kit** codebase: a **PyPI** package (and optional **npx** wrapper) that **fetches documentation** (GitBook, Mintlify, or local files), **stores and embeds it locally** (markdown on disk + Qdrant), and **teaches coding agents to call the CLI** via **installed skills** — not via an MCP server.
6
+
7
+ ---
8
+
9
+ ## What the product does
10
+
11
+ 1. **Fetch** — Fetchers use `/llms-full.txt` and `/llms.txt` on public doc sites; **Mintlify** also falls back to `/sitemap.xml` when needed. **GitBook** and **Mintlify** are supported; `docs-kit ingest` accepts `--provider auto|gitbook|mintlify`.
12
+ 2. **Local storage** — `docs-kit fetch` writes `.md` files; `docs-kit ingest` chunks, embeds with FastEmbed (dense + sparse/BM25), and upserts into local Qdrant. Concurrent CLI processes coordinate with **filelock** on the Qdrant path.
13
+ 3. **Agent integration** — `docs-kit install <agent>` installs **skill templates** (`docs_kit/templates/`) so agents run **`docs-kit` CLI** commands (`query`, `list`, `ingest`, `remove`, `inspect`, `doctor`, etc.). **Claude Desktop** gets a zip to upload in the app; **Cursor** may also get a home-level `AGENTS.md` fallback fragment.
14
+ 4. **Install targets** (see `INSTALL_TARGETS` in `docs_kit/cli/commands.py`): `claude-code`, `claude-desktop`, `cursor`, `codex`, `codex-app`, `codex-desktop`, `opencode`.
15
+
16
+ The **npx** package under `npx-wrapper/` ensures Python 3.11+ and installs/runs the **`docs-kit`** Python module; behavior lives in Python.
17
+
18
+ ---
19
+
20
+ ## Security (Non-Negotiable)
21
+
22
+ - **MUST NOT** read, access, or reference `.env`, `.env.local`, `.env.*`, or any secret/credentials files.
23
+ - **MUST NOT** recommend reading environment files. If config is needed, ask the user for non-sensitive details.
24
+ - **MUST** treat `.env` files as if they do not exist.
25
+
26
+ ---
27
+
28
+ ## Verification After Changes
29
+
30
+ From the repository root:
31
+
32
+ ```bash
33
+ pytest tests/ -v
34
+ ```
35
+
36
+ - **MUST NOT** claim work is complete without a successful test run when behavior or dependencies changed.
37
+
38
+ ---
39
+
40
+ ## Git Commit Workflow
41
+
42
+ When the user asks to commit, stage, or write a commit message:
43
+
44
+ 1. **MUST** analyze staged/unstaged changes via `git status` and `git diff` in the relevant git root.
45
+ 2. **MUST** write a commit message following Conventional Commits:
46
+ - `feat:` — new feature
47
+ - `fix:` — bug fix
48
+ - `chore:` — maintenance, deps, config
49
+ - `docs:` — documentation only
50
+ - `style:` — formatting, no logic change
51
+ - `refactor:` — code restructure
52
+ - `test:` — tests only
53
+ - `perf:` — performance
54
+ 3. **SHOULD** keep subject line under 50 chars, imperative mood; use bullet points in body.
55
+ 4. **SHOULD** suggest splitting into atomic commits if changes span unrelated concerns.
56
+
57
+ ---
58
+
59
+ ## Project Context (Brief)
60
+
61
+ - **Package name:** `docs-kit` (import `docs_kit`, CLI `docs-kit`). **Python:** `>=3.11,<3.14` (`pyproject.toml`); no `mcp` dependency in this tree.
62
+ - **Main types:** `DocsKitConfig` (`docs_kit/core/config.py`), `DocsKitAgent` (`docs_kit/agent.py`).
63
+ - **CLI:** `docs_kit/cli/commands.py` + `docs_kit/cli/__main__.py` — `init`, `fetch`, `ingest`, `query`, `inspect`, `doctor`, `install`, `remove`, `list`.
64
+ - **Fetchers:** `docs_kit/connectors/fetchers/gitbook.py`, `mintlify.py`, shared `llms_txt` helpers.
65
+ - **Skills / install artifacts:** `docs_kit/templates/` (e.g. `skill.md`, `claude_code_skill.md`, `cursor_agents_md.md`).
66
+ - **Docs:** [README.md](README.md) for user-facing quickstart (if it diverges from the repo, trust the code and `docs/project-overview.md` for architecture).
@@ -4,13 +4,12 @@
4
4
 
5
5
  **docs-kit** is a distributable toolkit (PyPI **`docs-kit`**, optional **npm/npx** wrapper) that:
6
6
 
7
- 1. **Pulls** documentation from public **GitBook** sites via AI-oriented endpoints (`/llms-full.txt` or `/llms.txt` and linked pages).
7
+ 1. **Pulls** documentation from public **GitBook** and **Mintlify** sites via AI-oriented endpoints (`/llms-full.txt` or `/llms.txt` and linked pages).
8
8
  2. **Stores** content locally — either as downloaded `.md` files (`docs-kit fetch`) or in a **local Qdrant** vector store after embedding (`docs-kit ingest`).
9
9
  3. **Ingests** with **local embeddings** (FastEmbed by default; no API keys required for embeddings).
10
- 4. **Serves** an **MCP (Model Context Protocol) server** so **Claude Code**, **Claude Desktop**, **Cursor**, and other MCP-capable agents can query the knowledge base (`search_docs`, `list_sources`, `get_collection_info`, `get_full_document`).
11
- 5. **Installs** MCP wiring via `docs-kit install claude-code | claude-desktop | cursor`.
10
+ 4. **Installs skill files** into AI agents (Claude Code, Cursor, Codex, OpenCode, Claude Desktop) that teach them to call `docs-kit` CLI commands directly no background server required.
12
11
 
13
- **Pitch:** Point at any public GitBook docs, embed locally, expose them to your coding agents through MCP.
12
+ **Pitch:** Point at any public docs, embed locally, let your coding agents query them directly via CLI skills.
14
13
 
15
14
  **Target:** Developers who want product/docs RAG in the agent loop without shipping docs to a remote embedding API.
16
15
 
@@ -20,7 +19,7 @@
20
19
 
21
20
  | Channel | What it is |
22
21
  |---------|------------|
23
- | **PyPI** | Canonical install: `pip install docs-kit`. CLI entry: `docs-kit`. |
22
+ | **PyPI** | Canonical install: `pipx install docs-kit`. CLI entry: `docs-kit`. |
24
23
  | **npm/npx** | `npx-wrapper/` — thin Node shim that ensures Python 3.11+ and `pip install docs-kit`, then runs `python -m docs_kit …`. |
25
24
 
26
25
  ---
@@ -29,10 +28,11 @@
29
28
 
30
29
  | Path | Purpose |
31
30
  |------|---------|
32
- | `docs_kit/` | Python package: `DocsKitAgent`, GitBook fetcher, parsers, FastEmbed, Qdrant store, MCP server, Click CLI |
33
- | `docs_kit/cli/` | CLI (`docs-kit init`, `fetch`, `ingest`, `serve`, `install`, `query`, `inspect`, `doctor`) |
34
- | `docs_kit/mcp/` | FastMCP server (`stdio` default; `sse` with optional deps) |
31
+ | `docs_kit/` | Python package: `DocsKitAgent`, GitBook/Mintlify fetchers, parsers, FastEmbed, Qdrant store, Click CLI |
32
+ | `docs_kit/cli/` | CLI (`docs-kit init`, `fetch`, `ingest`, `install`, `query`, `inspect`, `list`, `remove`, `doctor`) |
33
+ | `docs_kit/templates/` | Skill/instruction template files installed by `docs-kit install` |
35
34
  | `docs_kit/connectors/fetchers/gitbook.py` | GitBook `llms-full.txt` / `llms.txt` fetch |
35
+ | `docs_kit/connectors/fetchers/mintlify.py` | Mintlify fetch with sitemap.xml fallback |
36
36
  | `npx-wrapper/` | npm package wrapping the Python CLI |
37
37
  | `tests/` | pytest suite |
38
38
  | `data/sample_docs/` | Sample markdown for local ingest tests |
@@ -43,8 +43,8 @@
43
43
 
44
44
  - **Python** ≥ 3.11, **Click**, **Pydantic** / **pydantic-settings**, **httpx**, **PyYAML**
45
45
  - **Embeddings:** FastEmbed (local)
46
- - **Vector store:** Qdrant (local path, e.g. `.docs-kit/qdrant` in config)
47
- - **MCP:** `mcp` + FastMCP; optional **uvicorn** / **starlette** for SSE (`docs-kit[sse]`)
46
+ - **Vector store:** Qdrant (local embedded, path `~/.docs-kit/qdrant` for user config)
47
+ - **Concurrency:** `filelock` for serializing concurrent embedded Qdrant access
48
48
 
49
49
  ---
50
50
 
@@ -62,7 +62,7 @@
62
62
  From the project root (where `pyproject.toml` lives):
63
63
 
64
64
  ```bash
65
- pytest tests/ -v
65
+ /usr/local/bin/python3.13 -m pytest tests/ -v
66
66
  ```
67
67
 
68
68
  After substantive changes, run the full test suite before claiming completion.
@@ -78,8 +78,8 @@ After substantive changes, run the full test suite before claiming completion.
78
78
 
79
79
  ## Key Paths & Commands
80
80
 
81
- - **Config:** `docs-kit.yaml` (from `docs-kit init`) embedding model, Qdrant `local_path`, MCP transport/port.
82
- - **Fetch only:** `docs-kit fetch <gitbook-url> --output docs-kit-docs`
81
+ - **Config:** auto-created at `~/.docs-kit/docs-kit.yaml` on first use; or project-local `docs-kit.yaml` via `docs-kit init`
82
+ - **Fetch only:** `docs-kit fetch <url> --output docs-kit-docs`
83
83
  - **Ingest URL or path:** `docs-kit ingest https://example.gitbook.io/docs` or `docs-kit ingest ./path/to/markdown`
84
- - **MCP:** `docs-kit serve` (stdio); SSE requires `docs-kit[sse]` and config/flags for `sse`.
85
- - **Agent setup:** `docs-kit install claude-code` (optional `--project` for project-level Claude Code).
84
+ - **Agent setup:** `docs-kit install claude-code` (or `cursor`, `codex`, `opencode`, `claude-desktop`)
85
+ - **No MCP server:** `serve` and `stop` commands do not exist; agents call CLI directly via installed skill files
@@ -0,0 +1,265 @@
1
+ Metadata-Version: 2.3
2
+ Name: docs-kit
3
+ Version: 0.1.4
4
+ Summary: Fetch docs, embed locally, expose to AI agents via skills.
5
+ License: MIT License
6
+
7
+ Copyright (c) 2026 Docs Kit Limited
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
26
+ Requires-Python: <3.14,>=3.11
27
+ Requires-Dist: click>=8.0.0
28
+ Requires-Dist: fastembed>=0.6.0
29
+ Requires-Dist: filelock>=3.0.0
30
+ Requires-Dist: httpx>=0.27.0
31
+ Requires-Dist: pydantic-settings>=2.2.1
32
+ Requires-Dist: pydantic>=2.0.0
33
+ Requires-Dist: pyyaml>=6.0
34
+ Requires-Dist: qdrant-client>=1.10.0
35
+ Provides-Extra: dev
36
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
37
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
38
+ Description-Content-Type: text/markdown
39
+
40
+ # docs-kit
41
+
42
+ [![PyPI version](https://img.shields.io/pypi/v/docs-kit)](https://pypi.org/project/docs-kit/)
43
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
44
+ [![Python](https://img.shields.io/pypi/pyversions/docs-kit)](https://pypi.org/project/docs-kit/)
45
+ [![CI](https://github.com/docs-kit/docs-kit/actions/workflows/ci.yml/badge.svg)](https://github.com/docs-kit/docs-kit/actions/workflows/ci.yml)
46
+
47
+ Fetch docs from GitBook, Mintlify, or local files, embed them locally, and teach AI agents to search them via installed **skills** (CLI commands). No API keys for the default embedding path. No background server or MCP.
48
+
49
+ ## What it does
50
+
51
+ - Fetches public docs from **GitBook** and **Mintlify** sites via `/llms-full.txt` and `/llms.txt`, with a **sitemap.xml** fallback on Mintlify when those endpoints are missing
52
+ - **`docs-kit ingest`:** `--provider auto` (default) uses a combined strategy (llms endpoints → sitemap). **`--provider gitbook`** uses the GitBook-only fetcher; **`--provider mintlify`** uses the same pipeline as `auto`
53
+ - Ingests local `.md` and `.txt` files
54
+ - Stores vectors in **embedded Qdrant** on disk — typically `~/.docs-kit/qdrant` when using the auto-created user config, or `.docs-kit/qdrant` (resolved relative to your `docs-kit.yaml`) for a project-local config from `docs-kit init`
55
+ - **Hybrid retrieval** (dense embeddings + sparse / BM25-style vectors) for `docs-kit query` and agent-driven queries
56
+ - Installs **skill files** into Claude Code, Cursor, Codex, OpenCode, and Claude Desktop so agents run `docs-kit` over the shell
57
+ - Concurrent CLI runs coordinate with a **file lock** on the local Qdrant path
58
+
59
+ ## Install
60
+
61
+ Recommended: **`pipx`** so `docs-kit` is on your PATH:
62
+
63
+ ```bash
64
+ pipx install docs-kit
65
+ ```
66
+
67
+ Install `pipx` if needed:
68
+
69
+ ```bash
70
+ brew install pipx
71
+ pipx ensurepath
72
+ ```
73
+
74
+ Or **`pip`** inside a virtual environment:
75
+
76
+ ```bash
77
+ pip install docs-kit
78
+ ```
79
+
80
+ Optional: the repo includes an **`npx-wrapper/`** npm package that bootstraps Python and runs the same CLI (`npx docs-kit …` when published or linked locally).
81
+
82
+ ## Quickstart
83
+
84
+ ```bash
85
+ # 1. Install (once)
86
+ pipx install docs-kit
87
+
88
+ # 2. Ingest docs
89
+ docs-kit ingest https://docs.example.com
90
+
91
+ # 3. Install skill into your agent
92
+ docs-kit install claude-code # or: cursor, codex, opencode, claude-desktop
93
+
94
+ # 4. Use the agent — it can run docs-kit query / list / ingest when relevant
95
+ ```
96
+
97
+ No server to start. On first use, config and the default vector store path are created under **`~/.docs-kit/`** unless you use a project-local `docs-kit.yaml`.
98
+
99
+ ## How it works
100
+
101
+ docs-kit installs a **skill** (Markdown + YAML frontmatter) into each tool’s skills directory. The skill tells the agent when to use docs-kit and which commands to run (`query`, `list`, `ingest`, `remove`, `inspect`, `doctor`, …). Agents execute **`docs-kit`** via their normal terminal integration.
102
+
103
+ For more architecture detail (config resolution, layout, security posture), see [docs/project-overview.md](docs/project-overview.md).
104
+
105
+ ## Install targets
106
+
107
+ | Command | Where the skill lands |
108
+ |---------|------------------------|
109
+ | `docs-kit install claude-code` | `~/.claude/skills/docs-kit/SKILL.md` |
110
+ | `docs-kit install codex` | `~/.agents/skills/docs-kit/SKILL.md` |
111
+ | `docs-kit install cursor` | `~/.cursor/skills/docs-kit/SKILL.md` + marked block in `~/.cursor/AGENTS.md` when needed |
112
+ | `docs-kit install opencode` | `~/.config/opencode/skills/docs-kit/SKILL.md` (and may mirror under `~/.agents/skills/` if absent) |
113
+ | `docs-kit install claude-desktop` | `~/.docs-kit/exports/claude-desktop/docs-kit.zip` — upload via Claude Desktop **Customize → Skills** |
114
+
115
+ `codex-app` and `codex-desktop` are accepted aliases for the Codex install path.
116
+
117
+ Use **`--project`** with `claude-code` for `.claude/skills/docs-kit/SKILL.md` in the current repo.
118
+
119
+ ## Commands
120
+
121
+ ### `docs-kit install <agent>`
122
+
123
+ Install the docs-kit skill into a supported agent.
124
+
125
+ ```bash
126
+ docs-kit install claude-code
127
+ docs-kit install cursor
128
+ docs-kit install codex
129
+ docs-kit install opencode
130
+ docs-kit install claude-desktop
131
+ docs-kit install claude-code --project
132
+ docs-kit install cursor --config ./docs-kit.yaml
133
+ ```
134
+
135
+ If no config is found, **`~/.docs-kit/docs-kit.yaml`** is created automatically (non-project installs).
136
+
137
+ ### `docs-kit ingest <path-or-url>`
138
+
139
+ Ingest a local file, directory, or documentation URL.
140
+
141
+ ```bash
142
+ docs-kit ingest ./docs
143
+ docs-kit ingest https://docs.example.com
144
+ docs-kit ingest https://docs.example.com --provider gitbook
145
+ docs-kit ingest ./docs --recreate
146
+ ```
147
+
148
+ `--provider`: `auto` (default), `gitbook`, or `mintlify`.
149
+
150
+ ### `docs-kit query <text>`
151
+
152
+ Run hybrid retrieval from the CLI.
153
+
154
+ ```bash
155
+ docs-kit query "How do I authenticate?"
156
+ docs-kit query "getting started" --limit 3
157
+ docs-kit query "..." --config ./docs-kit.yaml
158
+ ```
159
+
160
+ ### `docs-kit list`
161
+
162
+ List ingested sources with ingestion timestamps.
163
+
164
+ ```bash
165
+ docs-kit list
166
+ docs-kit list --config ./docs-kit.yaml
167
+ ```
168
+
169
+ ### `docs-kit fetch <url>`
170
+
171
+ Download **GitBook** docs as Markdown files only (does not embed). For Mintlify or mixed hosting, use **`docs-kit ingest`** or copy files locally first.
172
+
173
+ ```bash
174
+ docs-kit fetch https://docs.example.com
175
+ docs-kit fetch https://docs.example.com --output ./downloaded-docs
176
+ ```
177
+
178
+ ### `docs-kit remove <source>`
179
+
180
+ Remove an ingested source by URL or file path.
181
+
182
+ ```bash
183
+ docs-kit remove https://docs.example.com/page
184
+ docs-kit remove ./docs/getting-started.md
185
+ ```
186
+
187
+ ### `docs-kit inspect`
188
+
189
+ Show collection stats and embedding settings.
190
+
191
+ ```bash
192
+ docs-kit inspect
193
+ docs-kit inspect --config ./docs-kit.yaml
194
+ ```
195
+
196
+ ### `docs-kit doctor`
197
+
198
+ Check `docs-kit` on PATH, effective config, Qdrant path / connectivity, and which skills are installed.
199
+
200
+ ```bash
201
+ docs-kit doctor
202
+ docs-kit doctor --config ./docs-kit.yaml
203
+ ```
204
+
205
+ ### `docs-kit init`
206
+
207
+ Create a project-local **`docs-kit.yaml`** (optional if you rely on `~/.docs-kit/docs-kit.yaml`).
208
+
209
+ ```bash
210
+ docs-kit init
211
+ docs-kit init --dir ./sandbox
212
+ ```
213
+
214
+ ## Configuration
215
+
216
+ **Resolution order:** `--config` → `./docs-kit.yaml` in the current working directory → `~/.docs-kit/docs-kit.yaml` (created on first use when applicable).
217
+
218
+ Example **project-local** `docs-kit.yaml` from `docs-kit init`:
219
+
220
+ ```yaml
221
+ embedding:
222
+ provider: fastembed
223
+ model: BAAI/bge-small-en-v1.5
224
+
225
+ vector_store:
226
+ provider: qdrant
227
+ local_path: .docs-kit/qdrant # resolved relative to this file’s directory
228
+ collection_name: knowledge_base
229
+ retrieval_limit: 5
230
+ score_threshold: 0.35
231
+
232
+ ingestion:
233
+ chunk_size: 800
234
+ chunk_overlap: 120
235
+ bm25_model: Qdrant/bm25
236
+ ```
237
+
238
+ The auto-created **user** config under `~/.docs-kit/` sets `local_path` to an absolute directory under **`~/.docs-kit/qdrant`**. To use a **remote** Qdrant instance, set `vector_store.url` and leave local storage unused.
239
+
240
+ ## Supported sources
241
+
242
+ | Source | Strategy |
243
+ |--------|----------|
244
+ | GitBook sites | `/llms-full.txt` → `/llms.txt` (GitBook fetcher); `auto` / `mintlify` use the broader pipeline below |
245
+ | Mintlify & typical llms.txt sites | `/llms-full.txt` → `/llms.txt` → `/sitemap.xml` |
246
+ | Local `.md` / `.txt` | Read from disk |
247
+
248
+ ## Requirements
249
+
250
+ - **Python 3.11–3.13** (`requires-python` excludes 3.14+ while dependencies such as `onnxruntime` lack wheels)
251
+ - Disk space for the embedding model (on the order of tens of MB for the default model)
252
+
253
+ If your default `python` is 3.14:
254
+
255
+ ```bash
256
+ pipx install docs-kit --python python3.13
257
+ ```
258
+
259
+ ## Migration from v0.1.x
260
+
261
+ Older releases configured an **MCP server** in agent settings. That integration has been removed in favor of **skills + CLI**.
262
+
263
+ 1. Remove legacy **`mcpServers.docs-kit`** (or equivalent) from `~/.claude/settings.json`, Cursor MCP config, `~/.codex/config.toml`, etc.
264
+ 2. Run **`docs-kit install <agent>`** again to install skills.
265
+ 3. Existing **`~/.docs-kit/docs-kit.yaml`** and ingested data remain valid; any unused **`mcp:`** section in YAML can be deleted for clarity.
@@ -0,0 +1,226 @@
1
+ # docs-kit
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/docs-kit)](https://pypi.org/project/docs-kit/)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5
+ [![Python](https://img.shields.io/pypi/pyversions/docs-kit)](https://pypi.org/project/docs-kit/)
6
+ [![CI](https://github.com/docs-kit/docs-kit/actions/workflows/ci.yml/badge.svg)](https://github.com/docs-kit/docs-kit/actions/workflows/ci.yml)
7
+
8
+ Fetch docs from GitBook, Mintlify, or local files, embed them locally, and teach AI agents to search them via installed **skills** (CLI commands). No API keys for the default embedding path. No background server or MCP.
9
+
10
+ ## What it does
11
+
12
+ - Fetches public docs from **GitBook** and **Mintlify** sites via `/llms-full.txt` and `/llms.txt`, with a **sitemap.xml** fallback on Mintlify when those endpoints are missing
13
+ - **`docs-kit ingest`:** `--provider auto` (default) uses a combined strategy (llms endpoints → sitemap). **`--provider gitbook`** uses the GitBook-only fetcher; **`--provider mintlify`** uses the same pipeline as `auto`
14
+ - Ingests local `.md` and `.txt` files
15
+ - Stores vectors in **embedded Qdrant** on disk — typically `~/.docs-kit/qdrant` when using the auto-created user config, or `.docs-kit/qdrant` (resolved relative to your `docs-kit.yaml`) for a project-local config from `docs-kit init`
16
+ - **Hybrid retrieval** (dense embeddings + sparse / BM25-style vectors) for `docs-kit query` and agent-driven queries
17
+ - Installs **skill files** into Claude Code, Cursor, Codex, OpenCode, and Claude Desktop so agents run `docs-kit` over the shell
18
+ - Concurrent CLI runs coordinate with a **file lock** on the local Qdrant path
19
+
20
+ ## Install
21
+
22
+ Recommended: **`pipx`** so `docs-kit` is on your PATH:
23
+
24
+ ```bash
25
+ pipx install docs-kit
26
+ ```
27
+
28
+ Install `pipx` if needed:
29
+
30
+ ```bash
31
+ brew install pipx
32
+ pipx ensurepath
33
+ ```
34
+
35
+ Or **`pip`** inside a virtual environment:
36
+
37
+ ```bash
38
+ pip install docs-kit
39
+ ```
40
+
41
+ Optional: the repo includes an **`npx-wrapper/`** npm package that bootstraps Python and runs the same CLI (`npx docs-kit …` when published or linked locally).
42
+
43
+ ## Quickstart
44
+
45
+ ```bash
46
+ # 1. Install (once)
47
+ pipx install docs-kit
48
+
49
+ # 2. Ingest docs
50
+ docs-kit ingest https://docs.example.com
51
+
52
+ # 3. Install skill into your agent
53
+ docs-kit install claude-code # or: cursor, codex, opencode, claude-desktop
54
+
55
+ # 4. Use the agent — it can run docs-kit query / list / ingest when relevant
56
+ ```
57
+
58
+ No server to start. On first use, config and the default vector store path are created under **`~/.docs-kit/`** unless you use a project-local `docs-kit.yaml`.
59
+
60
+ ## How it works
61
+
62
+ docs-kit installs a **skill** (Markdown + YAML frontmatter) into each tool’s skills directory. The skill tells the agent when to use docs-kit and which commands to run (`query`, `list`, `ingest`, `remove`, `inspect`, `doctor`, …). Agents execute **`docs-kit`** via their normal terminal integration.
63
+
64
+ For more architecture detail (config resolution, layout, security posture), see [docs/project-overview.md](docs/project-overview.md).
65
+
66
+ ## Install targets
67
+
68
+ | Command | Where the skill lands |
69
+ |---------|------------------------|
70
+ | `docs-kit install claude-code` | `~/.claude/skills/docs-kit/SKILL.md` |
71
+ | `docs-kit install codex` | `~/.agents/skills/docs-kit/SKILL.md` |
72
+ | `docs-kit install cursor` | `~/.cursor/skills/docs-kit/SKILL.md` + marked block in `~/.cursor/AGENTS.md` when needed |
73
+ | `docs-kit install opencode` | `~/.config/opencode/skills/docs-kit/SKILL.md` (and may mirror under `~/.agents/skills/` if absent) |
74
+ | `docs-kit install claude-desktop` | `~/.docs-kit/exports/claude-desktop/docs-kit.zip` — upload via Claude Desktop **Customize → Skills** |
75
+
76
+ `codex-app` and `codex-desktop` are accepted aliases for the Codex install path.
77
+
78
+ Use **`--project`** with `claude-code` for `.claude/skills/docs-kit/SKILL.md` in the current repo.
79
+
80
+ ## Commands
81
+
82
+ ### `docs-kit install <agent>`
83
+
84
+ Install the docs-kit skill into a supported agent.
85
+
86
+ ```bash
87
+ docs-kit install claude-code
88
+ docs-kit install cursor
89
+ docs-kit install codex
90
+ docs-kit install opencode
91
+ docs-kit install claude-desktop
92
+ docs-kit install claude-code --project
93
+ docs-kit install cursor --config ./docs-kit.yaml
94
+ ```
95
+
96
+ If no config is found, **`~/.docs-kit/docs-kit.yaml`** is created automatically (non-project installs).
97
+
98
+ ### `docs-kit ingest <path-or-url>`
99
+
100
+ Ingest a local file, directory, or documentation URL.
101
+
102
+ ```bash
103
+ docs-kit ingest ./docs
104
+ docs-kit ingest https://docs.example.com
105
+ docs-kit ingest https://docs.example.com --provider gitbook
106
+ docs-kit ingest ./docs --recreate
107
+ ```
108
+
109
+ `--provider`: `auto` (default), `gitbook`, or `mintlify`.
110
+
111
+ ### `docs-kit query <text>`
112
+
113
+ Run hybrid retrieval from the CLI.
114
+
115
+ ```bash
116
+ docs-kit query "How do I authenticate?"
117
+ docs-kit query "getting started" --limit 3
118
+ docs-kit query "..." --config ./docs-kit.yaml
119
+ ```
120
+
121
+ ### `docs-kit list`
122
+
123
+ List ingested sources with ingestion timestamps.
124
+
125
+ ```bash
126
+ docs-kit list
127
+ docs-kit list --config ./docs-kit.yaml
128
+ ```
129
+
130
+ ### `docs-kit fetch <url>`
131
+
132
+ Download **GitBook** docs as Markdown files only (does not embed). For Mintlify or mixed hosting, use **`docs-kit ingest`** or copy files locally first.
133
+
134
+ ```bash
135
+ docs-kit fetch https://docs.example.com
136
+ docs-kit fetch https://docs.example.com --output ./downloaded-docs
137
+ ```
138
+
139
+ ### `docs-kit remove <source>`
140
+
141
+ Remove an ingested source by URL or file path.
142
+
143
+ ```bash
144
+ docs-kit remove https://docs.example.com/page
145
+ docs-kit remove ./docs/getting-started.md
146
+ ```
147
+
148
+ ### `docs-kit inspect`
149
+
150
+ Show collection stats and embedding settings.
151
+
152
+ ```bash
153
+ docs-kit inspect
154
+ docs-kit inspect --config ./docs-kit.yaml
155
+ ```
156
+
157
+ ### `docs-kit doctor`
158
+
159
+ Check `docs-kit` on PATH, effective config, Qdrant path / connectivity, and which skills are installed.
160
+
161
+ ```bash
162
+ docs-kit doctor
163
+ docs-kit doctor --config ./docs-kit.yaml
164
+ ```
165
+
166
+ ### `docs-kit init`
167
+
168
+ Create a project-local **`docs-kit.yaml`** (optional if you rely on `~/.docs-kit/docs-kit.yaml`).
169
+
170
+ ```bash
171
+ docs-kit init
172
+ docs-kit init --dir ./sandbox
173
+ ```
174
+
175
+ ## Configuration
176
+
177
+ **Resolution order:** `--config` → `./docs-kit.yaml` in the current working directory → `~/.docs-kit/docs-kit.yaml` (created on first use when applicable).
178
+
179
+ Example **project-local** `docs-kit.yaml` from `docs-kit init`:
180
+
181
+ ```yaml
182
+ embedding:
183
+ provider: fastembed
184
+ model: BAAI/bge-small-en-v1.5
185
+
186
+ vector_store:
187
+ provider: qdrant
188
+ local_path: .docs-kit/qdrant # resolved relative to this file’s directory
189
+ collection_name: knowledge_base
190
+ retrieval_limit: 5
191
+ score_threshold: 0.35
192
+
193
+ ingestion:
194
+ chunk_size: 800
195
+ chunk_overlap: 120
196
+ bm25_model: Qdrant/bm25
197
+ ```
198
+
199
+ The auto-created **user** config under `~/.docs-kit/` sets `local_path` to an absolute directory under **`~/.docs-kit/qdrant`**. To use a **remote** Qdrant instance, set `vector_store.url` and leave local storage unused.
200
+
201
+ ## Supported sources
202
+
203
+ | Source | Strategy |
204
+ |--------|----------|
205
+ | GitBook sites | `/llms-full.txt` → `/llms.txt` (GitBook fetcher); `auto` / `mintlify` use the broader pipeline below |
206
+ | Mintlify & typical llms.txt sites | `/llms-full.txt` → `/llms.txt` → `/sitemap.xml` |
207
+ | Local `.md` / `.txt` | Read from disk |
208
+
209
+ ## Requirements
210
+
211
+ - **Python 3.11–3.13** (`requires-python` excludes 3.14+ while dependencies such as `onnxruntime` lack wheels)
212
+ - Disk space for the embedding model (on the order of tens of MB for the default model)
213
+
214
+ If your default `python` is 3.14:
215
+
216
+ ```bash
217
+ pipx install docs-kit --python python3.13
218
+ ```
219
+
220
+ ## Migration from v0.1.x
221
+
222
+ Older releases configured an **MCP server** in agent settings. That integration has been removed in favor of **skills + CLI**.
223
+
224
+ 1. Remove legacy **`mcpServers.docs-kit`** (or equivalent) from `~/.claude/settings.json`, Cursor MCP config, `~/.codex/config.toml`, etc.
225
+ 2. Run **`docs-kit install <agent>`** again to install skills.
226
+ 3. Existing **`~/.docs-kit/docs-kit.yaml`** and ingested data remain valid; any unused **`mcp:`** section in YAML can be deleted for clarity.
@@ -0,0 +1 @@
1
+ __version__ = "0.1.4"
@@ -1,5 +1,5 @@
1
1
  import click
2
- from docs_kit.cli.commands import init_cmd, ingest_cmd, serve_cmd, stop_cmd, inspect_cmd, doctor_cmd, query_cmd, fetch_cmd, install_cmd, remove_cmd, list_cmd
2
+ from docs_kit.cli.commands import init_cmd, ingest_cmd, inspect_cmd, doctor_cmd, query_cmd, fetch_cmd, install_cmd, remove_cmd, list_cmd
3
3
  from docs_kit.cli.help import DocsKitGroup, HELP_CONTEXT_SETTINGS, format_examples
4
4
 
5
5
 
@@ -9,19 +9,17 @@ from docs_kit.cli.help import DocsKitGroup, HELP_CONTEXT_SETTINGS, format_exampl
9
9
  epilog=format_examples(
10
10
  "docs-kit ingest https://docs.example.com",
11
11
  'docs-kit query "How do I authenticate?"',
12
- "docs-kit serve",
12
+ "docs-kit install claude-code",
13
13
  ),
14
14
  )
15
15
  @click.version_option(package_name="docs-kit")
16
16
  def cli():
17
- """Fetch docs, embed them locally, and expose retrieval over MCP."""
17
+ """Fetch docs, embed them locally, and expose them to AI agents via skills."""
18
18
  pass
19
19
 
20
20
 
21
21
  cli.add_command(init_cmd, "init")
22
22
  cli.add_command(ingest_cmd, "ingest")
23
- cli.add_command(serve_cmd, "serve")
24
- cli.add_command(stop_cmd, "stop")
25
23
  cli.add_command(inspect_cmd, "inspect")
26
24
  cli.add_command(doctor_cmd, "doctor")
27
25
  cli.add_command(query_cmd, "query")