@grepr/cli 1.1.4 → 1.3.0-4e666db
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/build/dist/commands/base-command.d.ts +3 -3
- package/build/dist/commands/base-command.d.ts.map +1 -1
- package/build/dist/commands/base-command.js +1 -7
- package/build/dist/commands/base-command.js.map +1 -1
- package/build/dist/commands/config-command.d.ts +5 -9
- package/build/dist/commands/config-command.d.ts.map +1 -1
- package/build/dist/commands/config-command.js +32 -4
- package/build/dist/commands/config-command.js.map +1 -1
- package/build/dist/commands/crud-command.d.ts +11 -18
- package/build/dist/commands/crud-command.d.ts.map +1 -1
- package/build/dist/commands/crud-command.js +27 -11
- package/build/dist/commands/crud-command.js.map +1 -1
- package/build/dist/commands/dataset-command.d.ts +8 -13
- package/build/dist/commands/dataset-command.d.ts.map +1 -1
- package/build/dist/commands/dataset-command.js.map +1 -1
- package/build/dist/commands/docs-command.d.ts +87 -0
- package/build/dist/commands/docs-command.d.ts.map +1 -0
- package/build/dist/commands/docs-command.js +164 -0
- package/build/dist/commands/docs-command.js.map +1 -0
- package/build/dist/commands/docs-get-command.d.ts +53 -0
- package/build/dist/commands/docs-get-command.d.ts.map +1 -0
- package/build/dist/commands/docs-get-command.js +75 -0
- package/build/dist/commands/docs-get-command.js.map +1 -0
- package/build/dist/commands/grok-command.d.ts +71 -0
- package/build/dist/commands/grok-command.d.ts.map +1 -0
- package/build/dist/commands/grok-command.js +258 -0
- package/build/dist/commands/grok-command.js.map +1 -0
- package/build/dist/commands/integration-command.d.ts +5 -7
- package/build/dist/commands/integration-command.d.ts.map +1 -1
- package/build/dist/commands/integration-command.js +4 -4
- package/build/dist/commands/integration-command.js.map +1 -1
- package/build/dist/commands/job-command.d.ts +7 -43
- package/build/dist/commands/job-command.d.ts.map +1 -1
- package/build/dist/commands/job-command.js +5 -3
- package/build/dist/commands/job-command.js.map +1 -1
- package/build/dist/commands/job-to-test-command.d.ts +74 -0
- package/build/dist/commands/job-to-test-command.d.ts.map +1 -0
- package/build/dist/commands/job-to-test-command.js +159 -0
- package/build/dist/commands/job-to-test-command.js.map +1 -0
- package/build/dist/commands/list-command.d.ts +5 -7
- package/build/dist/commands/list-command.d.ts.map +1 -1
- package/build/dist/commands/list-command.js +20 -4
- package/build/dist/commands/list-command.js.map +1 -1
- package/build/dist/commands/query-command.d.ts +3 -8
- package/build/dist/commands/query-command.d.ts.map +1 -1
- package/build/dist/commands/query-command.js +34 -14
- package/build/dist/commands/query-command.js.map +1 -1
- package/build/dist/docs-index/catalog.json +1 -0
- package/build/dist/docs-index/index.json +1 -0
- package/build/dist/grepr.js +43 -7
- package/build/dist/grepr.js.map +1 -1
- package/build/dist/lib/api-client-factory.d.ts +2 -2
- package/build/dist/lib/api-client-factory.d.ts.map +1 -1
- package/build/dist/lib/api-client-factory.js +1 -1
- package/build/dist/lib/api-client-factory.js.map +1 -1
- package/build/dist/lib/auth.d.ts +17 -9
- package/build/dist/lib/auth.d.ts.map +1 -1
- package/build/dist/lib/auth.js +53 -14
- package/build/dist/lib/auth.js.map +1 -1
- package/build/dist/lib/command-registry.d.ts +3 -2
- package/build/dist/lib/command-registry.d.ts.map +1 -1
- package/build/dist/lib/command-registry.js.map +1 -1
- package/build/dist/lib/config.d.ts +15 -0
- package/build/dist/lib/config.d.ts.map +1 -1
- package/build/dist/lib/config.js +45 -11
- package/build/dist/lib/config.js.map +1 -1
- package/build/dist/lib/docs-search.d.ts +154 -0
- package/build/dist/lib/docs-search.d.ts.map +1 -0
- package/build/dist/lib/docs-search.js +208 -0
- package/build/dist/lib/docs-search.js.map +1 -0
- package/build/dist/lib/grepr-api-client.d.ts +33 -193
- package/build/dist/lib/grepr-api-client.d.ts.map +1 -1
- package/build/dist/lib/grepr-api-client.js +58 -38
- package/build/dist/lib/grepr-api-client.js.map +1 -1
- package/build/dist/lib/job-graph-transformer.d.ts +89 -0
- package/build/dist/lib/job-graph-transformer.d.ts.map +1 -0
- package/build/dist/lib/job-graph-transformer.js +497 -0
- package/build/dist/lib/job-graph-transformer.js.map +1 -0
- package/build/dist/lib/job-graph-utils.d.ts +50 -0
- package/build/dist/lib/job-graph-utils.d.ts.map +1 -0
- package/build/dist/lib/job-graph-utils.js +84 -0
- package/build/dist/lib/job-graph-utils.js.map +1 -0
- package/build/dist/lib/json-formatter.d.ts +1 -0
- package/build/dist/lib/json-formatter.d.ts.map +1 -1
- package/build/dist/lib/json-formatter.js +28 -16
- package/build/dist/lib/json-formatter.js.map +1 -1
- package/build/dist/lib/parser.d.ts.map +1 -1
- package/build/dist/lib/parser.js +3 -6
- package/build/dist/lib/parser.js.map +1 -1
- package/build/dist/lib/streaming-job-executor.d.ts +3 -3
- package/build/dist/lib/streaming-job-executor.d.ts.map +1 -1
- package/build/dist/lib/streaming-job-executor.js +54 -21
- package/build/dist/lib/streaming-job-executor.js.map +1 -1
- package/build/dist/lib/time-utils.js +1 -1
- package/build/dist/lib/time-utils.js.map +1 -1
- package/build/dist/lib/transformers-embeddings.d.ts +76 -0
- package/build/dist/lib/transformers-embeddings.d.ts.map +1 -0
- package/build/dist/lib/transformers-embeddings.js +109 -0
- package/build/dist/lib/transformers-embeddings.js.map +1 -0
- package/build/dist/openapi/openApiTypes.d.ts +6926 -3458
- package/build/dist/openapi/openApiTypes.d.ts.map +1 -1
- package/build/dist/openapi/openApiTypes.js +372 -85
- package/build/dist/openapi/openApiTypes.js.map +1 -1
- package/build/dist/types.d.ts +48 -78
- package/build/dist/types.d.ts.map +1 -1
- package/build/dist/types.js +73 -0
- package/build/dist/types.js.map +1 -1
- package/package.json +41 -11
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { DocsSearch } from '../lib/docs-search.js';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
/**
|
|
4
|
+
* CLI command for searching Grepr documentation using semantic search.
|
|
5
|
+
*
|
|
6
|
+
* This command provides natural language search over the bundled documentation
|
|
7
|
+
* index. Users can search with queries like "how to create a pipeline" or
|
|
8
|
+
* "datadog integration" and get relevant documentation sections.
|
|
9
|
+
*
|
|
10
|
+
* Output formats:
|
|
11
|
+
* - pretty: Human-readable with colors, headings, and previews (default)
|
|
12
|
+
* - compact: Brief one-line summaries with scores
|
|
13
|
+
* - json: Machine-readable JSON for scripting
|
|
14
|
+
*
|
|
15
|
+
* Example usage:
|
|
16
|
+
* grepr docs:search "how to create a pipeline"
|
|
17
|
+
* grepr docs:search "datadog" -l 10 --threshold 0.5
|
|
18
|
+
* grepr docs:search "integrations" -f json
|
|
19
|
+
*/
|
|
20
|
+
export class DocsSearchCommand {
|
|
21
|
+
getCommandName() {
|
|
22
|
+
return 'docs:search';
|
|
23
|
+
}
|
|
24
|
+
getCommandDescription() {
|
|
25
|
+
return 'Search Grepr documentation using semantic search';
|
|
26
|
+
}
|
|
27
|
+
addToProgram(program, _mergeConfiguration) {
|
|
28
|
+
program
|
|
29
|
+
.command(this.getCommandName())
|
|
30
|
+
.description(this.getCommandDescription())
|
|
31
|
+
.argument('<query>', 'Search query')
|
|
32
|
+
.option('-l, --limit <n>', 'Number of results to return', '5')
|
|
33
|
+
.option('--threshold <score>', 'Minimum relevance score (0.0-1.0)', '0.0')
|
|
34
|
+
.option('-f, --format <type>', 'Output format (pretty, json, compact)', 'pretty')
|
|
35
|
+
.option('-c, --context <tokens>', 'Tokens of context per section (default: 300)', '300')
|
|
36
|
+
.option('-t, --type <filter>', 'Filter by type: doc (default), all, api, schema', 'doc')
|
|
37
|
+
.option('--no-color', 'Disable colored output')
|
|
38
|
+
.action(async (query, options) => {
|
|
39
|
+
try {
|
|
40
|
+
await this.execute(query, options);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
44
|
+
console.error(`Error executing ${this.getCommandName()}:`, errorMessage);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Executes the search command.
|
|
51
|
+
*
|
|
52
|
+
* @param query - Natural language search query
|
|
53
|
+
* @param options - Command options from CLI parsing
|
|
54
|
+
*/
|
|
55
|
+
async execute(query, options) {
|
|
56
|
+
const limit = parseInt(options.limit || '5');
|
|
57
|
+
const threshold = parseFloat(options.threshold || '0.0');
|
|
58
|
+
const format = options.format || 'pretty';
|
|
59
|
+
const contextTokens = parseInt(options.context || '300');
|
|
60
|
+
const search = new DocsSearch();
|
|
61
|
+
await search.initialize();
|
|
62
|
+
if (!options.quiet) {
|
|
63
|
+
console.error(chalk.dim(`Searching documentation for: "${query}"\n`));
|
|
64
|
+
}
|
|
65
|
+
const results = await search.search(query, {
|
|
66
|
+
limit,
|
|
67
|
+
threshold,
|
|
68
|
+
type: options.type,
|
|
69
|
+
contextTokens
|
|
70
|
+
});
|
|
71
|
+
if (results.length === 0) {
|
|
72
|
+
console.log(chalk.yellow('No results found.'));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (format === 'json') {
|
|
76
|
+
this.outputJson(results);
|
|
77
|
+
}
|
|
78
|
+
else if (format === 'compact') {
|
|
79
|
+
this.outputCompact(results, options.color !== false);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
this.outputPretty(results, options.color !== false);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Outputs search results in JSON format.
|
|
87
|
+
*
|
|
88
|
+
* Useful for scripting and programmatic processing of search results.
|
|
89
|
+
*
|
|
90
|
+
* @param results - Search results to format
|
|
91
|
+
*/
|
|
92
|
+
outputJson(results) {
|
|
93
|
+
const output = results.map(r => ({
|
|
94
|
+
score: r.score,
|
|
95
|
+
uri: r.uri,
|
|
96
|
+
sections: r.sections
|
|
97
|
+
}));
|
|
98
|
+
console.log(JSON.stringify(output, null, 2));
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Outputs search results in compact format.
|
|
102
|
+
*
|
|
103
|
+
* Shows one result per two lines: URI with score, then brief preview.
|
|
104
|
+
* The preview shows the most relevant section text (not necessarily from the start).
|
|
105
|
+
* Multiple sections are separated by ' [...] ' to indicate non-contiguous excerpts.
|
|
106
|
+
* Useful for quick scanning of many results.
|
|
107
|
+
*
|
|
108
|
+
* @param results - Search results to format
|
|
109
|
+
* @param useColor - Whether to use colored output (default: true)
|
|
110
|
+
*/
|
|
111
|
+
outputCompact(results, useColor = true) {
|
|
112
|
+
results.forEach((result, i) => {
|
|
113
|
+
const preview = result.sections
|
|
114
|
+
.map(s => s.text)
|
|
115
|
+
.join(' [...] ')
|
|
116
|
+
.replace(/\n/g, ' ');
|
|
117
|
+
const scoreLine = `${i + 1}. [${result.score.toFixed(3)}] ${result.uri}`;
|
|
118
|
+
console.log(useColor ? chalk.cyan(scoreLine) : scoreLine);
|
|
119
|
+
console.log(` ${preview}`);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Outputs search results in pretty format with colors and formatting.
|
|
124
|
+
*
|
|
125
|
+
* This is the default format optimized for human readability:
|
|
126
|
+
* - Colored headings and metadata (if color enabled)
|
|
127
|
+
* - Displays relevant sections from the document (not necessarily from the start)
|
|
128
|
+
* - Sections are ordered by relevance to the search query
|
|
129
|
+
* - Multiple sections are separated by '--- [Section N] ---' to indicate non-contiguous excerpts
|
|
130
|
+
* - Markdown headings (lines starting with #) are bolded (if color enabled)
|
|
131
|
+
* - Results are well-spaced for easy reading
|
|
132
|
+
*
|
|
133
|
+
* @param results - Search results to format
|
|
134
|
+
* @param useColor - Whether to use colored output (default: true)
|
|
135
|
+
*/
|
|
136
|
+
outputPretty(results, useColor = true) {
|
|
137
|
+
results.forEach((result, i) => {
|
|
138
|
+
const title = `\n${i + 1}. ${result.uri}`;
|
|
139
|
+
console.log(useColor ? chalk.bold.cyan(title) : title);
|
|
140
|
+
const relevance = ` Relevance: ${result.score.toFixed(3)}`;
|
|
141
|
+
console.log(useColor ? chalk.dim(relevance) : relevance);
|
|
142
|
+
console.log();
|
|
143
|
+
result.sections.forEach((section, sectionIdx) => {
|
|
144
|
+
if (sectionIdx > 0) {
|
|
145
|
+
const separator = ` --- [Section ${sectionIdx + 1}] ---`;
|
|
146
|
+
console.log(useColor ? chalk.dim(separator) : separator);
|
|
147
|
+
console.log();
|
|
148
|
+
}
|
|
149
|
+
const lines = section.text.split('\n');
|
|
150
|
+
lines.forEach(line => {
|
|
151
|
+
if (line.trim().startsWith('#')) {
|
|
152
|
+
console.log(useColor ? chalk.bold(` ${line}`) : ` ${line}`);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
console.log(` ${line}`);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
const summary = `\nShowing ${results.length} result${results.length !== 1 ? 's' : ''}`;
|
|
161
|
+
console.log(useColor ? chalk.dim(summary) : summary);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=docs-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-command.js","sourceRoot":"","sources":["../../../src/main/typescript/commands/docs-command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAgB,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAuB1B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,iBAAiB;IAC5B,cAAc;QACZ,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,qBAAqB;QACnB,OAAO,kDAAkD,CAAC;IAC5D,CAAC;IAED,YAAY,CAAC,OAAgB,EAAE,mBAAuC;QACpE,OAAO;aACJ,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;aAC9B,WAAW,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;aACzC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;aACnC,MAAM,CAAC,iBAAiB,EAAE,6BAA6B,EAAE,GAAG,CAAC;aAC7D,MAAM,C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@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { ICommand } from '../lib/command-registry.js';
|
|
3
|
+
import { MergeConfiguration } from '../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* CLI command for retrieving complete documentation content by URI.
|
|
6
|
+
*
|
|
7
|
+
* This command complements `docs:search` by providing a way to fetch the full
|
|
8
|
+
* content of a document after identifying it through search. The typical workflow:
|
|
9
|
+
*
|
|
10
|
+
* 1. User searches: `grepr docs:search "datadog" -f compact`
|
|
11
|
+
* → Gets preview with URI: doc://integrations/datadog/page.mdx
|
|
12
|
+
*
|
|
13
|
+
* 2. User retrieves: `grepr docs:get "doc://integrations/datadog/page.mdx"`
|
|
14
|
+
* → Gets complete markdown content
|
|
15
|
+
*
|
|
16
|
+
* Design decisions:
|
|
17
|
+
*
|
|
18
|
+
* - **No format options**: Documents are already in markdown format, so we output
|
|
19
|
+
* them as-is. This makes the command simple and perfect for piping to other tools
|
|
20
|
+
* (e.g., AI assistants, markdown processors).
|
|
21
|
+
*
|
|
22
|
+
* - **Option A retrieval**: Uses direct document lookup via `DocsSearch.getDocument()`
|
|
23
|
+
* which internally calls `listDocuments()` and `renderAllSections()`. This is more
|
|
24
|
+
* efficient than query-based retrieval and returns sections in document order
|
|
25
|
+
* rather than relevance order.
|
|
26
|
+
*
|
|
27
|
+
* - **Clean output**: No headers, colors, or formatting. Just the raw markdown
|
|
28
|
+
* content. This is intentional for scriptability and AI integration.
|
|
29
|
+
*
|
|
30
|
+
* Example usage:
|
|
31
|
+
* grepr docs:get "doc://tutorials/first-pipeline/page.mdx"
|
|
32
|
+
* grepr docs:get "doc://integrations/datadog/page.mdx" | some-ai-tool
|
|
33
|
+
*/
|
|
34
|
+
export declare class DocsGetCommand implements ICommand {
|
|
35
|
+
getCommandName(): string;
|
|
36
|
+
getCommandDescription(): string;
|
|
37
|
+
addToProgram(program: Command, _mergeConfiguration: MergeConfiguration): void;
|
|
38
|
+
/**
|
|
39
|
+
* Executes the document retrieval command.
|
|
40
|
+
*
|
|
41
|
+
* This method:
|
|
42
|
+
* 1. Initializes the DocsSearch engine (loads embedding model and opens index)
|
|
43
|
+
* 2. Retrieves the full document content by URI
|
|
44
|
+
* 3. Outputs raw markdown to stdout (no formatting, perfect for piping)
|
|
45
|
+
*
|
|
46
|
+
* Error handling: If the document is not found, DocsSearch.getDocument() throws
|
|
47
|
+
* an error which is caught by the action handler and displayed to the user.
|
|
48
|
+
*
|
|
49
|
+
* @param uri - Document URI in format 'doc://path/to/file.mdx'
|
|
50
|
+
*/
|
|
51
|
+
private execute;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=docs-get-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-get-command.d.ts","sourceRoot":"","sources":["../../../src/main/typescript/commands/docs-get-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAwB,MAAM,aAAa,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,cAAe,YAAW,QAAQ;IAC7C,cAAc,IAAI,MAAM;IAIxB,qBAAqB,IAAI,MAAM;IAI/B,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,GAAG,IAAI;IAgB7E;;;;;;;;;;;;OAYG;YACW,OAAO;CAOtB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { DocsSearch } from '../lib/docs-search.js';
|
|
2
|
+
/**
|
|
3
|
+
* CLI command for retrieving complete documentation content by URI.
|
|
4
|
+
*
|
|
5
|
+
* This command complements `docs:search` by providing a way to fetch the full
|
|
6
|
+
* content of a document after identifying it through search. The typical workflow:
|
|
7
|
+
*
|
|
8
|
+
* 1. User searches: `grepr docs:search "datadog" -f compact`
|
|
9
|
+
* → Gets preview with URI: doc://integrations/datadog/page.mdx
|
|
10
|
+
*
|
|
11
|
+
* 2. User retrieves: `grepr docs:get "doc://integrations/datadog/page.mdx"`
|
|
12
|
+
* → Gets complete markdown content
|
|
13
|
+
*
|
|
14
|
+
* Design decisions:
|
|
15
|
+
*
|
|
16
|
+
* - **No format options**: Documents are already in markdown format, so we output
|
|
17
|
+
* them as-is. This makes the command simple and perfect for piping to other tools
|
|
18
|
+
* (e.g., AI assistants, markdown processors).
|
|
19
|
+
*
|
|
20
|
+
* - **Option A retrieval**: Uses direct document lookup via `DocsSearch.getDocument()`
|
|
21
|
+
* which internally calls `listDocuments()` and `renderAllSections()`. This is more
|
|
22
|
+
* efficient than query-based retrieval and returns sections in document order
|
|
23
|
+
* rather than relevance order.
|
|
24
|
+
*
|
|
25
|
+
* - **Clean output**: No headers, colors, or formatting. Just the raw markdown
|
|
26
|
+
* content. This is intentional for scriptability and AI integration.
|
|
27
|
+
*
|
|
28
|
+
* Example usage:
|
|
29
|
+
* grepr docs:get "doc://tutorials/first-pipeline/page.mdx"
|
|
30
|
+
* grepr docs:get "doc://integrations/datadog/page.mdx" | some-ai-tool
|
|
31
|
+
*/
|
|
32
|
+
export class DocsGetCommand {
|
|
33
|
+
getCommandName() {
|
|
34
|
+
return 'docs:get';
|
|
35
|
+
}
|
|
36
|
+
getCommandDescription() {
|
|
37
|
+
return 'Retrieve full documentation content by URI (doc://...)';
|
|
38
|
+
}
|
|
39
|
+
addToProgram(program, _mergeConfiguration) {
|
|
40
|
+
program
|
|
41
|
+
.command(this.getCommandName())
|
|
42
|
+
.description(this.getCommandDescription())
|
|
43
|
+
.argument('<uri>', 'Document URI (e.g., doc://tutorials/first-pipeline/page.mdx)')
|
|
44
|
+
.action(async (uri, _options) => {
|
|
45
|
+
try {
|
|
46
|
+
await this.execute(uri);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
50
|
+
console.error(`Error executing ${this.getCommandName()}:`, errorMessage);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Executes the document retrieval command.
|
|
57
|
+
*
|
|
58
|
+
* This method:
|
|
59
|
+
* 1. Initializes the DocsSearch engine (loads embedding model and opens index)
|
|
60
|
+
* 2. Retrieves the full document content by URI
|
|
61
|
+
* 3. Outputs raw markdown to stdout (no formatting, perfect for piping)
|
|
62
|
+
*
|
|
63
|
+
* Error handling: If the document is not found, DocsSearch.getDocument() throws
|
|
64
|
+
* an error which is caught by the action handler and displayed to the user.
|
|
65
|
+
*
|
|
66
|
+
* @param uri - Document URI in format 'doc://path/to/file.mdx'
|
|
67
|
+
*/
|
|
68
|
+
async execute(uri) {
|
|
69
|
+
const search = new DocsSearch();
|
|
70
|
+
await search.initialize();
|
|
71
|
+
const content = await search.getDocument(uri);
|
|
72
|
+
console.log(content);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=docs-get-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-get-command.js","sourceRoot":"","sources":["../../../src/main/typescript/commands/docs-get-command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,OAAO,cAAc;IACzB,cAAc;QACZ,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,qBAAqB;QACnB,OAAO,wDAAwD,CAAC;IAClE,CAAC;IAED,YAAY,CAAC,OAAgB,EAAE,mBAAuC;QACpE,OAAO;aACJ,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;aAC9B,WAAW,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;aACzC,QAAQ,CAAC,OAAO,EAAE,8DAA8D,CAAC;aACjF,MAAM,CAAC,KAAK,EAAE,GAAW,EAAE,QAA8B,EAAE,EAAE;YAC5D,IAAI,CAAC;gBACH,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC1B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;gBAC9E,OAAO,CAAC,KAAK,CAAC,mBAAmB,IAAI,CAAC,cAAc,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC;gBACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;QACH,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;;;;;;OAYG;IACK,KAAK,CAAC,OAAO,CAAC,GAAW;QAC/B,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAChC,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;QAE1B,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAC9C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { ICommand } from '../lib/command-registry.js';
|
|
3
|
+
import { ApiClientFactoryOptions } from '../lib/api-client-factory.js';
|
|
4
|
+
import { MergeConfiguration } from '../types.js';
|
|
5
|
+
export interface GrokParseCommandOptions extends ApiClientFactoryOptions {
|
|
6
|
+
quiet?: boolean;
|
|
7
|
+
timezone?: string;
|
|
8
|
+
output?: string;
|
|
9
|
+
format?: 'table' | 'csv' | 'pretty' | 'raw' | 'compact';
|
|
10
|
+
color?: boolean;
|
|
11
|
+
timestamps?: boolean;
|
|
12
|
+
pattern?: string;
|
|
13
|
+
sample?: string;
|
|
14
|
+
samplesFile?: string;
|
|
15
|
+
extractAttribute?: string;
|
|
16
|
+
helperRules?: string[];
|
|
17
|
+
maxDepth?: number;
|
|
18
|
+
maxLines?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Grok parse command implementation for testing Grok patterns against log samples
|
|
22
|
+
*/
|
|
23
|
+
export declare class GrokParseCommand implements ICommand {
|
|
24
|
+
private formatter;
|
|
25
|
+
private apiClient;
|
|
26
|
+
/**
|
|
27
|
+
* Get the command name
|
|
28
|
+
*/
|
|
29
|
+
getCommandName(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Get the command description
|
|
32
|
+
*/
|
|
33
|
+
getCommandDescription(): string;
|
|
34
|
+
/**
|
|
35
|
+
* Add this command to the program
|
|
36
|
+
*/
|
|
37
|
+
addToProgram(program: Command, mergeConfiguration: MergeConfiguration): void;
|
|
38
|
+
/**
|
|
39
|
+
* Execute the grok parse operation
|
|
40
|
+
*/
|
|
41
|
+
execute(options: GrokParseCommandOptions): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Build the grok parse batch request from options
|
|
44
|
+
*/
|
|
45
|
+
private buildGrokParseBatchRequest;
|
|
46
|
+
/**
|
|
47
|
+
* Create API client using shared factory
|
|
48
|
+
*/
|
|
49
|
+
private createApiClient;
|
|
50
|
+
/**
|
|
51
|
+
* Setup formatter for output
|
|
52
|
+
*/
|
|
53
|
+
private setupFormatter;
|
|
54
|
+
/**
|
|
55
|
+
* Format and output data
|
|
56
|
+
*/
|
|
57
|
+
private formatAndOutput;
|
|
58
|
+
/**
|
|
59
|
+
* Convert grok API response to display format
|
|
60
|
+
*/
|
|
61
|
+
private formatGrokResults;
|
|
62
|
+
/**
|
|
63
|
+
* Show parsing summary
|
|
64
|
+
*/
|
|
65
|
+
private showParsingSummary;
|
|
66
|
+
/**
|
|
67
|
+
* Show batch parsing summary
|
|
68
|
+
*/
|
|
69
|
+
private showBatchSummary;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=grok-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1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C;IAoD9D;;OAEG;YACW,0BAA0B;IA6CxC;;OAEG;IACH,OAAO,CAAC,eAAe;IAIvB;;OAEG;IACH,OAAO,CAAC,cAAc;IAkBtB;;OAEG;YACW,eAAe;IA0C7B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAUzB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAazB"}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { createApiClient } from '../lib/api-client-factory.js';
|
|
2
|
+
import { JsonFormatter } from '../lib/json-formatter.js';
|
|
3
|
+
import { GrokParserType } from '../openapi/openApiTypes.js';
|
|
4
|
+
import fs from 'fs-extra';
|
|
5
|
+
/**
|
|
6
|
+
* Grok parse command implementation for testing Grok patterns against log samples
|
|
7
|
+
*/
|
|
8
|
+
export class GrokParseCommand {
|
|
9
|
+
formatter = null;
|
|
10
|
+
apiClient = null;
|
|
11
|
+
/**
|
|
12
|
+
* Get the command name
|
|
13
|
+
*/
|
|
14
|
+
getCommandName() {
|
|
15
|
+
return 'grok:parse';
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get the command description
|
|
19
|
+
*/
|
|
20
|
+
getCommandDescription() {
|
|
21
|
+
return 'Test Grok patterns against log samples';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Add this command to the program
|
|
25
|
+
*/
|
|
26
|
+
addToProgram(program, mergeConfiguration) {
|
|
27
|
+
program
|
|
28
|
+
.command(this.getCommandName())
|
|
29
|
+
.description(this.getCommandDescription())
|
|
30
|
+
.option('-p, --pattern <pattern>', 'Grok parsing rule to test')
|
|
31
|
+
.option('-s, --sample <sample>', 'Log sample to parse')
|
|
32
|
+
.option('--samples-file <file>', 'File containing log samples (one per line)')
|
|
33
|
+
.option('--extract-attribute <attribute>', 'Optional attribute to extract')
|
|
34
|
+
.option('--helper-rules <rules...>', 'Additional grok helper rules')
|
|
35
|
+
.option('-f, --format <format>', 'Output format (table, csv, pretty, raw, compact)', 'raw')
|
|
36
|
+
.option('--no-color', 'Disable colored output')
|
|
37
|
+
.option('--no-timestamps', 'Hide timestamps')
|
|
38
|
+
.option('--max-depth <number>', 'Maximum object nesting depth for table columns', parseInt, 1)
|
|
39
|
+
.option('--max-lines <number>', 'Maximum lines per table cell', parseInt, 4)
|
|
40
|
+
.action(async (options, command) => {
|
|
41
|
+
try {
|
|
42
|
+
const globalOptions = command.parent?.opts() || {};
|
|
43
|
+
const mergedGlobalOptions = await mergeConfiguration(globalOptions);
|
|
44
|
+
const mergedOptions = {
|
|
45
|
+
...mergedGlobalOptions,
|
|
46
|
+
...options
|
|
47
|
+
};
|
|
48
|
+
await this.execute(mergedOptions);
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
52
|
+
console.error(`Error executing ${this.getCommandName()}:`, errorMessage);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Execute the grok parse operation
|
|
59
|
+
*/
|
|
60
|
+
async execute(options) {
|
|
61
|
+
try {
|
|
62
|
+
this.apiClient = this.createApiClient(options);
|
|
63
|
+
// Prepare the request payload
|
|
64
|
+
const request = await this.buildGrokParseBatchRequest(options);
|
|
65
|
+
// Call the batch API
|
|
66
|
+
const result = await this.apiClient.getClient().POST('/v1/grok/parse/batch', {
|
|
67
|
+
body: request
|
|
68
|
+
});
|
|
69
|
+
if (result.error) {
|
|
70
|
+
throw new Error(`Grok parse failed: ${JSON.stringify(result.error)}`);
|
|
71
|
+
}
|
|
72
|
+
// Format and output the results
|
|
73
|
+
if (result.data && result.data.results && result.data.results.length > 0) {
|
|
74
|
+
if (options.format === 'raw' && options.quiet) {
|
|
75
|
+
console.log(JSON.stringify(result.data, null, 2));
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
for (let i = 0; i < result.data.results.length; i++) {
|
|
79
|
+
const singleResult = result.data.results[i];
|
|
80
|
+
if (singleResult) {
|
|
81
|
+
if (result.data.results.length > 1 && !options.quiet) {
|
|
82
|
+
console.log(`\n=== Sample ${i + 1} ===`);
|
|
83
|
+
}
|
|
84
|
+
await this.formatAndOutput(singleResult, options);
|
|
85
|
+
if (!options.quiet) {
|
|
86
|
+
this.showParsingSummary(singleResult, options);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (result.data.results.length > 1 && !options.quiet) {
|
|
91
|
+
this.showBatchSummary(result.data.results, options);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
if (!options.quiet) {
|
|
97
|
+
console.log('No data returned from grok parsing API.');
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
console.error('Error parsing with Grok:', error.message);
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Build the grok parse batch request from options
|
|
108
|
+
*/
|
|
109
|
+
async buildGrokParseBatchRequest(options) {
|
|
110
|
+
// Get the log samples
|
|
111
|
+
let logSamples;
|
|
112
|
+
if (options.sample) {
|
|
113
|
+
logSamples = [options.sample];
|
|
114
|
+
}
|
|
115
|
+
else if (options.samplesFile) {
|
|
116
|
+
if (!await fs.pathExists(options.samplesFile)) {
|
|
117
|
+
throw new Error(`Samples file not found: ${options.samplesFile}`);
|
|
118
|
+
}
|
|
119
|
+
const samplesContent = await fs.readFile(options.samplesFile, 'utf-8');
|
|
120
|
+
const samples = samplesContent.trim().split('\n').filter(line => line.trim());
|
|
121
|
+
if (samples.length === 0) {
|
|
122
|
+
throw new Error('Samples file is empty or contains no valid samples');
|
|
123
|
+
}
|
|
124
|
+
logSamples = samples;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
throw new Error('Either --sample or --samples-file must be specified');
|
|
128
|
+
}
|
|
129
|
+
if (!options.pattern) {
|
|
130
|
+
throw new Error('--pattern is required');
|
|
131
|
+
}
|
|
132
|
+
// Build the grok parser configuration
|
|
133
|
+
const grokParser = {
|
|
134
|
+
name: 'cli_test_parser',
|
|
135
|
+
grokParsingRules: [options.pattern],
|
|
136
|
+
type: GrokParserType.grok_parser
|
|
137
|
+
};
|
|
138
|
+
// Add optional fields if provided
|
|
139
|
+
if (options.extractAttribute) {
|
|
140
|
+
grokParser.extractAttribute = options.extractAttribute;
|
|
141
|
+
}
|
|
142
|
+
if (options.helperRules && options.helperRules.length > 0) {
|
|
143
|
+
grokParser.grokHelperRules = options.helperRules;
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
grokParser,
|
|
147
|
+
logSamples
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Create API client using shared factory
|
|
152
|
+
*/
|
|
153
|
+
createApiClient(options) {
|
|
154
|
+
return createApiClient(options);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Setup formatter for output
|
|
158
|
+
*/
|
|
159
|
+
setupFormatter(options) {
|
|
160
|
+
const formatterOptions = {
|
|
161
|
+
format: options.format || 'raw',
|
|
162
|
+
showTimestamps: options.timestamps !== false,
|
|
163
|
+
colorize: options.color !== false && process.stdout.isTTY && !options.output,
|
|
164
|
+
sortBy: 'rule:asc',
|
|
165
|
+
maxDepth: options.maxDepth ?? 1,
|
|
166
|
+
maxLines: options.maxLines ?? 4
|
|
167
|
+
};
|
|
168
|
+
// Only add timezone if it's defined
|
|
169
|
+
if (options.timezone) {
|
|
170
|
+
formatterOptions.timezone = options.timezone;
|
|
171
|
+
}
|
|
172
|
+
this.formatter = new JsonFormatter(formatterOptions);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Format and output data
|
|
176
|
+
*/
|
|
177
|
+
async formatAndOutput(data, options) {
|
|
178
|
+
if (!data) {
|
|
179
|
+
if (!options.quiet) {
|
|
180
|
+
console.log('No results from grok parsing.');
|
|
181
|
+
}
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
// Setup formatter
|
|
185
|
+
this.setupFormatter(options);
|
|
186
|
+
// Convert API response to displayable format
|
|
187
|
+
const displayData = this.formatGrokResults(data);
|
|
188
|
+
// Handle output
|
|
189
|
+
if (options.output) {
|
|
190
|
+
// Write to file
|
|
191
|
+
if (!this.formatter) {
|
|
192
|
+
throw new Error('Formatter not initialized');
|
|
193
|
+
}
|
|
194
|
+
const formattedData = this.formatter.formatObjects([displayData]);
|
|
195
|
+
await fs.writeFile(options.output, formattedData);
|
|
196
|
+
if (!options.quiet) {
|
|
197
|
+
console.log(`✓ Output written to ${options.output}`);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
// Write to stdout
|
|
202
|
+
if (options.format === 'raw') {
|
|
203
|
+
console.log(JSON.stringify(displayData, null, 2));
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
if (!this.formatter) {
|
|
207
|
+
throw new Error('Formatter not initialized');
|
|
208
|
+
}
|
|
209
|
+
console.log(this.formatter.formatObjects([displayData]));
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Convert grok API response to display format
|
|
215
|
+
*/
|
|
216
|
+
formatGrokResults(apiData) {
|
|
217
|
+
return {
|
|
218
|
+
match: apiData.match || false,
|
|
219
|
+
matchingRuleName: apiData.matchingRuleName || null,
|
|
220
|
+
attributes: apiData.attributes || {},
|
|
221
|
+
tags: apiData.tags || {},
|
|
222
|
+
topLevelFields: apiData.topLevelFields || {}
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Show parsing summary
|
|
227
|
+
*/
|
|
228
|
+
showParsingSummary(data, options) {
|
|
229
|
+
if (!options.quiet) {
|
|
230
|
+
const hasMatch = !!data.match;
|
|
231
|
+
const attributeCount = data.attributes ? Object.keys(data.attributes).length : 0;
|
|
232
|
+
const tagCount = data.tags ? Object.keys(data.tags).length : 0;
|
|
233
|
+
const topLevelFieldCount = data.topLevelFields ? Object.keys(data.topLevelFields).length : 0;
|
|
234
|
+
console.log(`\nGrok Parse Summary:
|
|
235
|
+
- Match successful: ${hasMatch ? 'Yes' : 'No'}
|
|
236
|
+
- Matching rule: ${data.matchingRuleName || 'None'}
|
|
237
|
+
- Attributes extracted: ${attributeCount}
|
|
238
|
+
- Tags extracted: ${tagCount}
|
|
239
|
+
- Top level fields: ${topLevelFieldCount}`);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Show batch parsing summary
|
|
244
|
+
*/
|
|
245
|
+
showBatchSummary(results, options) {
|
|
246
|
+
if (!options.quiet) {
|
|
247
|
+
const totalSamples = results.length;
|
|
248
|
+
const successfulMatches = results.filter(r => r.match).length;
|
|
249
|
+
const failedMatches = totalSamples - successfulMatches;
|
|
250
|
+
console.log(`\n=== Batch Summary ===
|
|
251
|
+
- Total samples processed: ${totalSamples}
|
|
252
|
+
- Successful matches: ${successfulMatches}
|
|
253
|
+
- Failed matches: ${failedMatches}
|
|
254
|
+
- Success rate: ${totalSamples > 0 ? Math.round((successfulMatches / totalSamples) * 100) : 0}%`);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=grok-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grok-command.js","sourceRoot":"","sources":["../../../src/main/typescript/commands/grok-command.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAA2B,MAAM,8BAA8B,CAAC;AACxF,OAAO,EAAE,aAAa,EAAwB,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAwD,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAElH,OAAO,EAAE,MAAM,UAAU,CAAC;AAkB1B;;GAEG;AACH,MAAM,OAAO,gBAAgB;IACnB,SA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