Skip to main content

LLM-powered code documentation assistant

Project description

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

uv tool install docstra
docstra --help

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

Work on the repo locally

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:

uv run docstra init

Remember to keep .docstra/ out of version control.

Common commands

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:

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:

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:

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:

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

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

docstra-0.3.0.tar.gz (159.1 kB view details)

Uploaded Source

Built Distribution

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

docstra-0.3.0-py3-none-any.whl (190.9 kB view details)

Uploaded Python 3

File details

Details for the file docstra-0.3.0.tar.gz.

File metadata

  • Download URL: docstra-0.3.0.tar.gz
  • Upload date:
  • Size: 159.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for docstra-0.3.0.tar.gz
Algorithm Hash digest
SHA256 472eac344eb113eec347dadb5e9c310319b7f90ab3acfdb2e6c3ecf489c633eb
MD5 0b7d42d38883b82fbeaf5b10b289fb69
BLAKE2b-256 f86a6acccb48c46e61a031724c177626c739d7d9d9003eb5ec22b1aa425b0655

See more details on using hashes here.

File details

Details for the file docstra-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: docstra-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 190.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for docstra-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ad68c27ed5e827aae064158669e0891f55f3126e5574b2a7bd7971c3823ba43
MD5 9cfb6711f73760f2abb1430cad8db49f
BLAKE2b-256 d80954651980c2c007ba5d96b2000aa7521e9495b540b64e7266acba35badef4

See more details on using hashes here.

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