<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Cradicle Explorer</title>
    <link href="/css/bootstrap/bootstrap.min.css" rel="stylesheet">
    <style>
      .form-control-dark::placeholder {
          color: #aaa;
          opacity: 1;
      }
    </style>
    <link rel="stylesheet" href="/assets/fontawesome/css/all.min.css">
    <link rel="icon" type="image/png" href="/favicon.png">


                <link href="/css/dashboard.css" rel="stylesheet">
                </head>
                <body>
                <header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
                  <a class="navbar-brand col-md-3 col-lg-2 me-0 px-3 fs-6" href="/">Cradicle Explorer</a>
                  <button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                  </button>
                  <form method="get" action="/cgi-bin/main" style="width:100%;"><input class="form-control form-control-dark w-100 rounded-0 border-0" type="text" name="q" placeholder="Search repos" aria-label="Search"></form>
                  <div class="navbar-nav flex-row">
                    <div class="nav-item text-nowrap">
                      <a class="nav-link px-3 active" href="/cgi-bin/repo?id=z4RLodmmoj1APnZxC1onrYBuzuHtC">llm-fragments-sourcehut</a>
                    </div>
                  </div>
                </header>
                <div class="container-fluid">
                  <div class="row">
                    <nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-dark sidebar collapse">
                      <div class="position-sticky pt-3 sidebar-sticky">
                        <ul class="nav flex-column">
                          <li class="nav-item">
                            <a class="nav-link active" href="/cgi-bin/repo?id=z4RLodmmoj1APnZxC1onrYBuzuHtC">
                              <i class="align-text-bottom fa-solid fa-info"></i>
                              Info
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z4RLodmmoj1APnZxC1onrYBuzuHtC&issue=list">
                              <i class="align-text-bottom fa-solid fa-layer-group"></i>
                              Issues
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z4RLodmmoj1APnZxC1onrYBuzuHtC&patch=list">
                              <i class="align-text-bottom fa-solid fa-vest-patches"></i>
                              Patches
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z4RLodmmoj1APnZxC1onrYBuzuHtC&wallet=list">
                              <i class="align-text-bottom fa-solid fa-wallet"></i>
                              Wallets
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z4RLodmmoj1APnZxC1onrYBuzuHtC&source=.">
                              <i class="align-text-bottom fa-solid fa-code"></i>
                              Source
                            </a>
                          </li>
                        <h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted text-uppercase">
                          <span></span>
                        </h6>
                        <ul class="nav flex-column mb-2">
                        
                        </ul>
                      </div>
                    </nav>
                <main class="col-md-9 ms-sm-auto col-lg-10">
                  <div class="container px-1 py-3">
        

    <div class="list-group">
    <div class="list-group-item">
    <div style="font-size:1.3rem;">llm-fragments-sourcehut</div>
    <div class="repo-item">Load SourceHut repository contents as LLM fragments</div>
    <div>rad:z4RLodmmoj1APnZxC1onrYBuzuHtC</div>
    </div>
    <div class="list-group-item">
    <div>Visibility</div>
    <div class="repo-item">public</div>
    </div>
    <div class="list-group-item">
    <div>Delegates</div><div class="repo-item">did:key:z6MkpyCVx93qAjw5yAGv4zew6iCWxZkhEzMzgXXMifxYnQna</div><div class="repo-item">did:key:z6MkqSXhbXtshCpx5fegSJyeJ95KaGZHHByWWENLsA9MTGni</div>
    </div>
    <div class="list-group-item">
    <div>Default branch</div>
    <div><span class="repo-item">main &#8594 ff2604e15e56bcfbba936c1e785a12995988705f</span> (Sun Jun 22 00:16:42 2025)</div>
    </div>
    <div class="list-group-item">
    <div>Threshold</div>
    <div class="repo-item">1</div>
    </div>
    </div>
    
        <div class="list-group mt-3">
        <div class="list-group-item">
        <div class="mb-2" style="font-weight:bold;"><i class="fa-solid fa-book"></i> README.md</div>
        <pre style="margin:0; font-size:0.85rem; overflow-x:auto; color:#fafafa;"># llm-fragments-sourcehut

[![PyPI](https://img.shields.io/pypi/v/llm-fragments-sourcehut.svg)](https://pypi.org/project/llm-fragments-sourcehut/)
[![Changelog](https://img.shields.io/badge/changelog-refs-brightgreen)](https://git.sr.ht/~amolith/llm-fragments-sourcehut/refs)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://git.sr.ht/~amolith/llm-fragments-sourcehut/tree/main/item/LICENSE)

Load SourceHut repository contents and todos as fragments

## Installation

Install this plugin in the same environment as [LLM](https://llm.datasette.io/).

```bash
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:

```bash
llm -f srht:~amolith/adresilo-server &#x27;suggest new features for this tool&#x27;
```

There&#x27;s also a fallback to allow `srht:user/repo`.

## TODOs

Use `-f todo:~user/repo/issue` to query SourceHut&#x27;s authenticated GraphQL API
for the ticket details, render them as Markdown, and include them as a fragment.
Obtain an access token from [SourceHut](https://meta.sr.ht/oauth2) or your
instance and set the `SRHT_TOKEN` environment variable to it.

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

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

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

## Development

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

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

Now install the dependencies and test dependencies:

```bash
llm install -e &#x27;.[test]&#x27;
```

To run the tests:

```bash
python -m pytest
```

## Contributions are welcome

This repo is on SourceHut ([repo][srhtrepo]) and Radicle ([web][radrepo],
`rad:z4RLodmmoj1APnZxC1onrYBuzuHtC`, [what is Radicle?][rad]).

[srhtrepo]: https://git.sr.ht/~amolith/llm-fragments-sourcehut
[radrepo]: https://radicle.secluded.site/nodes/seed.secluded.site/rad:z4RLodmmoj1APnZxC1onrYBuzuHtC
[rad]: https://radicle.xyz
</pre>
        </div>
        </div>

</div>
</main>
</div>
</div>


</body>
</html>

