Skip to main content

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) Verify CLI
docctl --help

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

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

# 5) 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 export <archive_path> Export current index data to one .zip snapshot file.
docctl import <archive_path> Import index data from one .zip snapshot file (mutating).
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 and import are mutating.
  • search, show, stats, catalog, doctor, and session are read-only.
  • export is 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.

Metadata

Release files for docctl 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for docctl 0.3.1
File Size Uploaded
docctl-0.3.1.tar.gz 34.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for docctl 0.3.1
File Interpreter ABI Platform
docctl-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 75.7 kB

Release files / docctl-0.3.1.tar.gz

Download URL docctl-0.3.1.tar.gz
Size 34.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ac2651090c6af4761c269f380ced2125f99c9b6e7d9065f67c00141bf7651b57
BLAKE2b-256 checksum
How to use checksums
6d54ec32fea2dfe1c0c6da46ffe8365be78167aae226f7b373530d83fb9cbfbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.

Transparency log

Release files / docctl-0.3.1-py3-none-any.whl

Download URL docctl-0.3.1-py3-none-any.whl
Size 40.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f344d05cfa9e04ee23804afcd0b3df6ec5e684f6e5502aa3a93bfda5d928c6f
BLAKE2b-256 checksum
How to use checksums
3fbd5aa21ae94fcdcacd1bf9ad061e2a8571d0bd2503251d4e9299d8c9225e6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page