docs2llm
A command-line tool to extract documentation from local directories and GitHub repositories, formatting it for use as context with Large Language Models (LLMs).
Purpose
docs2llm helps you capture documentation from codebases to use as context for AI assistants and large language models. It searches for documentation files (markdown, text, etc.), processes them, and creates a single consolidated file that can be used as reference material for LLMs.
Features
- Extract documentation from local directories or GitHub repositories
- Automatically identify and process common documentation files
- Prioritize README files and important documentation
- Support for multiple file formats (Markdown, RST, TXT)
- Format output for optimal LLM context
- Control scan depth to manage output size
- Clone specific branches from Git repositories
- Detailed logging with configurable verbosity
Installation
# Install from PyPI
pip install docs2llm
Usage
Command Line Interface
# Extract docs from a local directory
docs2llm /path/to/project --output context.txt
# Extract docs from a GitHub repository
docs2llm --git owner/repo --output context.txt
# Specify a branch
docs2llm --git owner/repo --branch develop
# Control scan depth
docs2llm /path/to/project --max-depth 2
# Enable verbose logging
docs2llm /path/to/project -v
# Write logs to a file
docs2llm /path/to/project --log-file extraction.log
Options
PATH: Local directory containing documentation files--git: GitHub repository URL or owner/repo format--output: Output file name (default: llm_context.txt)--max-depth: Maximum directory depth to search (default: 3)--branch: Specific branch to clone (only used with --git)--verbose,-v: Enable verbose logging--log-file: Log to this file in addition to console
Python API
from docs2llm import extract_documentation
# Extract from local directory
success = extract_documentation(
local_path="/path/to/project",
output_file="context.txt",
max_depth=3,
verbose=True
)
# Extract from GitHub repository
success = extract_documentation(
git_repo="owner/repo",
output_file="context.txt",
branch="main",
verbose=True
)
Metadata
Release files for docs2llm 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| docs2llm-0.1.0.tar.gz | 22.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| docs2llm-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.6 kB
Release files / docs2llm-0.1.0.tar.gz
| Download URL | docs2llm-0.1.0.tar.gz |
|---|---|
| Size | 22.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
904b479f5f425c5d03381af0904ada252ad4c08dad04345ecce86fd84ecac42c
|
|
BLAKE2b-256 checksum How to use checksums |
3cecb5419cc88dc748c591e365e97847b24bca138c97705d4594865f17985aea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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 Apr 14, 2025.
Transparency logRelease files / docs2llm-0.1.0-py3-none-any.whl
| Download URL | docs2llm-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
64ede59f2556eda6ff110fa305e2babf8aeed6fcd5149ff6945590628ef3c62a
|
|
BLAKE2b-256 checksum How to use checksums |
375bdc2c53e1ff1ae0bdcb08aecdc0a9618e0212cb1119e1d78ca2d185aa16e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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 Apr 14, 2025.
Transparency log