rlmgrep 0.1.1__tar.gz → 0.1.2__tar.gz
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-0.1.1 → rlmgrep-0.1.2}/PKG-INFO +17 -1
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/README.md +16 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/pyproject.toml +1 -1
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/rlmgrep/cli.py +24 -3
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/rlmgrep/config.py +2 -5
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/rlmgrep.egg-info/PKG-INFO +17 -1
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/rlmgrep/__init__.py +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/rlmgrep/__main__.py +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/rlmgrep/file_map.py +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/rlmgrep/ingest.py +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/rlmgrep/interpreter.py +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/rlmgrep/render.py +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/rlmgrep/rlm.py +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/rlmgrep.egg-info/SOURCES.txt +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/rlmgrep.egg-info/dependency_links.txt +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/rlmgrep.egg-info/entry_points.txt +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/rlmgrep.egg-info/requires.txt +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/rlmgrep.egg-info/top_level.txt +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rlmgrep
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Grep-shaped CLI search powered by DSPy RLM
|
|
5
5
|
Author: rlmgrep
|
|
6
6
|
License: MIT
|
|
@@ -72,6 +72,7 @@ Common options:
|
|
|
72
72
|
- `--no-recursive` do not recurse directories
|
|
73
73
|
- `-a`, `--text` treat binary files as text
|
|
74
74
|
- `-y`, `--yes` skip file count confirmation
|
|
75
|
+
- `--stdin-files` treat stdin as newline-delimited file paths
|
|
75
76
|
- `--model`, `--sub-model` override model names
|
|
76
77
|
- `--api-key`, `--api-base`, `--model-type` override provider settings
|
|
77
78
|
- `--max-iterations`, `--max-llm-calls` cap RLM search effort
|
|
@@ -91,6 +92,9 @@ rlmgrep "error handling" -g "**/*.py" -g "**/*.md" .
|
|
|
91
92
|
|
|
92
93
|
# Read from stdin (only when no paths are provided)
|
|
93
94
|
cat README.md | rlmgrep "install"
|
|
95
|
+
|
|
96
|
+
# Use rg/grep to find candidate files, then rlmgrep over that list
|
|
97
|
+
rg -l "token" . | rlmgrep --stdin-files --answer "what does this token control?"
|
|
94
98
|
```
|
|
95
99
|
|
|
96
100
|
## Input selection
|
|
@@ -118,6 +122,18 @@ cat README.md | rlmgrep "install"
|
|
|
118
122
|
|
|
119
123
|
Agent tip: use `-n -H` and no context for parse-friendly output, then key off exit codes.
|
|
120
124
|
|
|
125
|
+
## Regex-style queries (best effort)
|
|
126
|
+
|
|
127
|
+
rlmgrep can interpret traditional regex-style patterns inside a natural-language prompt. The RLM may use Python (including `re`) in its internal REPL to approximate regex logic, but it is **not guaranteed** to behave exactly like `grep`/`rg`.
|
|
128
|
+
|
|
129
|
+
Example (best-effort regex semantics + extra context):
|
|
130
|
+
|
|
131
|
+
```sh
|
|
132
|
+
rlmgrep -n "Find Python functions that look like `def test_\\w+` and are marked as slow or flaky in nearby comments." .
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
If you need strict, deterministic regex behavior, use `rg`/`grep`.
|
|
136
|
+
|
|
121
137
|
## Configuration
|
|
122
138
|
|
|
123
139
|
rlmgrep creates a default config automatically if missing. The config path is:
|
|
@@ -60,6 +60,7 @@ Common options:
|
|
|
60
60
|
- `--no-recursive` do not recurse directories
|
|
61
61
|
- `-a`, `--text` treat binary files as text
|
|
62
62
|
- `-y`, `--yes` skip file count confirmation
|
|
63
|
+
- `--stdin-files` treat stdin as newline-delimited file paths
|
|
63
64
|
- `--model`, `--sub-model` override model names
|
|
64
65
|
- `--api-key`, `--api-base`, `--model-type` override provider settings
|
|
65
66
|
- `--max-iterations`, `--max-llm-calls` cap RLM search effort
|
|
@@ -79,6 +80,9 @@ rlmgrep "error handling" -g "**/*.py" -g "**/*.md" .
|
|
|
79
80
|
|
|
80
81
|
# Read from stdin (only when no paths are provided)
|
|
81
82
|
cat README.md | rlmgrep "install"
|
|
83
|
+
|
|
84
|
+
# Use rg/grep to find candidate files, then rlmgrep over that list
|
|
85
|
+
rg -l "token" . | rlmgrep --stdin-files --answer "what does this token control?"
|
|
82
86
|
```
|
|
83
87
|
|
|
84
88
|
## Input selection
|
|
@@ -106,6 +110,18 @@ cat README.md | rlmgrep "install"
|
|
|
106
110
|
|
|
107
111
|
Agent tip: use `-n -H` and no context for parse-friendly output, then key off exit codes.
|
|
108
112
|
|
|
113
|
+
## Regex-style queries (best effort)
|
|
114
|
+
|
|
115
|
+
rlmgrep can interpret traditional regex-style patterns inside a natural-language prompt. The RLM may use Python (including `re`) in its internal REPL to approximate regex logic, but it is **not guaranteed** to behave exactly like `grep`/`rg`.
|
|
116
|
+
|
|
117
|
+
Example (best-effort regex semantics + extra context):
|
|
118
|
+
|
|
119
|
+
```sh
|
|
120
|
+
rlmgrep -n "Find Python functions that look like `def test_\\w+` and are marked as slow or flaky in nearby comments." .
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
If you need strict, deterministic regex behavior, use `rg`/`grep`.
|
|
124
|
+
|
|
109
125
|
## Configuration
|
|
110
126
|
|
|
111
127
|
rlmgrep creates a default config automatically if missing. The config path is:
|
|
@@ -83,6 +83,11 @@ def _parse_args(argv: list[str]) -> argparse.Namespace:
|
|
|
83
83
|
parser.add_argument("-a", "--text", dest="binary_as_text", action="store_true", help="Search binary files as text")
|
|
84
84
|
parser.add_argument("--answer", action="store_true", help="Print a narrative answer before grep output")
|
|
85
85
|
parser.add_argument("-y", "--yes", action="store_true", help="Skip file count confirmation")
|
|
86
|
+
parser.add_argument(
|
|
87
|
+
"--stdin-files",
|
|
88
|
+
action="store_true",
|
|
89
|
+
help="Treat stdin as newline-delimited file paths",
|
|
90
|
+
)
|
|
86
91
|
|
|
87
92
|
parser.add_argument("-g", "--glob", dest="globs", action="append", default=[], help="Include files matching glob (may repeat)")
|
|
88
93
|
parser.add_argument("--type", dest="types", action="append", default=[], help="Include file types (py, js, md, etc.). May repeat")
|
|
@@ -336,11 +341,27 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
336
341
|
for w in md_warnings:
|
|
337
342
|
_warn(w)
|
|
338
343
|
|
|
339
|
-
|
|
344
|
+
input_paths: list[str] | None = None
|
|
345
|
+
stdin_text: str | None = None
|
|
346
|
+
if args.paths:
|
|
347
|
+
input_paths = list(args.paths)
|
|
348
|
+
elif args.stdin_files:
|
|
340
349
|
if sys.stdin.isatty():
|
|
341
350
|
_warn("no input paths and stdin is empty")
|
|
342
351
|
return 2
|
|
343
|
-
|
|
352
|
+
raw = sys.stdin.read()
|
|
353
|
+
input_paths = [line.strip() for line in raw.splitlines() if line.strip()]
|
|
354
|
+
if not input_paths:
|
|
355
|
+
_warn("stdin contained no file paths")
|
|
356
|
+
return 2
|
|
357
|
+
else:
|
|
358
|
+
if sys.stdin.isatty():
|
|
359
|
+
_warn("no input paths and stdin is empty")
|
|
360
|
+
return 2
|
|
361
|
+
stdin_text = sys.stdin.read()
|
|
362
|
+
|
|
363
|
+
if input_paths is None:
|
|
364
|
+
text = stdin_text or ""
|
|
344
365
|
files = {
|
|
345
366
|
"<stdin>": FileRecord(path="<stdin>", text=text, lines=text.split("\n"))
|
|
346
367
|
}
|
|
@@ -356,7 +377,7 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
356
377
|
hard_max = None
|
|
357
378
|
|
|
358
379
|
candidates = collect_candidates(
|
|
359
|
-
|
|
380
|
+
input_paths,
|
|
360
381
|
cwd=cwd,
|
|
361
382
|
recursive=args.recursive,
|
|
362
383
|
include_globs=globs,
|
|
@@ -3,10 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from typing import Any
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
import tomllib as _tomllib # type: ignore
|
|
8
|
-
except Exception: # pragma: no cover - fallback
|
|
9
|
-
import tomli as _tomllib # type: ignore
|
|
6
|
+
import tomllib
|
|
10
7
|
|
|
11
8
|
|
|
12
9
|
DEFAULT_CONFIG_TEXT = "\n".join(
|
|
@@ -67,7 +64,7 @@ def load_config(path: Path | None = None) -> tuple[dict[str, Any], list[str]]:
|
|
|
67
64
|
return {}, [f"config path is not a file: {config_path}"]
|
|
68
65
|
|
|
69
66
|
try:
|
|
70
|
-
data =
|
|
67
|
+
data = tomllib.loads(config_path.read_text())
|
|
71
68
|
except Exception as exc: # pragma: no cover - defensive
|
|
72
69
|
return {}, [f"failed to read config {config_path}: {exc}"]
|
|
73
70
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rlmgrep
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Grep-shaped CLI search powered by DSPy RLM
|
|
5
5
|
Author: rlmgrep
|
|
6
6
|
License: MIT
|
|
@@ -72,6 +72,7 @@ Common options:
|
|
|
72
72
|
- `--no-recursive` do not recurse directories
|
|
73
73
|
- `-a`, `--text` treat binary files as text
|
|
74
74
|
- `-y`, `--yes` skip file count confirmation
|
|
75
|
+
- `--stdin-files` treat stdin as newline-delimited file paths
|
|
75
76
|
- `--model`, `--sub-model` override model names
|
|
76
77
|
- `--api-key`, `--api-base`, `--model-type` override provider settings
|
|
77
78
|
- `--max-iterations`, `--max-llm-calls` cap RLM search effort
|
|
@@ -91,6 +92,9 @@ rlmgrep "error handling" -g "**/*.py" -g "**/*.md" .
|
|
|
91
92
|
|
|
92
93
|
# Read from stdin (only when no paths are provided)
|
|
93
94
|
cat README.md | rlmgrep "install"
|
|
95
|
+
|
|
96
|
+
# Use rg/grep to find candidate files, then rlmgrep over that list
|
|
97
|
+
rg -l "token" . | rlmgrep --stdin-files --answer "what does this token control?"
|
|
94
98
|
```
|
|
95
99
|
|
|
96
100
|
## Input selection
|
|
@@ -118,6 +122,18 @@ cat README.md | rlmgrep "install"
|
|
|
118
122
|
|
|
119
123
|
Agent tip: use `-n -H` and no context for parse-friendly output, then key off exit codes.
|
|
120
124
|
|
|
125
|
+
## Regex-style queries (best effort)
|
|
126
|
+
|
|
127
|
+
rlmgrep can interpret traditional regex-style patterns inside a natural-language prompt. The RLM may use Python (including `re`) in its internal REPL to approximate regex logic, but it is **not guaranteed** to behave exactly like `grep`/`rg`.
|
|
128
|
+
|
|
129
|
+
Example (best-effort regex semantics + extra context):
|
|
130
|
+
|
|
131
|
+
```sh
|
|
132
|
+
rlmgrep -n "Find Python functions that look like `def test_\\w+` and are marked as slow or flaky in nearby comments." .
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
If you need strict, deterministic regex behavior, use `rg`/`grep`.
|
|
136
|
+
|
|
121
137
|
## Configuration
|
|
122
138
|
|
|
123
139
|
rlmgrep creates a default config automatically if missing. The config path is:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|