You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS_README.md
+18-3Lines changed: 18 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ You have access to `smartgrep`, a structural code navigation tool. Read this bef
10
10
11
11
It is **not a text search tool**. It is a **structural search tool**. It understands code, not bytes.
12
12
13
-
**Supported languages: Rust, Java, Go.** smartgrep only indexes `.rs`, `.go`, and `.java` files. It has no knowledge of `.md`, `.yaml`, `.toml`, `.json`, `.py`, `.ts`, or any other file type. For those, handle them as you normally would without smartgrep — using smartgrep for code does not mean ignoring everything else.
13
+
**Supported languages: Rust, Java, Go, and TypeScript.** smartgrep only indexes `.rs`, `.go`, `.java`, `.ts`, and `.tsx` files. It has no knowledge of `.md`, `.yaml`, `.toml`, `.json`, `.py`, or any other file type. For those, handle them as you normally would without smartgrep — using smartgrep for code does not mean ignoring everything else.
14
14
15
15
---
16
16
@@ -69,14 +69,19 @@ Symbols use language-native kind strings, not a shared enum. The `kind` field on
**For everything else** (`.md`, `.yaml`, `.toml`, `.json`, `.py`, `.ts`, `.js`, Dockerfiles, config files, documentation) — handle as you normally would without smartgrep. It has no knowledge of these file types.
13
+
**For everything else** (`.md`, `.yaml`, `.toml`, `.json`, `.py`, `.js`, Dockerfiles, config files, documentation) — handle as you normally would without smartgrep. It has no knowledge of these file types.
14
14
15
15
Using smartgrep for code does not mean ignoring non-code files. Documentation and config often contain context the code index cannot surface.
16
16
17
17
## When to use smartgrep
18
18
19
19
Use it when the user asks about:
20
-
- Code structure, architecture, or organization in Rust, Java, or Go files
| List services |`smartgrep query "structs where attributes contains '@Service' \| show name, file"`|
154
159
| Public API in a directory |`smartgrep query "functions where file contains 'src/api' and visibility = public \| show name, file, signature"`|
155
160
161
+
### TypeScript examples
162
+
```bash
163
+
# TypeScript: find decorated classes
164
+
smartgrep query "classes where attributes contains '@Injectable' | with fields"
165
+
166
+
# TypeScript: interfaces in a specific directory
167
+
smartgrep query "interfaces where file contains 'src/types/' | with fields"
168
+
169
+
# TypeScript: all exported functions (cross-language)
170
+
smartgrep query "functions where visibility = public and file contains 'src/'"
171
+
```
172
+
156
173
## Large-repo warnings
157
174
158
175
**Never run bare `smartgrep map` or `smartgrep ls functions` on a repo with 100+ files.** The output can be hundreds of lines and burns context budget without adding value. Always scope first:
@@ -170,6 +187,8 @@ smartgrep query "functions where file contains 'src/api/' | show name, file | li
170
187
171
188
**Generated files are excluded by default.** Bindgen output, protobuf stubs, and vendor code are filtered out automatically. Use `--include-generated` only when you specifically need to inspect generated code.
172
189
190
+
**node_modules** is automatically skipped during indexing.
191
+
173
192
## Output guidance
174
193
175
194
Present results concisely. Summarize patterns ("5 controllers, all in src/api/"). Quote symbol names and file paths precisely. Use smartgrep output directly rather than re-reading files unless the user needs full implementation bodies.
0 commit comments