Skip to main content

Load SourceHut repository contents as LLM fragments

Project description

llm-fragments-sourcehut

PyPI Changelog License

Load SourceHut repository contents and todos as fragments

Installation

Install this plugin in the same environment as LLM.

llm install llm-fragments-sourcehut

Repo contents

Use -f srht:~user/repo to include every text file from the specified SourceHut repository as a fragment.

The prefix accepts the standard ~user/repo shorthand format. For example:

llm -f srht:~amolith/adresilo-server 'suggest new features for this tool'

There's also a fallback to allow srht:user/repo.

TODOs

Use -f todo:~user/repo/issue to query SourceHut's GraphQL API for the ticket details, render them as Markdown, and include them as fragments.

# Use default todo.sr.ht instance
llm -m 'openrouter/google/gemini-2.5-flash-lite-preview-06-17' \
    -f todo:~amolith/willow/47 'Briefly describe the outcome of this ticket.'

# Specify a different instance, requiring HTTPS
llm -m 'openrouter/google/gemini-2.5-flash-lite-preview-06-17' \
    -f todo:todo.sr.ht/~amolith/willow/47 'Briefly describe the outcome of this ticket.'

# Specify a different instance, not requiring HTTPS
llm -m 'openrouter/google/gemini-2.5-flash-lite-preview-06-17' \
    -f todo:http://192.168.1.28/~amolith/willow/47 'Briefly describe the outcome of this ticket.'

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-fragments-sourcehut
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

llm install -e '.[test]'

To run the tests:

python -m pytest

Contributions are welcome

This repo is on SourceHut (repo) and Radicle (web, rad:z4RLodmmoj1APnZxC1onrYBuzuHtC, what is Radicle?).

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_fragments_sourcehut-0.1.3.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

llm_fragments_sourcehut-0.1.3-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file llm_fragments_sourcehut-0.1.3.tar.gz.

File metadata

File hashes

Hashes for llm_fragments_sourcehut-0.1.3.tar.gz
Algorithm Hash digest
SHA256 15bc1d5bb9bcac28a11118c4b67c1eaff79bf5f0fd710001abda39744b8ad086
MD5 f44af4043cd91a761b693a9d9e560336
BLAKE2b-256 a85dd7f9ffb94628e0998010837ca026e85c4331863e71779da59baace57fb6d

See more details on using hashes here.

File details

Details for the file llm_fragments_sourcehut-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_fragments_sourcehut-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7a5a41b9516a402f1cf3c50e6668f04a24c0579ba50c129118cefceaa4f5f1b6
MD5 77a726eb76d852d62181cb255df7ece8
BLAKE2b-256 feaf4fff822c5f3a330776526a1e7e46899d9593283dbd2787888f9491e87d45

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