Skip to main content

CLI-first local document retrieval tool

Project description

docctl logo

Local-first CLI for agent and human document retrieval with provenance-grounded answers, local vector-store, and predictable machine-readable output.

CI Trivy Quality Gate Codecov

Python 3.12 | 3.13 Local-first Chroma

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 .md with provenance metadata (doc_id, source, title).
  • Uses sentence-aware chunking for better retrieval quality.
  • Supports deterministic --json output 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
  • pip
# 1) Install from PyPI
pip install docctl

# 2) Optional: install GPU-linked torch dependencies (Linux x86_64)
pip install --upgrade "docctl[gpu]"

# 3) Verify CLI
docctl --help

# 4) Ingest supported files
docctl ingest ./docs --recursive --approve-write --allow-model-download

# 5) Search indexed content
docctl search "security gateway diagnostics" --top-k 5 --allow-model-download

# 6) Show one chunk by id (replace with an id from search output)
docctl show <chunk_id_from_search> --allow-model-download

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:

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' | 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-download when embedding artifacts are not already available.

Mutation boundaries:

  • ingest is mutating.
  • search, show, stats, catalog, doctor, and session are 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

Contributing

For implementation and validation workflow, start with:

  1. AGENTS.md
  2. ARCHITECTURE.md
  3. 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

docctl-0.2.1.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docctl-0.2.1-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

Details for the file docctl-0.2.1.tar.gz.

File metadata

  • Download URL: docctl-0.2.1.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for docctl-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7a536a5d530dd4e816cdf08423d43a3fc7879075ac8c290b69052aa7cd465d28
MD5 1302c3ae243dddf2dc9d50f593ad56af
BLAKE2b-256 2951130b8f670ffb364f6ae99ef912cf07ef87744778a149d15a0b870f3b19b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for docctl-0.2.1.tar.gz:

Publisher: publish-pypi.yml on GeorgesAlkhouri/docctl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file docctl-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: docctl-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 37.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for docctl-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0838fab9a4fa99cc25d86ff9ea2607d6141301accfefb3e38be087bcc59163e4
MD5 521803c0bfa72f7dd0ed852355fc9823
BLAKE2b-256 1caa2908d2296733beaa15e644dc72dcb11e839bcc04168ae8d231ce10cb6a0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for docctl-0.2.1-py3-none-any.whl:

Publisher: publish-pypi.yml on GeorgesAlkhouri/docctl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page