rlmgrep 0.1.9__py3-none-any.whl → 0.1.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rlmgrep/__init__.py +1 -1
- rlmgrep/cli.py +1 -3
- rlmgrep/render.py +0 -6
- {rlmgrep-0.1.9.dist-info → rlmgrep-0.1.11.dist-info}/METADATA +18 -8
- rlmgrep-0.1.11.dist-info/RECORD +14 -0
- rlmgrep-0.1.9.dist-info/RECORD +0 -14
- {rlmgrep-0.1.9.dist-info → rlmgrep-0.1.11.dist-info}/WHEEL +0 -0
- {rlmgrep-0.1.9.dist-info → rlmgrep-0.1.11.dist-info}/entry_points.txt +0 -0
- {rlmgrep-0.1.9.dist-info → rlmgrep-0.1.11.dist-info}/top_level.txt +0 -0
rlmgrep/__init__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__all__ = ["__version__"]
|
|
2
|
-
__version__ = "0.1.
|
|
2
|
+
__version__ = "0.1.11"
|
rlmgrep/cli.py
CHANGED
|
@@ -72,10 +72,9 @@ def _parse_args(argv: list[str]) -> argparse.Namespace:
|
|
|
72
72
|
parser.add_argument("pattern", nargs="?", help="Query string (interpreted by RLM)")
|
|
73
73
|
parser.add_argument("paths", nargs="*", help="Files or directories")
|
|
74
74
|
|
|
75
|
-
parser.add_argument("-n", dest="line_numbers", action="store_true", help="Show line numbers (default)")
|
|
76
75
|
parser.add_argument("-r", dest="recursive", action="store_true", help="Recursive (directories are searched recursively by default)")
|
|
77
76
|
parser.add_argument("--no-recursive", dest="recursive", action="store_false", help="Do not recurse directories")
|
|
78
|
-
parser.set_defaults(recursive=True
|
|
77
|
+
parser.set_defaults(recursive=True)
|
|
79
78
|
|
|
80
79
|
parser.add_argument("-C", dest="context", type=int, default=0, help="Context lines before/after")
|
|
81
80
|
parser.add_argument("-A", dest="after", type=int, default=None, help="Context lines after")
|
|
@@ -565,7 +564,6 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
565
564
|
output_lines = render_matches(
|
|
566
565
|
files=files,
|
|
567
566
|
matches=verified,
|
|
568
|
-
show_line_numbers=args.line_numbers,
|
|
569
567
|
before=before,
|
|
570
568
|
after=after,
|
|
571
569
|
use_color=use_color,
|
rlmgrep/render.py
CHANGED
|
@@ -23,13 +23,10 @@ def _format_line(
|
|
|
23
23
|
line_no: int,
|
|
24
24
|
text: str,
|
|
25
25
|
is_match: bool,
|
|
26
|
-
show_line_numbers: bool,
|
|
27
26
|
use_color: bool,
|
|
28
27
|
heading: bool,
|
|
29
28
|
) -> str:
|
|
30
29
|
delim = ":" if is_match else "-"
|
|
31
|
-
if not show_line_numbers:
|
|
32
|
-
return text
|
|
33
30
|
prefix = _colorize(str(line_no), COLOR_LINE_NO, use_color)
|
|
34
31
|
sep = "\t" if heading else ""
|
|
35
32
|
return f"{prefix}{delim}{sep}{text}"
|
|
@@ -52,7 +49,6 @@ def _merge_ranges(ranges: list[tuple[int, int]]) -> list[tuple[int, int]]:
|
|
|
52
49
|
def render_matches(
|
|
53
50
|
files: dict[str, FileRecord],
|
|
54
51
|
matches: dict[str, list[int]],
|
|
55
|
-
show_line_numbers: bool,
|
|
56
52
|
before: int,
|
|
57
53
|
after: int,
|
|
58
54
|
use_color: bool = False,
|
|
@@ -86,7 +82,6 @@ def render_matches(
|
|
|
86
82
|
line_no,
|
|
87
83
|
text,
|
|
88
84
|
True,
|
|
89
|
-
show_line_numbers,
|
|
90
85
|
use_color,
|
|
91
86
|
heading,
|
|
92
87
|
)
|
|
@@ -111,7 +106,6 @@ def render_matches(
|
|
|
111
106
|
line_no,
|
|
112
107
|
text,
|
|
113
108
|
is_match,
|
|
114
|
-
show_line_numbers,
|
|
115
109
|
use_color,
|
|
116
110
|
heading,
|
|
117
111
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rlmgrep
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.11
|
|
4
4
|
Summary: Grep-shaped CLI search powered by DSPy RLM
|
|
5
5
|
Author: rlmgrep
|
|
6
6
|
License: MIT
|
|
@@ -22,10 +22,20 @@ uv tool install rlmgrep
|
|
|
22
22
|
# uv tool install git+https://github.com/halfprice06/rlmgrep.git
|
|
23
23
|
|
|
24
24
|
export OPENAI_API_KEY=... # or set keys in ~/.rlmgrep
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```sh
|
|
25
28
|
rlmgrep --answer "What does this repo do and where are the entry points?" .
|
|
26
|
-
rlmgrep -n -C 2 "Where is retry/backoff configured and what are the defaults?" .
|
|
27
29
|
```
|
|
28
30
|
|
|
31
|
+

|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
rlmgrep -C 2 "Where is retry/backoff configured and what are the defaults?" .
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+

|
|
38
|
+
|
|
29
39
|
## Requirements
|
|
30
40
|
|
|
31
41
|
- Python 3.11+
|
|
@@ -39,8 +49,8 @@ One of rlmgrep’s most useful features is that it can “grep” **PDFs and Off
|
|
|
39
49
|
How it works:
|
|
40
50
|
- **PDFs** are parsed with `pypdf`. Each page gets a marker line like `===== Page N =====`, and output lines include a `page=N` suffix. Line numbers refer to the extracted text (not PDF coordinates).
|
|
41
51
|
- **Office & binary docs** (`.docx`, `.pptx`, `.xlsx`, `.html`, `.zip`, etc.) are converted to Markdown via **MarkItDown**. This happens during ingestion, so rlmgrep can search them like any other text file.
|
|
42
|
-
- **Images** can be described by a vision model through MarkItDown (OpenAI/Anthropic/Gemini).
|
|
43
|
-
- **Audio** transcription is supported through OpenAI when enabled.
|
|
52
|
+
- **Images** can be described by a vision model and then searched through MarkItDown (OpenAI/Anthropic/Gemini), enable and configure in config.toml.
|
|
53
|
+
- **Audio** transcription is supported through OpenAI when enabled, configure in config.toml.
|
|
44
54
|
|
|
45
55
|
Sidecar caching:
|
|
46
56
|
- For images/audio, converted text is cached next to the original file as `<original>.<ext>.md` and reused on later runs.
|
|
@@ -48,7 +58,7 @@ Sidecar caching:
|
|
|
48
58
|
|
|
49
59
|
## Install Deno
|
|
50
60
|
|
|
51
|
-
DSPy requires the Deno runtime. Install it with the official scripts:
|
|
61
|
+
DSPy's default implementation of RLM requires the Deno runtime. Install it with the official scripts:
|
|
52
62
|
|
|
53
63
|
macOS/Linux:
|
|
54
64
|
|
|
@@ -97,7 +107,7 @@ Examples:
|
|
|
97
107
|
|
|
98
108
|
```sh
|
|
99
109
|
# Natural-language query over a repo
|
|
100
|
-
rlmgrep -
|
|
110
|
+
rlmgrep -C 2 "Where is retry/backoff configured and what are the defaults?" .
|
|
101
111
|
|
|
102
112
|
# Restrict to Python files
|
|
103
113
|
rlmgrep "Where do we parse JWTs and enforce expiration?" --type py .
|
|
@@ -127,7 +137,7 @@ rg -l "token" . | rlmgrep --files-from-stdin --answer "What does this token cont
|
|
|
127
137
|
- Output uses rg-style headings by default:
|
|
128
138
|
- A file header line like `./path/to/file`
|
|
129
139
|
- Then `line:\ttext` for matches, `line-\ttext` for context lines
|
|
130
|
-
- Line numbers are 1-based.
|
|
140
|
+
- Line numbers are always included and are 1-based.
|
|
131
141
|
- When context ranges are disjoint, a `--` line separates groups.
|
|
132
142
|
- Exit codes:
|
|
133
143
|
- `0` = at least one match
|
|
@@ -142,7 +152,7 @@ rlmgrep can interpret traditional regex-style patterns inside a natural-language
|
|
|
142
152
|
Example (best-effort regex semantics + extra context):
|
|
143
153
|
|
|
144
154
|
```sh
|
|
145
|
-
rlmgrep
|
|
155
|
+
rlmgrep "Find Python functions that look like `def test_\\w+` and are marked as slow or flaky in nearby comments." .
|
|
146
156
|
```
|
|
147
157
|
|
|
148
158
|
If you need strict, deterministic regex behavior, use `rg`/`grep`.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
rlmgrep/__init__.py,sha256=eEU5vUkbBcAVKg20oMuOjMenVs64GjcSE_sBCcK_srU,49
|
|
2
|
+
rlmgrep/__main__.py,sha256=MHKZ_ae3fSLGTLUUMOx15fWdeOnJSHhq-zslRP5F5Lc,79
|
|
3
|
+
rlmgrep/cli.py,sha256=Jn7knAQq3Bnb578QK33RxDZ102yFrVSbNFjUKBGkb1o,20417
|
|
4
|
+
rlmgrep/config.py,sha256=u1iz-nI8dj-dZETbpIki3RQefHJEyi5oE5zE4_IR8kg,2399
|
|
5
|
+
rlmgrep/file_map.py,sha256=x2Ri1wzK8_87GUorsAV01K_nYLZcv30yIquDeTCcdEw,876
|
|
6
|
+
rlmgrep/ingest.py,sha256=uCz2el9B-RIT9umFo-gFEdAsmWPP1IJOArFFQY0D_1A,9127
|
|
7
|
+
rlmgrep/interpreter.py,sha256=s_nMRxLlAU9C0JmUzUBW5NbVbuH67doVWF54K54STlA,2478
|
|
8
|
+
rlmgrep/render.py,sha256=mCTT6yuKNv7HJ46LzOyLkCbyBedCWSNd7UeubyLXcyM,3356
|
|
9
|
+
rlmgrep/rlm.py,sha256=i3rCTp8OABByF60Un5gO7265gaW4spwU0OFKIz4surg,5750
|
|
10
|
+
rlmgrep-0.1.11.dist-info/METADATA,sha256=ykp-GtmTqprVgTF1L0tV_Wc9CHI--3FwlYjAQVxcbF0,7610
|
|
11
|
+
rlmgrep-0.1.11.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
12
|
+
rlmgrep-0.1.11.dist-info/entry_points.txt,sha256=UV6QkEbkwBO1JJ53mm84_n35tVyOczPvOQ14ga7vrCI,45
|
|
13
|
+
rlmgrep-0.1.11.dist-info/top_level.txt,sha256=gTujSRsO58c80eN7aRH2cfe51FHxx8LJ1w1Y2YlHti0,8
|
|
14
|
+
rlmgrep-0.1.11.dist-info/RECORD,,
|
rlmgrep-0.1.9.dist-info/RECORD
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
rlmgrep/__init__.py,sha256=9vXBF6zcAZgaxKBkU8Sh3RvsIW50FOnqUUndJYFZ4oM,48
|
|
2
|
-
rlmgrep/__main__.py,sha256=MHKZ_ae3fSLGTLUUMOx15fWdeOnJSHhq-zslRP5F5Lc,79
|
|
3
|
-
rlmgrep/cli.py,sha256=eUdM9aC0znZFzjqj-4YmT0_ymisSc_lUwDVjRi4ZU-s,20589
|
|
4
|
-
rlmgrep/config.py,sha256=u1iz-nI8dj-dZETbpIki3RQefHJEyi5oE5zE4_IR8kg,2399
|
|
5
|
-
rlmgrep/file_map.py,sha256=x2Ri1wzK8_87GUorsAV01K_nYLZcv30yIquDeTCcdEw,876
|
|
6
|
-
rlmgrep/ingest.py,sha256=uCz2el9B-RIT9umFo-gFEdAsmWPP1IJOArFFQY0D_1A,9127
|
|
7
|
-
rlmgrep/interpreter.py,sha256=s_nMRxLlAU9C0JmUzUBW5NbVbuH67doVWF54K54STlA,2478
|
|
8
|
-
rlmgrep/render.py,sha256=OYZy7BuJJe-KsDhEGAz6JA5RGd65ZInPWf9wLDJE0ag,3554
|
|
9
|
-
rlmgrep/rlm.py,sha256=i3rCTp8OABByF60Un5gO7265gaW4spwU0OFKIz4surg,5750
|
|
10
|
-
rlmgrep-0.1.9.dist-info/METADATA,sha256=Ak-s4aY5rK71LLylJmFNqkgXNHVIbqQnCeUUpl7gwuk,7333
|
|
11
|
-
rlmgrep-0.1.9.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
12
|
-
rlmgrep-0.1.9.dist-info/entry_points.txt,sha256=UV6QkEbkwBO1JJ53mm84_n35tVyOczPvOQ14ga7vrCI,45
|
|
13
|
-
rlmgrep-0.1.9.dist-info/top_level.txt,sha256=gTujSRsO58c80eN7aRH2cfe51FHxx8LJ1w1Y2YlHti0,8
|
|
14
|
-
rlmgrep-0.1.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|