rlmgrep 0.1.1__tar.gz → 0.1.3__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.3}/PKG-INFO +17 -1
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/README.md +16 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/pyproject.toml +1 -1
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/rlmgrep/__init__.py +1 -1
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/rlmgrep/cli.py +26 -3
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/rlmgrep/config.py +2 -5
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/rlmgrep.egg-info/PKG-INFO +17 -1
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/rlmgrep/__main__.py +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/rlmgrep/file_map.py +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/rlmgrep/ingest.py +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/rlmgrep/interpreter.py +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/rlmgrep/render.py +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/rlmgrep/rlm.py +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/rlmgrep.egg-info/SOURCES.txt +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/rlmgrep.egg-info/dependency_links.txt +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/rlmgrep.egg-info/entry_points.txt +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/rlmgrep.egg-info/requires.txt +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/rlmgrep.egg-info/top_level.txt +0 -0
- {rlmgrep-0.1.1 → rlmgrep-0.1.3}/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.3
|
|
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:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__all__ = ["__version__"]
|
|
2
|
-
__version__ = "0.1.
|
|
2
|
+
__version__ = "0.1.3"
|
|
@@ -6,6 +6,7 @@ import sys
|
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
|
|
8
8
|
import dspy
|
|
9
|
+
from . import __version__
|
|
9
10
|
from .config import ensure_default_config, load_config
|
|
10
11
|
from .file_map import build_file_map
|
|
11
12
|
from .ingest import FileRecord, collect_candidates, load_files, resolve_type_exts
|
|
@@ -67,6 +68,7 @@ def _parse_args(argv: list[str]) -> argparse.Namespace:
|
|
|
67
68
|
prog="rlmgrep",
|
|
68
69
|
description="Grep-shaped CLI search powered by DSPy RLM.",
|
|
69
70
|
)
|
|
71
|
+
parser.add_argument("--version", action="version", version=f"rlmgrep {__version__}")
|
|
70
72
|
parser.add_argument("pattern", nargs="?", help="Query string (interpreted by RLM)")
|
|
71
73
|
parser.add_argument("paths", nargs="*", help="Files or directories")
|
|
72
74
|
|
|
@@ -83,6 +85,11 @@ def _parse_args(argv: list[str]) -> argparse.Namespace:
|
|
|
83
85
|
parser.add_argument("-a", "--text", dest="binary_as_text", action="store_true", help="Search binary files as text")
|
|
84
86
|
parser.add_argument("--answer", action="store_true", help="Print a narrative answer before grep output")
|
|
85
87
|
parser.add_argument("-y", "--yes", action="store_true", help="Skip file count confirmation")
|
|
88
|
+
parser.add_argument(
|
|
89
|
+
"--stdin-files",
|
|
90
|
+
action="store_true",
|
|
91
|
+
help="Treat stdin as newline-delimited file paths",
|
|
92
|
+
)
|
|
86
93
|
|
|
87
94
|
parser.add_argument("-g", "--glob", dest="globs", action="append", default=[], help="Include files matching glob (may repeat)")
|
|
88
95
|
parser.add_argument("--type", dest="types", action="append", default=[], help="Include file types (py, js, md, etc.). May repeat")
|
|
@@ -336,11 +343,27 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
336
343
|
for w in md_warnings:
|
|
337
344
|
_warn(w)
|
|
338
345
|
|
|
339
|
-
|
|
346
|
+
input_paths: list[str] | None = None
|
|
347
|
+
stdin_text: str | None = None
|
|
348
|
+
if args.paths:
|
|
349
|
+
input_paths = list(args.paths)
|
|
350
|
+
elif args.stdin_files:
|
|
340
351
|
if sys.stdin.isatty():
|
|
341
352
|
_warn("no input paths and stdin is empty")
|
|
342
353
|
return 2
|
|
343
|
-
|
|
354
|
+
raw = sys.stdin.read()
|
|
355
|
+
input_paths = [line.strip() for line in raw.splitlines() if line.strip()]
|
|
356
|
+
if not input_paths:
|
|
357
|
+
_warn("stdin contained no file paths")
|
|
358
|
+
return 2
|
|
359
|
+
else:
|
|
360
|
+
if sys.stdin.isatty():
|
|
361
|
+
_warn("no input paths and stdin is empty")
|
|
362
|
+
return 2
|
|
363
|
+
stdin_text = sys.stdin.read()
|
|
364
|
+
|
|
365
|
+
if input_paths is None:
|
|
366
|
+
text = stdin_text or ""
|
|
344
367
|
files = {
|
|
345
368
|
"<stdin>": FileRecord(path="<stdin>", text=text, lines=text.split("\n"))
|
|
346
369
|
}
|
|
@@ -356,7 +379,7 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
356
379
|
hard_max = None
|
|
357
380
|
|
|
358
381
|
candidates = collect_candidates(
|
|
359
|
-
|
|
382
|
+
input_paths,
|
|
360
383
|
cwd=cwd,
|
|
361
384
|
recursive=args.recursive,
|
|
362
385
|
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.3
|
|
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
|