raggrep 0.5.1 → 0.5.2

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.
package/README.md CHANGED
@@ -78,19 +78,60 @@ This monitors file changes and re-indexes automatically. Useful during active de
78
78
  [Watch] language/typescript: 2 indexed, 0 errors
79
79
  ```
80
80
 
81
- ## CLI Quick Reference
81
+ ## CLI Reference
82
+
83
+ ### Commands
82
84
 
83
85
  ```bash
84
- # Search (auto-indexes if needed)
85
- raggrep query "user login"
86
- raggrep query "error handling" --top 5
87
- raggrep query "database" --type ts
86
+ raggrep query <query> # Search the codebase
87
+ raggrep index # Build/update the index
88
+ raggrep status # Show index status
89
+ raggrep reset # Clear the index
90
+ ```
88
91
 
89
- # Watch mode
90
- raggrep index --watch
92
+ ### Query Options
93
+
94
+ ```bash
95
+ raggrep query "user login" # Basic search
96
+ raggrep query "error handling" --top 5 # Limit results
97
+ raggrep query "database" --min-score 0.2 # Set minimum score threshold
98
+ raggrep query "interface" --type ts # Filter by file extension
99
+ raggrep query "auth" --filter src/auth # Filter by path
100
+ raggrep query "api" -f src/api -f src/routes # Multiple path filters
101
+ ```
102
+
103
+ | Flag | Short | Description |
104
+ |------|-------|-------------|
105
+ | `--top <n>` | `-k` | Number of results to return (default: 10) |
106
+ | `--min-score <n>` | `-s` | Minimum similarity score 0-1 (default: 0.15) |
107
+ | `--type <ext>` | `-t` | Filter by file extension (e.g., ts, tsx, js) |
108
+ | `--filter <path>` | `-f` | Filter by path prefix (can be used multiple times) |
109
+ | `--help` | `-h` | Show help message |
110
+
111
+ ### Index Options
91
112
 
92
- # Check index status
93
- raggrep status
113
+ ```bash
114
+ raggrep index # Index current directory
115
+ raggrep index --watch # Watch mode - re-index on file changes
116
+ raggrep index --verbose # Show detailed progress
117
+ raggrep index --concurrency 8 # Set parallel workers (default: auto)
118
+ raggrep index --model bge-small-en-v1.5 # Use specific embedding model
119
+ ```
120
+
121
+ | Flag | Short | Description |
122
+ |------|-------|-------------|
123
+ | `--watch` | `-w` | Watch for file changes and re-index automatically |
124
+ | `--verbose` | `-v` | Show detailed progress |
125
+ | `--concurrency <n>` | `-c` | Number of parallel workers (default: auto based on CPU) |
126
+ | `--model <name>` | `-m` | Embedding model to use |
127
+ | `--help` | `-h` | Show help message |
128
+
129
+ ### Other Commands
130
+
131
+ ```bash
132
+ raggrep status # Show index status and statistics
133
+ raggrep reset # Clear the index completely
134
+ raggrep --version # Show version
94
135
  ```
95
136
 
96
137
  ## How It Works
@@ -104,9 +145,13 @@ The index is stored in a system temp directory, keeping your project clean.
104
145
 
105
146
  ## What Gets Indexed
106
147
 
107
- **File types:** `.ts`, `.tsx`, `.js`, `.jsx`, `.py`, `.go`, `.rs`, `.java`, `.md`, `.txt`
148
+ **TypeScript/JavaScript:** `.ts`, `.tsx`, `.js`, `.jsx`, `.mjs`, `.cjs` AST-parsed for functions, classes, interfaces, types, enums
149
+
150
+ **Documentation:** `.md`, `.txt` — Section-aware parsing with heading extraction
151
+
152
+ **Data:** `.json` — Structure-aware with key/value extraction
108
153
 
109
- **Code structures:** Functions, classes, interfaces, types, enums, exports
154
+ **Other languages:** `.py`, `.go`, `.rs`, `.java`, `.yaml`, `.yml`, `.toml`, `.sql` — Symbol extraction and keyword search
110
155
 
111
156
  **Automatically ignored:** `node_modules`, `dist`, `build`, `.git`, and other common directories
112
157
 
@@ -16,7 +16,7 @@ export interface IndexOptions {
16
16
  quiet?: boolean;
17
17
  /** Logger for progress reporting. If not provided, uses console by default (quiet mode uses silent logger) */
18
18
  logger?: Logger;
19
- /** Number of files to process in parallel (default: 4) */
19
+ /** Number of files to process in parallel (default: auto based on CPU cores) */
20
20
  concurrency?: number;
21
21
  }
22
22
  export interface EnsureFreshResult {
package/dist/cli/main.js CHANGED
@@ -4275,6 +4275,7 @@ __export(exports_indexer, {
4275
4275
  import { glob } from "glob";
4276
4276
  import * as fs6 from "fs/promises";
4277
4277
  import * as path15 from "path";
4278
+ import * as os3 from "os";
4278
4279
  async function parallelMap(items, processor, concurrency) {
4279
4280
  const results = new Array(items.length);
4280
4281
  let nextIndex = 0;
@@ -4306,6 +4307,11 @@ function formatDuration(ms) {
4306
4307
  const remainingSeconds = seconds % 60;
4307
4308
  return `${minutes}m ${remainingSeconds.toFixed(1)}s`;
4308
4309
  }
4310
+ function getOptimalConcurrency() {
4311
+ const cpuCount = os3.cpus().length;
4312
+ const optimal = Math.max(2, Math.min(16, Math.floor(cpuCount * 0.75)));
4313
+ return optimal;
4314
+ }
4309
4315
  async function indexDirectory(rootDir, options = {}) {
4310
4316
  const verbose = options.verbose ?? false;
4311
4317
  const quiet = options.quiet ?? false;
@@ -4849,13 +4855,14 @@ async function getIndexStatus(rootDir) {
4849
4855
  }
4850
4856
  return status;
4851
4857
  }
4852
- var INDEX_SCHEMA_VERSION = "1.0.0", DEFAULT_CONCURRENCY = 4;
4858
+ var INDEX_SCHEMA_VERSION = "1.0.0", DEFAULT_CONCURRENCY;
4853
4859
  var init_indexer = __esm(() => {
4854
4860
  init_config2();
4855
4861
  init_registry();
4856
4862
  init_introspection2();
4857
4863
  init_logger();
4858
4864
  init_watcher();
4865
+ DEFAULT_CONCURRENCY = getOptimalConcurrency();
4859
4866
  });
4860
4867
 
4861
4868
  // src/types.ts
@@ -5025,7 +5032,7 @@ init_logger();
5025
5032
  // package.json
5026
5033
  var package_default = {
5027
5034
  name: "raggrep",
5028
- version: "0.5.1",
5035
+ version: "0.5.2",
5029
5036
  description: "Local filesystem-based RAG system for codebases - semantic search using local embeddings",
5030
5037
  type: "module",
5031
5038
  main: "./dist/index.js",
@@ -5201,7 +5208,7 @@ Usage:
5201
5208
  Options:
5202
5209
  -w, --watch Watch for file changes and re-index automatically
5203
5210
  -m, --model <name> Embedding model to use (default: all-MiniLM-L6-v2)
5204
- -c, --concurrency <n> Number of files to process in parallel (default: 4)
5211
+ -c, --concurrency <n> Number of files to process in parallel (default: auto)
5205
5212
  -v, --verbose Show detailed progress
5206
5213
  -h, --help Show this help message
5207
5214
 
@@ -5486,4 +5493,4 @@ Run 'raggrep <command> --help' for more information.
5486
5493
  }
5487
5494
  main();
5488
5495
 
5489
- //# debugId=E73618F0DDE8326264756E2164756E21
5496
+ //# debugId=3B601F4F22C997A464756E2164756E21