Metadata-Version: 2.3
Name: docstra
Version: 0.2.0
Summary: LLM-powered code documentation assistant
Author: Jørgen Andresen Osberg, Jonathan Selstad Hofstein
Author-email: Jørgen Andresen Osberg <jorgenao@uio.no>, Jonathan Selstad Hofstein <jonatsho@uio.no>
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: anthropic>=0.109.1,<0.110
Requires-Dist: chromadb>=0.6.3,<0.7
Requires-Dist: einops>=0.8.1,<0.9
Requires-Dist: fastapi>=0.136.3,<0.137
Requires-Dist: jinaai>=0.2.10,<0.3
Requires-Dist: jinja2>=3.1.6,<4
Requires-Dist: markdown>=3.8,<4
Requires-Dist: mkdocs>=1.6.1,<2
Requires-Dist: mkdocs-material>=9.6.11,<10
Requires-Dist: mkdocstrings>=1.0.4,<2
Requires-Dist: openai>=2.41.1,<3
Requires-Dist: pydantic>=2.10.6,<3
Requires-Dist: python-dotenv>=1.0.0,<2
Requires-Dist: python-multipart>=0.0.20,<1
Requires-Dist: pyyaml>=6.0.2,<7
Requires-Dist: requests>=2.32.3,<3
Requires-Dist: rich>=13.9.4,<14
Requires-Dist: sentence-transformers>=5.5.1,<6
Requires-Dist: starlette>=1.0.1,<2
Requires-Dist: tenacity>=9.1.2,<10
Requires-Dist: tiktoken>=0.9.0,<1
Requires-Dist: torch>=2.6.0,<3
Requires-Dist: transformers>=5.11.0,<6
Requires-Dist: tree-sitter>=0.24.0,<0.25
Requires-Dist: tree-sitter-language-pack>=0.6.1,<0.7
Requires-Dist: typer>=0.15.4,<0.16
Requires-Dist: uvicorn>=0.34.2,<0.35
Requires-Python: >=3.12
Project-URL: Repository, https://github.com/jorgenosberg/docstra
Description-Content-Type: text/markdown

# Docstra

Docstra is an LLM-powered tool for generating and querying codebase documentation. It ships as a CLI and also includes a small FastAPI app for browser-based workflows.

## Install

### Use the published CLI

```bash
uv tool install docstra
docstra --help
```

For one-off runs, you can also use `uvx docstra --help`.

### Work on the repo locally

```bash
git clone https://github.com/jorgenosberg/docstra.git
cd docstra
uv sync
uv run docstra --help
```

The repo is pinned to Python 3.12 in `.python-version`. `uv sync` will create `.venv` and install the right interpreter if needed.

## Configure

Docstra stores project-specific state in a `.docstra/` directory at the root of the codebase you are indexing. That directory contains generated embeddings, indexes, and the local `.env` file used for provider credentials.

Run `docstra init` in the target repository to create or update that configuration:

```bash
uv run docstra init
```

Remember to keep `.docstra/` out of version control.

## Common commands

```bash
uv run docstra init
uv run docstra ingest
uv run docstra query "How does authentication work?"
uv run docstra chat
```

## FastAPI app

Start the bundled FastAPI app from the repo with:

```bash
uv run uvicorn docstra.core.app:app --reload
```

The app will be available at `http://127.0.0.1:8000`.

## Developer workflow

Use `uv` for the local environment and lockfile:

```bash
uv sync --locked --all-groups
uv lock --check
uv run --locked --no-sync ruff check .
uv run --locked --no-sync ruff format --check .
uv run --locked --no-sync ty check
uv audit --locked --ignore-until-fixed GHSA-rrmf-rvhw-rf47
uv run --locked --no-sync pytest
```

Install the Git hooks once per clone:

```bash
uv run pre-commit install
```

`uv` already defaults to the `first-index` resolution strategy. This repo pins that behavior explicitly in `pyproject.toml` so any future custom index setup still prefers the first matching index and avoids dependency-confusion fallback.

## Documentation generator

The generator can build MkDocs output for another repository:

```bash
uv run docstra generate ./your-project --output ./docs --format mkdocs
cd ./docs
mkdocs serve
```
