Skip to main content

LLM plugin to create a hierarchical summary description of a project

Project description

llm-devtale

llm-devtale is a plugin for Simon Willison's LLM tool llm command-line tool that automatically generates documentation ("dev tales") for your source code projects. It analyzes your project's files and folders, considering factors like file size, git commit effort, and excluded patterns, to produce a hierarchical, LLM-generated summary of your codebase.

The generated documentation includes:

  • A high-level overview of the entire repository.
  • Summaries for each analyzed folder.
  • Detailed "dev tales" for individual source code files.

To avoid analyzing too much boilerplate or non-important data, the program expects the folder to be a git repository, so it can order the files by number of commits to focus on the most important files (most commits) within the limits of the tokens configured

Taken inspiration (and some code) from https://github.com/tenxstudio/devtale and https://github.com/irthomasthomas/llm-cartographer

The tool uses threads to speed up the analysis, up to maximum 8 threads, only for file summarization.

Installation

First, ensure you have llm installed:

uv tool install llm

Then, install the llm-devtale plugin:

llm install llm-devtale

Usage

Once installed, the devtale command will be available through the llm CLI:

llm devtale [DIRECTORY] [OPTIONS]

By default, DIRECTORY is the current working directory (.).

Examples

Generate documentation for the current directory

This will output the generated documentation to your console.

llm devtale .

Output documentation to a file

Save the generated documentation to PROJECT_README.md.

llm devtale . -o PROJECT_README.md

Use a specific LLM model

Generate documentation using gpt-4:

llm devtale . -m gpt4

Exclude specific files or folders

Exclude all files under test/ directories and docs/ folders using gitignore-style patterns:

llm devtale . -e "**/test/*" -e "docs/"

Filter by file extension

Only include Python (.py) and JavaScript (.js) files in the analysis (do NOT forget the '*' before the extension):

llm devtale . -f *.py -f *.js

Filter by directory

Only include folders src/app and src/utils:

llm devtale . -k src/app -k src/utils

Limit token usage

Specify the maximum number of tokens to send to the LLM for the entire project and per file:

llm devtale . --max-tokens 50000 --max-tokens-per-file 5000

Perform a dry run

See which files and folders would be analyzed without actually calling the LLM. This shows the project hierarchy and token counts.

llm devtale . --dry-run

Add additional instructions to the prompt

Add additional instructions to the end of all LLM prompts.

llm devtale -p "All summaries should be in uppercase" .

Options

  • DIRECTORY: Path to the project directory (default: .)
  • -e, --exclude <PATTERN>: Patterns to exclude files/folders (gitignore format). Can be used multiple times.
  • --max-tokens <INT>: Maximum total tokens to send to the LLM for the entire project.
  • --max-tokens-per-file <INT>: Maximum tokens to process per individual file.
  • -o, --output <PATH>: Output file path or directory to save the generated documentation.
  • -m, --model <MODEL_NAME>: Specify the LLM model to use (e.g., gpt4). If not set uses the default model configured in the llm cli tool
  • -f, --filter-extension <EXTENSION>: Only include files with these extensions (e.g., *.py, *.md). Can be used multiple times.
  • -t, --dry-run: Show the hierarchy and files that will be analyzed without making LLM calls.
  • -d, --debug: Turn on verbose logging.
  • -k, --filter-folder: Only parse the specified folder(s)
  • -p, --prompt: Additional prompt to be added at the end of the program prompt

Debug

The program can be executed using an ad-hoc main.py file added for convenience:

python -m llm_devtale.main

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

llm_devtale-0.2.2.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

llm_devtale-0.2.2-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file llm_devtale-0.2.2.tar.gz.

File metadata

  • Download URL: llm_devtale-0.2.2.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.4

File hashes

Hashes for llm_devtale-0.2.2.tar.gz
Algorithm Hash digest
SHA256 6b821798f9f4c85a3c5ceada85bfd0bbfe18fa997d48e4d0bbcae7f6a3f6c8f1
MD5 9e4f0ced71632788f483f392d37732f1
BLAKE2b-256 7a5b87073fef2b20cc26c2d73f0dc37d0b495ff34d6f6f7c75f813b7f57b6e32

See more details on using hashes here.

File details

Details for the file llm_devtale-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_devtale-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 533e5fce4583bd22a84cb5b1d446770a6d329a313b44d3f45eef82fba800f2d1
MD5 6dcba08f7bfe9e07c4cd2c7f900ed397
BLAKE2b-256 9ecbdd4a27df8c0f0eeec125e31b02bc6360039d670b3da2e0aae9473e52b977

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