@twahaa/codefinder 1.0.0 → 1.0.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 +30 -0
- package/build/client.js +1 -1
- package/build/server.js +1 -1
- package/build/tools/listFile.js +2 -13
- package/build/utils/ignoreList.js +41 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -175,6 +175,36 @@ You will be prompted for:
|
|
|
175
175
|
|
|
176
176
|
---
|
|
177
177
|
|
|
178
|
+
## Installation and Usage
|
|
179
|
+
|
|
180
|
+
The `codefinder` package provides a command-line interface (CLI) tool for exploring and searching codebases.
|
|
181
|
+
|
|
182
|
+
### Installation
|
|
183
|
+
|
|
184
|
+
To install `codefinder` globally, run:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
npm install -g @twahaa/codefinder
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Alternatively, you can use `npx` to run it without global installation:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
npx @twahaa/codefinder
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Usage
|
|
197
|
+
|
|
198
|
+
Once installed, you can run the `codefinder` command from your terminal:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
codefinder
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
This will launch an interactive Gemini client that allows you to explore and search codebases using the provided MCP tools. Follow the on-screen prompts to interact with the client.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
178
208
|
## What the Server Provides (Tools)
|
|
179
209
|
|
|
180
210
|
The MCP server exposes three safe, deterministic tools:
|
package/build/client.js
CHANGED
package/build/server.js
CHANGED
package/build/tools/listFile.js
CHANGED
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { resolveSafePath } from "../utils/pathGuard.js";
|
|
4
|
-
|
|
5
|
-
"node_modules",
|
|
6
|
-
".git",
|
|
7
|
-
"dist",
|
|
8
|
-
"build",
|
|
9
|
-
".next",
|
|
10
|
-
".env",
|
|
11
|
-
"package-lock.json",
|
|
12
|
-
"yarn.lock",
|
|
13
|
-
"pnpm-lock.yaml",
|
|
14
|
-
"package.json",
|
|
15
|
-
]);
|
|
4
|
+
import { IGNORE_LIST } from "../utils/ignoreList.js";
|
|
16
5
|
const MAX_DEPTH = 2;
|
|
17
6
|
export function listFile(dir = ".") {
|
|
18
7
|
const safeDir = resolveSafePath(dir);
|
|
@@ -26,7 +15,7 @@ function walkDirectory(absoluteDir, depth) {
|
|
|
26
15
|
const entires = fs.readdirSync(absoluteDir, { withFileTypes: true });
|
|
27
16
|
const result = [];
|
|
28
17
|
for (const entry of entires) {
|
|
29
|
-
if (
|
|
18
|
+
if (IGNORE_LIST.has(entry.name))
|
|
30
19
|
continue;
|
|
31
20
|
const entryPath = path.join(absoluteDir, entry.name);
|
|
32
21
|
if (entry.isFile()) {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export const IGNORE_LIST = new Set([
|
|
2
|
+
// Version control
|
|
3
|
+
".git",
|
|
4
|
+
".svn",
|
|
5
|
+
".hg",
|
|
6
|
+
// Dependencies
|
|
7
|
+
"node_modules",
|
|
8
|
+
"bower_components",
|
|
9
|
+
// Build outputs
|
|
10
|
+
"dist",
|
|
11
|
+
"build",
|
|
12
|
+
".next",
|
|
13
|
+
"out",
|
|
14
|
+
"coverage",
|
|
15
|
+
// Environment variables
|
|
16
|
+
".env",
|
|
17
|
+
".env.local",
|
|
18
|
+
".env.development",
|
|
19
|
+
".env.test",
|
|
20
|
+
".env.production",
|
|
21
|
+
// Lock files
|
|
22
|
+
"package-lock.json",
|
|
23
|
+
"yarn.lock",
|
|
24
|
+
"pnpm-lock.yaml",
|
|
25
|
+
// IDEs and editors
|
|
26
|
+
".vscode",
|
|
27
|
+
".idea",
|
|
28
|
+
".project",
|
|
29
|
+
".classpath",
|
|
30
|
+
".settings",
|
|
31
|
+
// OS generated files
|
|
32
|
+
".DS_Store",
|
|
33
|
+
"Thumbs.db",
|
|
34
|
+
// npm
|
|
35
|
+
".npmrc",
|
|
36
|
+
".npm",
|
|
37
|
+
// yarn
|
|
38
|
+
".yarnrc",
|
|
39
|
+
// Project config
|
|
40
|
+
"package.json",
|
|
41
|
+
]);
|
package/package.json
CHANGED