codesift-mcp 0.1.0
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/LICENSE +21 -0
- package/README.md +241 -0
- package/dist/cli/args.d.ts +13 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +79 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/commands.d.ts +4 -0
- package/dist/cli/commands.d.ts.map +1 -0
- package/dist/cli/commands.js +336 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/cli/help.d.ts +3 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +271 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +80 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +23 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +49 -0
- package/dist/config.js.map +1 -0
- package/dist/parser/extractors/go.d.ts +4 -0
- package/dist/parser/extractors/go.d.ts.map +1 -0
- package/dist/parser/extractors/go.js +185 -0
- package/dist/parser/extractors/go.js.map +1 -0
- package/dist/parser/extractors/javascript.d.ts +9 -0
- package/dist/parser/extractors/javascript.d.ts.map +1 -0
- package/dist/parser/extractors/javascript.js +10 -0
- package/dist/parser/extractors/javascript.js.map +1 -0
- package/dist/parser/extractors/markdown.d.ts +15 -0
- package/dist/parser/extractors/markdown.d.ts.map +1 -0
- package/dist/parser/extractors/markdown.js +217 -0
- package/dist/parser/extractors/markdown.js.map +1 -0
- package/dist/parser/extractors/prisma.d.ts +17 -0
- package/dist/parser/extractors/prisma.d.ts.map +1 -0
- package/dist/parser/extractors/prisma.js +121 -0
- package/dist/parser/extractors/prisma.js.map +1 -0
- package/dist/parser/extractors/python.d.ts +4 -0
- package/dist/parser/extractors/python.d.ts.map +1 -0
- package/dist/parser/extractors/python.js +203 -0
- package/dist/parser/extractors/python.js.map +1 -0
- package/dist/parser/extractors/rust.d.ts +4 -0
- package/dist/parser/extractors/rust.d.ts.map +1 -0
- package/dist/parser/extractors/rust.js +178 -0
- package/dist/parser/extractors/rust.js.map +1 -0
- package/dist/parser/extractors/typescript.d.ts +4 -0
- package/dist/parser/extractors/typescript.d.ts.map +1 -0
- package/dist/parser/extractors/typescript.js +296 -0
- package/dist/parser/extractors/typescript.js.map +1 -0
- package/dist/parser/languages/tree-sitter-css.wasm +0 -0
- package/dist/parser/languages/tree-sitter-go.wasm +0 -0
- package/dist/parser/languages/tree-sitter-java.wasm +0 -0
- package/dist/parser/languages/tree-sitter-javascript.wasm +0 -0
- package/dist/parser/languages/tree-sitter-json.wasm +0 -0
- package/dist/parser/languages/tree-sitter-php.wasm +0 -0
- package/dist/parser/languages/tree-sitter-python.wasm +0 -0
- package/dist/parser/languages/tree-sitter-ruby.wasm +0 -0
- package/dist/parser/languages/tree-sitter-rust.wasm +0 -0
- package/dist/parser/languages/tree-sitter-tsx.wasm +0 -0
- package/dist/parser/languages/tree-sitter-typescript.wasm +0 -0
- package/dist/parser/parser-manager.d.ts +6 -0
- package/dist/parser/parser-manager.d.ts.map +1 -0
- package/dist/parser/parser-manager.js +60 -0
- package/dist/parser/parser-manager.js.map +1 -0
- package/dist/parser/symbol-extractor.d.ts +22 -0
- package/dist/parser/symbol-extractor.d.ts.map +1 -0
- package/dist/parser/symbol-extractor.js +115 -0
- package/dist/parser/symbol-extractor.js.map +1 -0
- package/dist/retrieval/codebase-retrieval.d.ts +27 -0
- package/dist/retrieval/codebase-retrieval.d.ts.map +1 -0
- package/dist/retrieval/codebase-retrieval.js +472 -0
- package/dist/retrieval/codebase-retrieval.js.map +1 -0
- package/dist/search/bm25.d.ts +22 -0
- package/dist/search/bm25.d.ts.map +1 -0
- package/dist/search/bm25.js +179 -0
- package/dist/search/bm25.js.map +1 -0
- package/dist/search/chunker.d.ts +9 -0
- package/dist/search/chunker.d.ts.map +1 -0
- package/dist/search/chunker.js +91 -0
- package/dist/search/chunker.js.map +1 -0
- package/dist/search/hybrid.d.ts +16 -0
- package/dist/search/hybrid.d.ts.map +1 -0
- package/dist/search/hybrid.js +51 -0
- package/dist/search/hybrid.js.map +1 -0
- package/dist/search/semantic.d.ts +44 -0
- package/dist/search/semantic.d.ts.map +1 -0
- package/dist/search/semantic.js +194 -0
- package/dist/search/semantic.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +285 -0
- package/dist/server.js.map +1 -0
- package/dist/storage/chunk-store.d.ts +32 -0
- package/dist/storage/chunk-store.d.ts.map +1 -0
- package/dist/storage/chunk-store.js +144 -0
- package/dist/storage/chunk-store.js.map +1 -0
- package/dist/storage/embedding-store.d.ts +41 -0
- package/dist/storage/embedding-store.d.ts.map +1 -0
- package/dist/storage/embedding-store.js +149 -0
- package/dist/storage/embedding-store.js.map +1 -0
- package/dist/storage/index-store.d.ts +23 -0
- package/dist/storage/index-store.d.ts.map +1 -0
- package/dist/storage/index-store.js +95 -0
- package/dist/storage/index-store.js.map +1 -0
- package/dist/storage/registry.d.ts +35 -0
- package/dist/storage/registry.d.ts.map +1 -0
- package/dist/storage/registry.js +99 -0
- package/dist/storage/registry.js.map +1 -0
- package/dist/storage/usage-stats.d.ts +32 -0
- package/dist/storage/usage-stats.d.ts.map +1 -0
- package/dist/storage/usage-stats.js +180 -0
- package/dist/storage/usage-stats.js.map +1 -0
- package/dist/storage/usage-tracker.d.ts +35 -0
- package/dist/storage/usage-tracker.d.ts.map +1 -0
- package/dist/storage/usage-tracker.js +245 -0
- package/dist/storage/usage-tracker.js.map +1 -0
- package/dist/storage/watcher.d.ts +12 -0
- package/dist/storage/watcher.d.ts.map +1 -0
- package/dist/storage/watcher.js +66 -0
- package/dist/storage/watcher.js.map +1 -0
- package/dist/tools/context-tools.d.ts +31 -0
- package/dist/tools/context-tools.d.ts.map +1 -0
- package/dist/tools/context-tools.js +219 -0
- package/dist/tools/context-tools.js.map +1 -0
- package/dist/tools/diff-tools.d.ts +22 -0
- package/dist/tools/diff-tools.d.ts.map +1 -0
- package/dist/tools/diff-tools.js +165 -0
- package/dist/tools/diff-tools.js.map +1 -0
- package/dist/tools/generate-tools.d.ts +11 -0
- package/dist/tools/generate-tools.d.ts.map +1 -0
- package/dist/tools/generate-tools.js +135 -0
- package/dist/tools/generate-tools.js.map +1 -0
- package/dist/tools/graph-tools.d.ts +60 -0
- package/dist/tools/graph-tools.d.ts.map +1 -0
- package/dist/tools/graph-tools.js +313 -0
- package/dist/tools/graph-tools.js.map +1 -0
- package/dist/tools/index-tools.d.ts +39 -0
- package/dist/tools/index-tools.d.ts.map +1 -0
- package/dist/tools/index-tools.js +451 -0
- package/dist/tools/index-tools.js.map +1 -0
- package/dist/tools/outline-tools.d.ts +59 -0
- package/dist/tools/outline-tools.d.ts.map +1 -0
- package/dist/tools/outline-tools.js +342 -0
- package/dist/tools/outline-tools.js.map +1 -0
- package/dist/tools/search-tools.d.ts +29 -0
- package/dist/tools/search-tools.d.ts.map +1 -0
- package/dist/tools/search-tools.js +309 -0
- package/dist/tools/search-tools.js.map +1 -0
- package/dist/tools/symbol-tools.d.ts +24 -0
- package/dist/tools/symbol-tools.d.ts.map +1 -0
- package/dist/tools/symbol-tools.js +172 -0
- package/dist/tools/symbol-tools.js.map +1 -0
- package/dist/types.d.ts +91 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/git-validation.d.ts +11 -0
- package/dist/utils/git-validation.d.ts.map +1 -0
- package/dist/utils/git-validation.js +19 -0
- package/dist/utils/git-validation.js.map +1 -0
- package/dist/utils/test-file.d.ts +11 -0
- package/dist/utils/test-file.d.ts.map +1 -0
- package/dist/utils/test-file.js +27 -0
- package/dist/utils/test-file.js.map +1 -0
- package/package.json +62 -0
- package/src/parser/languages/tree-sitter-css.wasm +0 -0
- package/src/parser/languages/tree-sitter-go.wasm +0 -0
- package/src/parser/languages/tree-sitter-java.wasm +0 -0
- package/src/parser/languages/tree-sitter-javascript.wasm +0 -0
- package/src/parser/languages/tree-sitter-json.wasm +0 -0
- package/src/parser/languages/tree-sitter-php.wasm +0 -0
- package/src/parser/languages/tree-sitter-python.wasm +0 -0
- package/src/parser/languages/tree-sitter-ruby.wasm +0 -0
- package/src/parser/languages/tree-sitter-rust.wasm +0 -0
- package/src/parser/languages/tree-sitter-tsx.wasm +0 -0
- package/src/parser/languages/tree-sitter-typescript.wasm +0 -0
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// CLI command handlers
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
import { getFlag, getBoolFlag, getNumFlag, requireArg, output, die } from "./args.js";
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Index commands
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
async function handleIndex(args, flags) {
|
|
9
|
+
const path = requireArg(args, 0, "path");
|
|
10
|
+
const { indexFolder } = await import("../tools/index-tools.js");
|
|
11
|
+
const includePathsRaw = getFlag(flags, "include-paths");
|
|
12
|
+
const includePaths = includePathsRaw ? includePathsRaw.split(",").map(p => p.trim()) : undefined;
|
|
13
|
+
const result = await indexFolder(path, {
|
|
14
|
+
incremental: getBoolFlag(flags, "incremental"),
|
|
15
|
+
include_paths: includePaths,
|
|
16
|
+
watch: getBoolFlag(flags, "no-watch") === true ? false : undefined,
|
|
17
|
+
});
|
|
18
|
+
output(result, flags);
|
|
19
|
+
}
|
|
20
|
+
async function handleIndexRepo(args, flags) {
|
|
21
|
+
const url = requireArg(args, 0, "url");
|
|
22
|
+
const { indexRepo } = await import("../tools/index-tools.js");
|
|
23
|
+
const includePathsRaw = getFlag(flags, "include-paths");
|
|
24
|
+
const includePaths = includePathsRaw ? includePathsRaw.split(",").map(p => p.trim()) : undefined;
|
|
25
|
+
const result = await indexRepo(url, {
|
|
26
|
+
branch: getFlag(flags, "branch"),
|
|
27
|
+
include_paths: includePaths,
|
|
28
|
+
});
|
|
29
|
+
output(result, flags);
|
|
30
|
+
}
|
|
31
|
+
async function handleRepos(_args, flags) {
|
|
32
|
+
const { listAllRepos } = await import("../tools/index-tools.js");
|
|
33
|
+
const result = await listAllRepos();
|
|
34
|
+
output(result, flags);
|
|
35
|
+
}
|
|
36
|
+
async function handleInvalidate(args, flags) {
|
|
37
|
+
const repo = requireArg(args, 0, "repo");
|
|
38
|
+
const { invalidateCache } = await import("../tools/index-tools.js");
|
|
39
|
+
const result = await invalidateCache(repo);
|
|
40
|
+
output({ invalidated: result, repo }, flags);
|
|
41
|
+
}
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
// Search commands
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
async function handleSearch(args, flags) {
|
|
46
|
+
const repo = requireArg(args, 0, "repo");
|
|
47
|
+
const query = requireArg(args, 1, "query");
|
|
48
|
+
const { searchText } = await import("../tools/search-tools.js");
|
|
49
|
+
const result = await searchText(repo, query, {
|
|
50
|
+
file_pattern: getFlag(flags, "file-pattern"),
|
|
51
|
+
regex: getBoolFlag(flags, "regex"),
|
|
52
|
+
context_lines: getNumFlag(flags, "context-lines"),
|
|
53
|
+
max_results: getNumFlag(flags, "max-results"),
|
|
54
|
+
});
|
|
55
|
+
output(result, flags);
|
|
56
|
+
}
|
|
57
|
+
async function handleSymbols(args, flags) {
|
|
58
|
+
const repo = requireArg(args, 0, "repo");
|
|
59
|
+
const query = requireArg(args, 1, "query");
|
|
60
|
+
const { searchSymbols } = await import("../tools/search-tools.js");
|
|
61
|
+
const includeSource = getBoolFlag(flags, "include-source");
|
|
62
|
+
const explicitTopK = getNumFlag(flags, "top-k");
|
|
63
|
+
// When --include-source is set and no explicit --top-k, default to 5
|
|
64
|
+
// instead of 50 to avoid returning 50 full function bodies
|
|
65
|
+
const topK = explicitTopK ?? (includeSource ? 5 : undefined);
|
|
66
|
+
const result = await searchSymbols(repo, query, {
|
|
67
|
+
kind: getFlag(flags, "kind"),
|
|
68
|
+
file_pattern: getFlag(flags, "file-pattern"),
|
|
69
|
+
include_source: includeSource,
|
|
70
|
+
top_k: topK,
|
|
71
|
+
source_chars: getNumFlag(flags, "source-chars"),
|
|
72
|
+
});
|
|
73
|
+
output(result, flags);
|
|
74
|
+
}
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
// Outline commands
|
|
77
|
+
// ---------------------------------------------------------------------------
|
|
78
|
+
async function handleTree(args, flags) {
|
|
79
|
+
const repo = requireArg(args, 0, "repo");
|
|
80
|
+
const { getFileTree } = await import("../tools/outline-tools.js");
|
|
81
|
+
const result = await getFileTree(repo, {
|
|
82
|
+
path_prefix: getFlag(flags, "path") ?? args[1],
|
|
83
|
+
name_pattern: getFlag(flags, "name-pattern"),
|
|
84
|
+
depth: getNumFlag(flags, "depth"),
|
|
85
|
+
compact: getBoolFlag(flags, "compact"),
|
|
86
|
+
min_symbols: getNumFlag(flags, "min-symbols"),
|
|
87
|
+
});
|
|
88
|
+
output(result, flags);
|
|
89
|
+
}
|
|
90
|
+
async function handleOutline(args, flags) {
|
|
91
|
+
const repo = requireArg(args, 0, "repo");
|
|
92
|
+
const file = requireArg(args, 1, "file");
|
|
93
|
+
const { getFileOutline } = await import("../tools/outline-tools.js");
|
|
94
|
+
const result = await getFileOutline(repo, file);
|
|
95
|
+
output(result, flags);
|
|
96
|
+
}
|
|
97
|
+
async function handleRepoOutline(args, flags) {
|
|
98
|
+
const repo = requireArg(args, 0, "repo");
|
|
99
|
+
const { getRepoOutline } = await import("../tools/outline-tools.js");
|
|
100
|
+
const result = await getRepoOutline(repo);
|
|
101
|
+
output(result, flags);
|
|
102
|
+
}
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
// Symbol commands
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
async function handleSymbol(args, flags) {
|
|
107
|
+
const repo = requireArg(args, 0, "repo");
|
|
108
|
+
const id = requireArg(args, 1, "id");
|
|
109
|
+
const { getSymbol } = await import("../tools/symbol-tools.js");
|
|
110
|
+
const result = await getSymbol(repo, id);
|
|
111
|
+
if (result === null) {
|
|
112
|
+
die(`Symbol not found: ${id}`);
|
|
113
|
+
}
|
|
114
|
+
output(result, flags);
|
|
115
|
+
}
|
|
116
|
+
async function handleSymbolsBatch(args, flags) {
|
|
117
|
+
const repo = requireArg(args, 0, "repo");
|
|
118
|
+
const ids = args.slice(1);
|
|
119
|
+
if (ids.length === 0) {
|
|
120
|
+
die("Missing required argument: <ids...>");
|
|
121
|
+
}
|
|
122
|
+
const { getSymbols } = await import("../tools/symbol-tools.js");
|
|
123
|
+
const result = await getSymbols(repo, ids);
|
|
124
|
+
output(result, flags);
|
|
125
|
+
}
|
|
126
|
+
async function handleFind(args, flags) {
|
|
127
|
+
const repo = requireArg(args, 0, "repo");
|
|
128
|
+
const query = requireArg(args, 1, "query");
|
|
129
|
+
const { findAndShow } = await import("../tools/symbol-tools.js");
|
|
130
|
+
const result = await findAndShow(repo, query, getBoolFlag(flags, "include-refs"));
|
|
131
|
+
if (result === null) {
|
|
132
|
+
die(`No symbol found matching: ${query}`);
|
|
133
|
+
}
|
|
134
|
+
output(result, flags);
|
|
135
|
+
}
|
|
136
|
+
async function handleRefs(args, flags) {
|
|
137
|
+
const repo = requireArg(args, 0, "repo");
|
|
138
|
+
const name = requireArg(args, 1, "name");
|
|
139
|
+
const { findReferences } = await import("../tools/symbol-tools.js");
|
|
140
|
+
const result = await findReferences(repo, name, getFlag(flags, "file-pattern"));
|
|
141
|
+
if (getBoolFlag(flags, "json")) {
|
|
142
|
+
output(result, flags);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
// Compact tabular output: file:line:col | context
|
|
146
|
+
for (const ref of result) {
|
|
147
|
+
const loc = `${ref.file}:${ref.line}${ref.col ? `:${ref.col}` : ""}`;
|
|
148
|
+
process.stdout.write(`${loc} | ${ref.context}\n`);
|
|
149
|
+
}
|
|
150
|
+
process.stderr.write(`\n${result.length} references found\n`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
// ---------------------------------------------------------------------------
|
|
154
|
+
// Graph commands
|
|
155
|
+
// ---------------------------------------------------------------------------
|
|
156
|
+
async function handleTrace(args, flags) {
|
|
157
|
+
const repo = requireArg(args, 0, "repo");
|
|
158
|
+
const name = requireArg(args, 1, "name");
|
|
159
|
+
const { traceCallChain } = await import("../tools/graph-tools.js");
|
|
160
|
+
const direction = (getFlag(flags, "direction") ?? "callers");
|
|
161
|
+
if (direction !== "callers" && direction !== "callees") {
|
|
162
|
+
die(`Invalid --direction: ${direction}. Must be "callers" or "callees".`);
|
|
163
|
+
}
|
|
164
|
+
const includeSource = getBoolFlag(flags, "include-source") ?? false;
|
|
165
|
+
const includeTests = getBoolFlag(flags, "include-tests") ?? false;
|
|
166
|
+
const result = await traceCallChain(repo, name, direction, {
|
|
167
|
+
depth: getNumFlag(flags, "depth"),
|
|
168
|
+
include_source: includeSource,
|
|
169
|
+
include_tests: includeTests,
|
|
170
|
+
});
|
|
171
|
+
if (getBoolFlag(flags, "json")) {
|
|
172
|
+
output(result, flags);
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
// Compact tree output
|
|
176
|
+
function printNode(node, indent) {
|
|
177
|
+
const prefix = indent === 0 ? "" : " ".repeat(indent) + "|- ";
|
|
178
|
+
const sym = node.symbol;
|
|
179
|
+
const sig = sym.signature ? ` ${sym.signature}` : "";
|
|
180
|
+
const loc = `${sym.file}:${sym.start_line}`;
|
|
181
|
+
process.stdout.write(`${prefix}${sym.kind} | ${sym.name}${sig} | ${loc}\n`);
|
|
182
|
+
for (const child of node.children) {
|
|
183
|
+
printNode(child, indent + 1);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
printNode(result, 0);
|
|
187
|
+
// Count total nodes
|
|
188
|
+
function countNodes(node) {
|
|
189
|
+
return 1 + node.children.reduce((sum, c) => sum + countNodes(c), 0);
|
|
190
|
+
}
|
|
191
|
+
process.stderr.write(`\n${countNodes(result)} symbols in trace\n`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
async function handleImpact(args, flags) {
|
|
195
|
+
const repo = requireArg(args, 0, "repo");
|
|
196
|
+
const since = getFlag(flags, "since");
|
|
197
|
+
if (!since) {
|
|
198
|
+
die("Missing required flag: --since <ref>");
|
|
199
|
+
}
|
|
200
|
+
const { impactAnalysis } = await import("../tools/graph-tools.js");
|
|
201
|
+
const result = await impactAnalysis(repo, since, {
|
|
202
|
+
depth: getNumFlag(flags, "depth"),
|
|
203
|
+
until: getFlag(flags, "until"),
|
|
204
|
+
include_source: getBoolFlag(flags, "include-source"),
|
|
205
|
+
});
|
|
206
|
+
output(result, flags);
|
|
207
|
+
}
|
|
208
|
+
// ---------------------------------------------------------------------------
|
|
209
|
+
// Context commands
|
|
210
|
+
// ---------------------------------------------------------------------------
|
|
211
|
+
async function handleContext(args, flags) {
|
|
212
|
+
const repo = requireArg(args, 0, "repo");
|
|
213
|
+
const query = requireArg(args, 1, "query");
|
|
214
|
+
const { assembleContext } = await import("../tools/context-tools.js");
|
|
215
|
+
const result = await assembleContext(repo, query, getNumFlag(flags, "token-budget"));
|
|
216
|
+
output(result, flags);
|
|
217
|
+
}
|
|
218
|
+
async function handleKnowledgeMap(args, flags) {
|
|
219
|
+
const repo = requireArg(args, 0, "repo");
|
|
220
|
+
const { getKnowledgeMap } = await import("../tools/context-tools.js");
|
|
221
|
+
const result = await getKnowledgeMap(repo, getFlag(flags, "focus"), getNumFlag(flags, "depth"));
|
|
222
|
+
output(result, flags);
|
|
223
|
+
}
|
|
224
|
+
// ---------------------------------------------------------------------------
|
|
225
|
+
// Diff commands
|
|
226
|
+
// ---------------------------------------------------------------------------
|
|
227
|
+
async function handleDiff(args, flags) {
|
|
228
|
+
const repo = requireArg(args, 0, "repo");
|
|
229
|
+
const since = getFlag(flags, "since");
|
|
230
|
+
if (!since) {
|
|
231
|
+
die("Missing required flag: --since <ref>");
|
|
232
|
+
}
|
|
233
|
+
const { diffOutline } = await import("../tools/diff-tools.js");
|
|
234
|
+
const result = await diffOutline(repo, since, getFlag(flags, "until"));
|
|
235
|
+
output(result, flags);
|
|
236
|
+
}
|
|
237
|
+
async function handleChanged(args, flags) {
|
|
238
|
+
const repo = requireArg(args, 0, "repo");
|
|
239
|
+
const since = getFlag(flags, "since");
|
|
240
|
+
if (!since) {
|
|
241
|
+
die("Missing required flag: --since <ref>");
|
|
242
|
+
}
|
|
243
|
+
const { changedSymbols } = await import("../tools/diff-tools.js");
|
|
244
|
+
const result = await changedSymbols(repo, since, getFlag(flags, "until"));
|
|
245
|
+
output(result, flags);
|
|
246
|
+
}
|
|
247
|
+
// ---------------------------------------------------------------------------
|
|
248
|
+
// Retrieval & utility commands
|
|
249
|
+
// ---------------------------------------------------------------------------
|
|
250
|
+
async function handleRetrieve(args, flags) {
|
|
251
|
+
const repo = requireArg(args, 0, "repo");
|
|
252
|
+
const queriesRaw = getFlag(flags, "queries");
|
|
253
|
+
if (!queriesRaw) {
|
|
254
|
+
die("Missing required flag: --queries <json>");
|
|
255
|
+
}
|
|
256
|
+
let queries;
|
|
257
|
+
try {
|
|
258
|
+
const parsed = JSON.parse(queriesRaw);
|
|
259
|
+
if (!Array.isArray(parsed)) {
|
|
260
|
+
die("--queries must be a JSON array");
|
|
261
|
+
}
|
|
262
|
+
queries = parsed;
|
|
263
|
+
}
|
|
264
|
+
catch {
|
|
265
|
+
die("Invalid JSON for --queries flag");
|
|
266
|
+
}
|
|
267
|
+
// --exclude-tests (default: true) — pass to semantic/hybrid sub-queries
|
|
268
|
+
// Use --no-exclude-tests or --exclude-tests=false to include test files
|
|
269
|
+
const excludeTestsFlag = getBoolFlag(flags, "exclude-tests");
|
|
270
|
+
const excludeTests = excludeTestsFlag !== false; // default true
|
|
271
|
+
if (excludeTests) {
|
|
272
|
+
// Inject exclude_tests into semantic/hybrid sub-queries that don't already specify it
|
|
273
|
+
for (const q of queries) {
|
|
274
|
+
if ((q.type === "semantic" || q.type === "hybrid") && q["exclude_tests"] === undefined) {
|
|
275
|
+
q["exclude_tests"] = true;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
// Explicitly set false on semantic/hybrid sub-queries
|
|
281
|
+
for (const q of queries) {
|
|
282
|
+
if ((q.type === "semantic" || q.type === "hybrid") && q["exclude_tests"] === undefined) {
|
|
283
|
+
q["exclude_tests"] = false;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
const { codebaseRetrieval } = await import("../retrieval/codebase-retrieval.js");
|
|
288
|
+
const result = await codebaseRetrieval(repo, queries, getNumFlag(flags, "token-budget"));
|
|
289
|
+
output(result, flags);
|
|
290
|
+
}
|
|
291
|
+
async function handleStats(_args, flags) {
|
|
292
|
+
const { getUsageStats, formatUsageReport } = await import("../storage/usage-stats.js");
|
|
293
|
+
const stats = await getUsageStats();
|
|
294
|
+
// If --json flag is set (or default), output raw stats; otherwise formatted report
|
|
295
|
+
if (getBoolFlag(flags, "json") === false) {
|
|
296
|
+
const report = formatUsageReport(stats);
|
|
297
|
+
process.stdout.write(report + "\n");
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
output(stats, flags);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
async function handleGenerateClaudeMd(args, flags) {
|
|
304
|
+
const repo = requireArg(args, 0, "repo");
|
|
305
|
+
const { generateClaudeMd } = await import("../tools/generate-tools.js");
|
|
306
|
+
const result = await generateClaudeMd(repo, getFlag(flags, "output"));
|
|
307
|
+
output(result, flags);
|
|
308
|
+
}
|
|
309
|
+
// ---------------------------------------------------------------------------
|
|
310
|
+
// Command dispatch map
|
|
311
|
+
// ---------------------------------------------------------------------------
|
|
312
|
+
export const COMMAND_MAP = {
|
|
313
|
+
"index": handleIndex,
|
|
314
|
+
"index-repo": handleIndexRepo,
|
|
315
|
+
"repos": handleRepos,
|
|
316
|
+
"invalidate": handleInvalidate,
|
|
317
|
+
"search": handleSearch,
|
|
318
|
+
"symbols": handleSymbols,
|
|
319
|
+
"tree": handleTree,
|
|
320
|
+
"outline": handleOutline,
|
|
321
|
+
"repo-outline": handleRepoOutline,
|
|
322
|
+
"symbol": handleSymbol,
|
|
323
|
+
"symbols-batch": handleSymbolsBatch,
|
|
324
|
+
"find": handleFind,
|
|
325
|
+
"refs": handleRefs,
|
|
326
|
+
"trace": handleTrace,
|
|
327
|
+
"impact": handleImpact,
|
|
328
|
+
"context": handleContext,
|
|
329
|
+
"knowledge-map": handleKnowledgeMap,
|
|
330
|
+
"diff": handleDiff,
|
|
331
|
+
"changed": handleChanged,
|
|
332
|
+
"retrieve": handleRetrieve,
|
|
333
|
+
"stats": handleStats,
|
|
334
|
+
"generate-claude-md": handleGenerateClaudeMd,
|
|
335
|
+
};
|
|
336
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,uBAAuB;AACvB,8EAA8E;AAG9E,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAItF,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E,KAAK,UAAU,WAAW,CAAC,IAAc,EAAE,KAAY;IACrD,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IACzC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;IAEhE,MAAM,eAAe,GAAG,OAAO,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IACxD,MAAM,YAAY,GAAG,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,C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AAE,WAAW;IACpB,YAAY,EAAE,eAAe;IAC7B,OAAO,EAAE,WAAW;IACpB,YAAY,EAAE,gBAAgB;IAC9B,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,aAAa;IACxB,MAAM,EAAE,UAAU;IAClB,SAAS,EAAE,aAAa;IACxB,cAAc,EAAE,iBAAiB;IACjC,QAAQ,EAAE,YAAY;IACtB,eAAe,EAAE,kBAAkB;IACnC,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,WAAW;IACpB,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,aAAa;IACxB,eAAe,EAAE,kBAAkB;IACnC,MAAM,EAAE,UAAU;IAClB,SAAS,EAAE,aAAa;IACxB,UAAU,EAAE,cAAc;IAC1B,OAAO,EAAE,WAAW;IACpB,oBAAoB,EAAE,sBAAsB;CAC7C,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const MAIN_HELP = "codesift \u2014 CLI for CodeSift code intelligence\n\nUsage: codesift <command> [options]\n\nCommands:\n index <path> Index a local folder\n index-repo <url> Clone and index a remote git repository\n repos List all indexed repositories\n invalidate <repo> Clear index cache for a repository\n\n search <repo> <query> Full-text search across all files\n symbols <repo> <query> Search symbols by name/signature\n tree <repo> Get file tree with symbol counts\n outline <repo> <file> Get symbol outline of a single file\n repo-outline <repo> High-level repository outline\n\n symbol <repo> <id> Get a single symbol by ID\n symbols-batch <repo> <ids...> Get multiple symbols by ID\n\n find <repo> <query> Find symbol and show source\n refs <repo> <name> Find all references to a symbol\n trace <repo> <name> Trace call chain (callers/callees)\n\n impact <repo> --since <ref> Analyze blast radius of git changes\n context <repo> <query> Assemble relevant code context\n knowledge-map <repo> Module dependency map\n\n diff <repo> --since <ref> Structural diff outline between git refs\n changed <repo> --since <ref> List changed symbols between git refs\n\n retrieve <repo> --queries <json> Batch multiple queries in one call\n stats Show usage statistics\n generate-claude-md <repo> Generate CLAUDE.md project summary\n\nFlags:\n --help Show help for a command\n --version Show version\n --compact Compact JSON output (no indentation)\n --json Full JSON output (for refs, trace commands)\n --include-source Include source code in output (trace, impact)\n\nExamples:\n codesift index /path/to/project\n codesift repos\n codesift search local/my-project \"createUser\"\n codesift symbols local/my-project \"handleRequest\" --kind function\n codesift tree local/my-project --path src/lib --depth 2\n codesift trace local/my-project \"createRisk\" --direction callers --depth 2\n";
|
|
2
|
+
export declare const COMMAND_HELP: Record<string, string>;
|
|
3
|
+
//# sourceMappingURL=help.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,upEAgDrB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA8O/C,CAAC"}
|
package/dist/cli/help.js
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// CLI help text
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
export const MAIN_HELP = `codesift — CLI for CodeSift code intelligence
|
|
5
|
+
|
|
6
|
+
Usage: codesift <command> [options]
|
|
7
|
+
|
|
8
|
+
Commands:
|
|
9
|
+
index <path> Index a local folder
|
|
10
|
+
index-repo <url> Clone and index a remote git repository
|
|
11
|
+
repos List all indexed repositories
|
|
12
|
+
invalidate <repo> Clear index cache for a repository
|
|
13
|
+
|
|
14
|
+
search <repo> <query> Full-text search across all files
|
|
15
|
+
symbols <repo> <query> Search symbols by name/signature
|
|
16
|
+
tree <repo> Get file tree with symbol counts
|
|
17
|
+
outline <repo> <file> Get symbol outline of a single file
|
|
18
|
+
repo-outline <repo> High-level repository outline
|
|
19
|
+
|
|
20
|
+
symbol <repo> <id> Get a single symbol by ID
|
|
21
|
+
symbols-batch <repo> <ids...> Get multiple symbols by ID
|
|
22
|
+
|
|
23
|
+
find <repo> <query> Find symbol and show source
|
|
24
|
+
refs <repo> <name> Find all references to a symbol
|
|
25
|
+
trace <repo> <name> Trace call chain (callers/callees)
|
|
26
|
+
|
|
27
|
+
impact <repo> --since <ref> Analyze blast radius of git changes
|
|
28
|
+
context <repo> <query> Assemble relevant code context
|
|
29
|
+
knowledge-map <repo> Module dependency map
|
|
30
|
+
|
|
31
|
+
diff <repo> --since <ref> Structural diff outline between git refs
|
|
32
|
+
changed <repo> --since <ref> List changed symbols between git refs
|
|
33
|
+
|
|
34
|
+
retrieve <repo> --queries <json> Batch multiple queries in one call
|
|
35
|
+
stats Show usage statistics
|
|
36
|
+
generate-claude-md <repo> Generate CLAUDE.md project summary
|
|
37
|
+
|
|
38
|
+
Flags:
|
|
39
|
+
--help Show help for a command
|
|
40
|
+
--version Show version
|
|
41
|
+
--compact Compact JSON output (no indentation)
|
|
42
|
+
--json Full JSON output (for refs, trace commands)
|
|
43
|
+
--include-source Include source code in output (trace, impact)
|
|
44
|
+
|
|
45
|
+
Examples:
|
|
46
|
+
codesift index /path/to/project
|
|
47
|
+
codesift repos
|
|
48
|
+
codesift search local/my-project "createUser"
|
|
49
|
+
codesift symbols local/my-project "handleRequest" --kind function
|
|
50
|
+
codesift tree local/my-project --path src/lib --depth 2
|
|
51
|
+
codesift trace local/my-project "createRisk" --direction callers --depth 2
|
|
52
|
+
`;
|
|
53
|
+
export const COMMAND_HELP = {
|
|
54
|
+
index: `codesift index <path> [options]
|
|
55
|
+
|
|
56
|
+
Index a local folder, extracting symbols and building the search index.
|
|
57
|
+
|
|
58
|
+
Arguments:
|
|
59
|
+
<path> Absolute path to the folder to index
|
|
60
|
+
|
|
61
|
+
Options:
|
|
62
|
+
--incremental Only re-index changed files
|
|
63
|
+
--include-paths Comma-separated path prefixes to include
|
|
64
|
+
--no-watch Disable file watcher for incremental updates`,
|
|
65
|
+
"index-repo": `codesift index-repo <url> [options]
|
|
66
|
+
|
|
67
|
+
Clone and index a remote git repository.
|
|
68
|
+
|
|
69
|
+
Arguments:
|
|
70
|
+
<url> Git clone URL
|
|
71
|
+
|
|
72
|
+
Options:
|
|
73
|
+
--branch Branch to checkout
|
|
74
|
+
--include-paths Comma-separated path prefixes to include`,
|
|
75
|
+
repos: `codesift repos
|
|
76
|
+
|
|
77
|
+
List all indexed repositories with metadata.`,
|
|
78
|
+
invalidate: `codesift invalidate <repo>
|
|
79
|
+
|
|
80
|
+
Clear the index cache for a repository, forcing full re-index on next use.
|
|
81
|
+
|
|
82
|
+
Arguments:
|
|
83
|
+
<repo> Repository identifier (e.g. local/my-project)`,
|
|
84
|
+
search: `codesift search <repo> <query> [options]
|
|
85
|
+
|
|
86
|
+
Full-text search across all files in a repository.
|
|
87
|
+
|
|
88
|
+
Arguments:
|
|
89
|
+
<repo> Repository identifier
|
|
90
|
+
<query> Search query or regex pattern
|
|
91
|
+
|
|
92
|
+
Options:
|
|
93
|
+
--file-pattern Glob pattern to filter files (e.g. "*.ts")
|
|
94
|
+
--regex Treat query as a regex pattern
|
|
95
|
+
--context-lines Number of context lines around each match (default: 2)
|
|
96
|
+
--max-results Maximum number of matching lines (default: 500)`,
|
|
97
|
+
symbols: `codesift symbols <repo> <query> [options]
|
|
98
|
+
|
|
99
|
+
Search for code symbols (functions, classes, types) by name or signature.
|
|
100
|
+
|
|
101
|
+
Arguments:
|
|
102
|
+
<repo> Repository identifier
|
|
103
|
+
<query> Search query string
|
|
104
|
+
|
|
105
|
+
Options:
|
|
106
|
+
--kind Filter by symbol kind (function, class, interface, type, etc.)
|
|
107
|
+
--file-pattern Glob pattern to filter files
|
|
108
|
+
--include-source Include full source code (default: true; sets top-k default to 5)
|
|
109
|
+
--top-k Maximum number of results (default: 50, or 5 with --include-source)
|
|
110
|
+
--source-chars Truncate each symbol's source to N characters`,
|
|
111
|
+
tree: `codesift tree <repo> [options]
|
|
112
|
+
|
|
113
|
+
Get the file tree of a repository with symbol counts per file.
|
|
114
|
+
|
|
115
|
+
Arguments:
|
|
116
|
+
<repo> Repository identifier
|
|
117
|
+
|
|
118
|
+
Options:
|
|
119
|
+
--path Filter to a subtree by path prefix
|
|
120
|
+
--name-pattern Glob pattern to filter file names
|
|
121
|
+
--depth Maximum directory depth
|
|
122
|
+
--compact Return flat list instead of nested tree
|
|
123
|
+
--min-symbols Only include files with at least N symbols`,
|
|
124
|
+
outline: `codesift outline <repo> <file>
|
|
125
|
+
|
|
126
|
+
Get the symbol outline of a single file.
|
|
127
|
+
|
|
128
|
+
Arguments:
|
|
129
|
+
<repo> Repository identifier
|
|
130
|
+
<file> Relative file path within the repository`,
|
|
131
|
+
"repo-outline": `codesift repo-outline <repo>
|
|
132
|
+
|
|
133
|
+
Get a high-level outline of the entire repository grouped by directory.
|
|
134
|
+
|
|
135
|
+
Arguments:
|
|
136
|
+
<repo> Repository identifier`,
|
|
137
|
+
symbol: `codesift symbol <repo> <id>
|
|
138
|
+
|
|
139
|
+
Retrieve a single symbol by its unique ID with full source code.
|
|
140
|
+
|
|
141
|
+
Arguments:
|
|
142
|
+
<repo> Repository identifier
|
|
143
|
+
<id> Unique symbol identifier`,
|
|
144
|
+
"symbols-batch": `codesift symbols-batch <repo> <ids...>
|
|
145
|
+
|
|
146
|
+
Retrieve multiple symbols by ID in a single batch call.
|
|
147
|
+
|
|
148
|
+
Arguments:
|
|
149
|
+
<repo> Repository identifier
|
|
150
|
+
<ids...> Space-separated symbol identifiers`,
|
|
151
|
+
find: `codesift find <repo> <query> [options]
|
|
152
|
+
|
|
153
|
+
Find a symbol by name and show its source.
|
|
154
|
+
|
|
155
|
+
Arguments:
|
|
156
|
+
<repo> Repository identifier
|
|
157
|
+
<query> Symbol name or query to search for
|
|
158
|
+
|
|
159
|
+
Options:
|
|
160
|
+
--include-refs Include locations that reference this symbol`,
|
|
161
|
+
refs: `codesift refs <repo> <name> [options]
|
|
162
|
+
|
|
163
|
+
Find all references to a symbol across the codebase.
|
|
164
|
+
|
|
165
|
+
Arguments:
|
|
166
|
+
<repo> Repository identifier
|
|
167
|
+
<name> Name of the symbol to find references for
|
|
168
|
+
|
|
169
|
+
Options:
|
|
170
|
+
--file-pattern Glob pattern to filter files
|
|
171
|
+
--json Output full JSON instead of compact table`,
|
|
172
|
+
trace: `codesift trace <repo> <name> [options]
|
|
173
|
+
|
|
174
|
+
Trace the call chain of a symbol.
|
|
175
|
+
|
|
176
|
+
Arguments:
|
|
177
|
+
<repo> Repository identifier
|
|
178
|
+
<name> Name of the symbol to trace
|
|
179
|
+
|
|
180
|
+
Options:
|
|
181
|
+
--direction Trace direction: callers or callees (default: callers)
|
|
182
|
+
--depth Maximum depth to traverse (default: 1)
|
|
183
|
+
--include-source Include full source code of each symbol
|
|
184
|
+
--include-tests Include test files in trace results
|
|
185
|
+
--json Output full JSON instead of compact tree`,
|
|
186
|
+
impact: `codesift impact <repo> --since <ref> [options]
|
|
187
|
+
|
|
188
|
+
Analyze the blast radius of recent git changes.
|
|
189
|
+
|
|
190
|
+
Arguments:
|
|
191
|
+
<repo> Repository identifier
|
|
192
|
+
|
|
193
|
+
Options:
|
|
194
|
+
--since Git ref to compare from (required, e.g. HEAD~3, commit SHA)
|
|
195
|
+
--depth Depth of dependency traversal
|
|
196
|
+
--until Git ref to compare to (default: HEAD)`,
|
|
197
|
+
context: `codesift context <repo> <query> [options]
|
|
198
|
+
|
|
199
|
+
Assemble a focused code context for a query within a token budget.
|
|
200
|
+
|
|
201
|
+
Arguments:
|
|
202
|
+
<repo> Repository identifier
|
|
203
|
+
<query> Natural language query describing what context is needed
|
|
204
|
+
|
|
205
|
+
Options:
|
|
206
|
+
--token-budget Maximum tokens for the assembled context`,
|
|
207
|
+
"knowledge-map": `codesift knowledge-map <repo> [options]
|
|
208
|
+
|
|
209
|
+
Get the module dependency map showing how files relate.
|
|
210
|
+
|
|
211
|
+
Arguments:
|
|
212
|
+
<repo> Repository identifier
|
|
213
|
+
|
|
214
|
+
Options:
|
|
215
|
+
--focus Focus on a specific module or directory
|
|
216
|
+
--depth Maximum depth of the dependency graph`,
|
|
217
|
+
diff: `codesift diff <repo> --since <ref> [options]
|
|
218
|
+
|
|
219
|
+
Get a structural outline of what changed between two git refs.
|
|
220
|
+
|
|
221
|
+
Arguments:
|
|
222
|
+
<repo> Repository identifier
|
|
223
|
+
|
|
224
|
+
Options:
|
|
225
|
+
--since Git ref to compare from (required)
|
|
226
|
+
--until Git ref to compare to (default: HEAD)`,
|
|
227
|
+
changed: `codesift changed <repo> --since <ref> [options]
|
|
228
|
+
|
|
229
|
+
List symbols in each changed file between two git refs.
|
|
230
|
+
|
|
231
|
+
Arguments:
|
|
232
|
+
<repo> Repository identifier
|
|
233
|
+
|
|
234
|
+
Options:
|
|
235
|
+
--since Git ref to compare from (required)
|
|
236
|
+
--until Git ref to compare to (default: HEAD)`,
|
|
237
|
+
retrieve: `codesift retrieve <repo> --queries <json> [options]
|
|
238
|
+
|
|
239
|
+
Execute multiple search/retrieval queries in a single batched call.
|
|
240
|
+
|
|
241
|
+
Arguments:
|
|
242
|
+
<repo> Repository identifier
|
|
243
|
+
|
|
244
|
+
Options:
|
|
245
|
+
--queries JSON array of sub-queries (required)
|
|
246
|
+
--token-budget Maximum total tokens across all results
|
|
247
|
+
--exclude-tests Exclude test files from semantic/hybrid results (default: true)
|
|
248
|
+
--exclude-tests=false Include test files in semantic/hybrid results
|
|
249
|
+
|
|
250
|
+
Sub-query types: symbols, text, file_tree, outline, references,
|
|
251
|
+
call_chain, impact, context, knowledge_map, semantic, hybrid
|
|
252
|
+
|
|
253
|
+
Semantic/hybrid sub-queries support an "exclude_tests" field (default: true).
|
|
254
|
+
|
|
255
|
+
Example:
|
|
256
|
+
codesift retrieve local/my-project --queries '[{"type":"symbols","query":"createUser"},{"type":"text","query":"TODO"}]'
|
|
257
|
+
codesift retrieve local/my-project --queries '[{"type":"semantic","query":"caching"}]' --exclude-tests=false`,
|
|
258
|
+
stats: `codesift stats
|
|
259
|
+
|
|
260
|
+
Show usage statistics for all CodeSift tool calls.`,
|
|
261
|
+
"generate-claude-md": `codesift generate-claude-md <repo> [options]
|
|
262
|
+
|
|
263
|
+
Generate a CLAUDE.md project summary from the repository index.
|
|
264
|
+
|
|
265
|
+
Arguments:
|
|
266
|
+
<repo> Repository identifier
|
|
267
|
+
|
|
268
|
+
Options:
|
|
269
|
+
--output Custom output file path`,
|
|
270
|
+
};
|
|
271
|
+
//# sourceMappingURL=help.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,gBAAgB;AAChB,8EAA8E;AAE9E,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDxB,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAA2B;IAClD,KAAK,EAAE;;;;;;;;;;iEAUwD;IAE/D,YAAY,EAAE;;;;;;;;;6DAS6C;IAE3D,KAAK,EAAE;;6CAEoC;IAE3C,UAAU,EAAE;;;;;0DAK4C;IAExD,MAAM,EAAE;;;;;;;;;;;;qEAY2D;IAEnE,OAAO,EAAE;;;;;;;;;;;;;mEAawD;IAEjE,IAAI,EAAE;;;;;;;;;;;;+DAYuD;IAE7D,OAAO,EAAE;;;;;;qDAM0C;IAEnD,cAAc,EAAE;;;;;kCAKgB;IAEhC,MAAM,EAAE;;;;;;qCAM2B;IAEnC,eAAe,EAAE;;;;;;iDAM8B;IAE/C,IAAI,EAAE;;;;;;;;;iEASyD;IAE/D,IAAI,EAAE;;;;;;;;;;8DAUsD;IAE5D,KAAK,EAAE;;;;;;;;;;;;;6DAaoD;IAE3D,MAAM,EAAE;;;;;;;;;;mDAUyC;IAEjD,OAAO,EAAE;;;;;;;;;6DASkD;IAE3D,eAAe,EAAE;;;;;;;;;mDASgC;IAEjD,IAAI,EAAE;;;;;;;;;mDAS2C;IAEjD,OAAO,EAAE;;;;;;;;;mDASwC;IAEjD,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;+GAoBmG;IAE7G,KAAK,EAAE;;mDAE0C;IAEjD,oBAAoB,EAAE;;;;;;;;sCAQc;CACrC,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|