README.md

  1# llm-fragments-repomix
  2
  3A plugin for [LLM](https://llm.datasette.io/) that loads repository contents as fragments using [Repomix](https://github.com/yamadashy/repomix).
  4
  5## Installation
  6
  7First, install the plugin:
  8
  9```bash
 10pip install llm-fragments-repomix
 11```
 12
 13Make sure you have `repomix` installed:
 14
 15```bash
 16npm install -g repomix
 17```
 18
 19## Usage
 20
 21Use the `repomix:` prefix with a full git repository URL:
 22
 23```bash
 24llm -f repomix:https://git.sr.ht/~amolith/willow "Tell me about this project"
 25```
 26
 27```bash
 28llm -f repomix:ssh://git.sr.ht:~amolith/willow "Analyze the code structure"
 29```
 30
 31```bash
 32llm -f repomix:git@github.com:user/repo.git "Review this codebase"
 33```
 34
 35### Arguments
 36
 37You can pass arguments to repomix using colon-separated syntax:
 38
 39```bash
 40# Basic compression
 41llm -f repomix:https://git.sr.ht/~amolith/willow:compress "Tell me about this project"
 42
 43# Include specific file patterns
 44llm -f repomix:https://git.sr.ht/~amolith/willow:include=*.go,*.md "Analyze the Python and documentation files"
 45
 46# Multiple arguments
 47llm -f repomix:https://git.sr.ht/~amolith/willow:compress:include=*.go:ignore=tests/ "Analyze Python files but skip tests"
 48```
 49
 50#### Supported Arguments
 51
 52- `compress` - Compress output to reduce token count
 53- `include=pattern` - Include files matching pattern (comma-separated)
 54- `ignore=pattern` - Ignore files matching pattern (comma-separated)
 55- `style=type` - Output style (xml, markdown, plain)
 56- `remove-comments` - Remove comments from code
 57- `remove-empty-lines` - Remove empty lines
 58- `output-show-line-numbers` - Add line numbers to output
 59- `no-file-summary` - Disable file summary section
 60- `no-directory-structure` - Disable directory structure section
 61- `no-files` - Disable file content output
 62- `header-text=text` - Custom header text
 63- `instruction-file-path=path` - Path to instruction file
 64- `include-empty-directories` - Include empty directories in output
 65- `no-git-sort-by-changes` - Don't sort files by git changes
 66- `include-diffs` - Include git diffs in output
 67- `no-gitignore` - Ignore .gitignore files
 68- `no-default-patterns` - Don't use default ignore patterns
 69- `no-security-check` - Disable security checks
 70- `token-count-encoding=encoding` - Token count encoding
 71- `top-files-len=N` - Number of top files to show
 72- `verbose` - Verbose output
 73- `quiet` - Quiet mode
 74
 75For a complete list of supported arguments, refer to the [Repomix documentation](https://github.com/yamadashy/repomix).
 76
 77## How It Works
 78
 79The plugin will:
 801. Parse the repository URL and any arguments
 812. Clone the repository to a temporary directory
 823. Run repomix on the cloned repository with the specified arguments
 834. Return the repomix output as a single fragment
 845. Clean up the temporary directory
 85
 86## Requirements
 87
 88- Python 3.9+
 89- `git` command available in PATH
 90- `repomix` command available in PATH
 91- LLM CLI tool installed
 92
 93## Collaboration
 94
 95Patch requests are in [amolith/llm-projects] on [pr.pico.sh]. You don't need a
 96new account to contribute, you don't need to fork this repo, you don't need to
 97fiddle with `git send-email`, you don't need to faff with your email client to
 98get `git request-pull` working...
 99
100You just need:
101
102- Git
103- SSH
104- An SSH key
105
106```sh
107# Clone this repo, make your changes, and commit them
108# Create a new patch request with
109git format-patch origin/main --stdout | ssh pr.pico.sh pr create amolith/llm-projects
110# After potential feedback, submit a revision to an existing patch request with
111git format-patch origin/main --stdout | ssh pr.pico.sh pr add {prID}
112# List patch requests
113ssh pr.pico.sh pr list amolith/llm-projects
114```
115
116See "How do Patch Requests work?" on [pr.pico.sh]'s home page for a more
117complete example workflow.
118
119[amolith/llm-projects]: https://pr.pico.sh/r/amolith/llm-projects
120[pr.pico.sh]: https://pr.pico.sh
121
122## License
123
124Apache-2.0