rlmgrep 0.1.8__py3-none-any.whl → 0.1.10__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.8.dist-info → rlmgrep-0.1.10.dist-info}/METADATA +7 -5
- rlmgrep-0.1.10.dist-info/RECORD +14 -0
- rlmgrep-0.1.8.dist-info/RECORD +0 -14
- {rlmgrep-0.1.8.dist-info → rlmgrep-0.1.10.dist-info}/WHEEL +0 -0
- {rlmgrep-0.1.8.dist-info → rlmgrep-0.1.10.dist-info}/entry_points.txt +0 -0
- {rlmgrep-0.1.8.dist-info → rlmgrep-0.1.10.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.10"
|
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.10
|
|
4
4
|
Summary: Grep-shaped CLI search powered by DSPy RLM
|
|
5
5
|
Author: rlmgrep
|
|
6
6
|
License: MIT
|
|
@@ -22,7 +22,8 @@ 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
|
-
rlmgrep "where are
|
|
25
|
+
rlmgrep --answer "What does this repo do and where are the entry points?" .
|
|
26
|
+
rlmgrep -C 2 "Where is retry/backoff configured and what are the defaults?" .
|
|
26
27
|
```
|
|
27
28
|
|
|
28
29
|
## Requirements
|
|
@@ -75,6 +76,7 @@ rlmgrep [options] "query" [paths...]
|
|
|
75
76
|
|
|
76
77
|
Common options:
|
|
77
78
|
|
|
79
|
+
- `--answer` return a narrative answer before the grep output
|
|
78
80
|
- `-C N` context lines before/after (grep-style)
|
|
79
81
|
- `-A N` context lines after
|
|
80
82
|
- `-B N` context lines before
|
|
@@ -95,7 +97,7 @@ Examples:
|
|
|
95
97
|
|
|
96
98
|
```sh
|
|
97
99
|
# Natural-language query over a repo
|
|
98
|
-
rlmgrep -
|
|
100
|
+
rlmgrep -C 2 "Where is retry/backoff configured and what are the defaults?" .
|
|
99
101
|
|
|
100
102
|
# Restrict to Python files
|
|
101
103
|
rlmgrep "Where do we parse JWTs and enforce expiration?" --type py .
|
|
@@ -125,7 +127,7 @@ rg -l "token" . | rlmgrep --files-from-stdin --answer "What does this token cont
|
|
|
125
127
|
- Output uses rg-style headings by default:
|
|
126
128
|
- A file header line like `./path/to/file`
|
|
127
129
|
- Then `line:\ttext` for matches, `line-\ttext` for context lines
|
|
128
|
-
- Line numbers are 1-based.
|
|
130
|
+
- Line numbers are always included and are 1-based.
|
|
129
131
|
- When context ranges are disjoint, a `--` line separates groups.
|
|
130
132
|
- Exit codes:
|
|
131
133
|
- `0` = at least one match
|
|
@@ -140,7 +142,7 @@ rlmgrep can interpret traditional regex-style patterns inside a natural-language
|
|
|
140
142
|
Example (best-effort regex semantics + extra context):
|
|
141
143
|
|
|
142
144
|
```sh
|
|
143
|
-
rlmgrep
|
|
145
|
+
rlmgrep "Find Python functions that look like `def test_\\w+` and are marked as slow or flaky in nearby comments." .
|
|
144
146
|
```
|
|
145
147
|
|
|
146
148
|
If you need strict, deterministic regex behavior, use `rg`/`grep`.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
rlmgrep/__init__.py,sha256=EFWL7tqAdmDdGhDfl3jtag-Ds4vHOCNDFdvMC2yYodU,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.10.dist-info/METADATA,sha256=u4EfxtRfTmzvuu4jD5lBsXZQIHjElMZs9iZe79d4Peg,7349
|
|
11
|
+
rlmgrep-0.1.10.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
12
|
+
rlmgrep-0.1.10.dist-info/entry_points.txt,sha256=UV6QkEbkwBO1JJ53mm84_n35tVyOczPvOQ14ga7vrCI,45
|
|
13
|
+
rlmgrep-0.1.10.dist-info/top_level.txt,sha256=gTujSRsO58c80eN7aRH2cfe51FHxx8LJ1w1Y2YlHti0,8
|
|
14
|
+
rlmgrep-0.1.10.dist-info/RECORD,,
|
rlmgrep-0.1.8.dist-info/RECORD
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
rlmgrep/__init__.py,sha256=J-ZAXY7tnYw7E5X3eod4-Q1hZ1FtnW7JHRKkkRpff-c,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.8.dist-info/METADATA,sha256=C_gnUrUZ_Wktda5-QgX4qn0f1fZWqLUHwN6uSNGK5DQ,7157
|
|
11
|
-
rlmgrep-0.1.8.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
12
|
-
rlmgrep-0.1.8.dist-info/entry_points.txt,sha256=UV6QkEbkwBO1JJ53mm84_n35tVyOczPvOQ14ga7vrCI,45
|
|
13
|
-
rlmgrep-0.1.8.dist-info/top_level.txt,sha256=gTujSRsO58c80eN7aRH2cfe51FHxx8LJ1w1Y2YlHti0,8
|
|
14
|
-
rlmgrep-0.1.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|