CLI-first local document retrieval tool
Project description
Local-first CLI for agent and human document retrieval with provenance-grounded answers, local vector-store, and predictable machine-readable output.
Why docctl
- Optimized for agentic retrieval loops with fast multi-step questions and answers.
- Runs locally with a persistent Chroma-backed index.
- Ingests
.pdf,.docx,.txt, and.mdwith provenance metadata (doc_id,source,title). - Uses sentence-aware chunking for better retrieval quality.
- Supports deterministic
--jsonoutput for automation and agents. - Exposes stable CLI workflows for ingest, search, diagnostics, and inventory.
Agent Integration
Use SKILL.md when you want an agent to drive docctl end-to-end.
The skill makes session for fast iterative retrieval.
Quickstart
Requirements:
- Python 3.12 or 3.13
uv
# 1) Install dependencies
uv sync --frozen --dev
# 2) Verify CLI
uv run docctl --help
# 3) Ingest supported files
uv run docctl ingest ./docs --recursive --approve-write --allow-model-download
# 4) Search indexed content
uv run docctl search "security gateway diagnostics" --top-k 5 --allow-model-download
# 5) Show one chunk by id (replace with an id from search output)
uv run docctl show <chunk_id_from_search> --allow-model-download
After the first public release, install from PyPI with:
pip install docctl
Command Overview
| Command | Purpose |
|---|---|
docctl ingest <path> |
Ingest one supported file or a directory of supported files (mutates local index state). |
docctl search <query> |
Search indexed content with optional metadata filters. |
docctl show <chunk_id> |
Show one indexed chunk by exact id. |
docctl stats |
Show index statistics. |
docctl catalog |
Show index summary and per-document inventory. |
docctl doctor |
Run local diagnostics for index and embedding setup. |
docctl session |
Run a read-only NDJSON request session on stdin/stdout. |
JSON and Session Mode
Use --json for deterministic machine-readable output:
uv run docctl --json search "security gateway diagnostics" --top-k 5 --allow-model-download
Use session for NDJSON request/response flows. For agents, this is the preferred fast path whenever one workflow needs two or more read operations:
cat <<'EOF' | uv run docctl session --allow-model-download
{"id":"q1","op":"search","query":"security gateway diagnostics","top_k":5}
{"id":"q2","op":"catalog"}
EOF
Configuration
Global options:
--index-path(default:.docctl)--collection(default:default)--json(deterministic JSON payloads on stdout)--verbose(extra diagnostics)
Model downloads are explicit:
- Use
--allow-model-downloadwhen embedding artifacts are not already available.
Mutation boundaries:
ingestis mutating.search,show,stats,catalog,doctor, andsessionare read-only.
Development
Run core quality checks:
make lint
make format-check
make typecheck
make security-lint
make import-lint
make test
make test-cov
make check-markdown-links
Apply formatting fixes:
make format
Build release artifacts locally:
make build-dist
make check-dist
make release-dry-run
Documentation Map
- ARCHITECTURE.md
- docs/design-docs/index.md
- docs/product-specs/index.md
- docs/references/index.md
- SECURITY.md (canonical vulnerability disclosure policy)
- docs/RELIABILITY.md
- docs/SECURITY.md (internal implementation security guardrails)
- docs/PLANS.md
Contributing
For implementation and validation workflow, start with:
- AGENTS.md
- ARCHITECTURE.md
- The indexed docs under
docs/listed above.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docctl-0.1.0.tar.gz.
File metadata
- Download URL: docctl-0.1.0.tar.gz
- Upload date:
- Size: 29.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df7a90c3f6fcf97e66fa1aeae977269375bfd249dc9304774f95130d159f32e4
|
|
| MD5 |
a34e7ff3cd40131bcf75b9ba728adda1
|
|
| BLAKE2b-256 |
3609c6e64d2659a512c14e2fccf8d0ce0eceb2c4494800443b6136e5cd04c4e1
|
Provenance
The following attestation bundles were made for docctl-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on GeorgesAlkhouri/docctl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docctl-0.1.0.tar.gz -
Subject digest:
df7a90c3f6fcf97e66fa1aeae977269375bfd249dc9304774f95130d159f32e4 - Sigstore transparency entry: 1091056505
- Sigstore integration time:
-
Permalink:
GeorgesAlkhouri/docctl@e880972976be75af905fd9ea61df6b54b344af7c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/GeorgesAlkhouri
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e880972976be75af905fd9ea61df6b54b344af7c -
Trigger Event:
release
-
Statement type:
File details
Details for the file docctl-0.1.0-py3-none-any.whl.
File metadata
- Download URL: docctl-0.1.0-py3-none-any.whl
- Upload date:
- Size: 33.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43162d8cba93efa9a1d956d629081d541b85b1834eefea19c08dbb65de51d8ea
|
|
| MD5 |
e333fd37527cd083e06296e8b62a7969
|
|
| BLAKE2b-256 |
7ba1884952bebf78d86c893fcbe7a07a36f091bcdcfa2a751f62a68ffb3e71d0
|
Provenance
The following attestation bundles were made for docctl-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on GeorgesAlkhouri/docctl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docctl-0.1.0-py3-none-any.whl -
Subject digest:
43162d8cba93efa9a1d956d629081d541b85b1834eefea19c08dbb65de51d8ea - Sigstore transparency entry: 1091056512
- Sigstore integration time:
-
Permalink:
GeorgesAlkhouri/docctl@e880972976be75af905fd9ea61df6b54b344af7c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/GeorgesAlkhouri
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e880972976be75af905fd9ea61df6b54b344af7c -
Trigger Event:
release
-
Statement type: