cngkit 1.1.18 → 1.1.20
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 +1 -1
- package/README.md +94 -19
- package/dist/chunk-CIZBVLN5.js +35 -0
- package/dist/chunk-CIZBVLN5.js.map +1 -0
- package/dist/{chunk-IB5B3BLY.js → chunk-E2GLGGKO.js} +16 -4
- package/dist/chunk-E2GLGGKO.js.map +1 -0
- package/dist/chunk-MRXGD6TC.js +42 -0
- package/dist/chunk-MRXGD6TC.js.map +1 -0
- package/dist/{chunk-ZA4YOWPB.js → chunk-NGEWD4BW.js} +2 -1
- package/dist/chunk-NODJM6SH.js +658 -0
- package/dist/chunk-NODJM6SH.js.map +1 -0
- package/dist/chunk-SKK2XLRZ.js +1590 -0
- package/dist/chunk-SKK2XLRZ.js.map +1 -0
- package/dist/chunk-SMTQ3W3F.js +271 -0
- package/dist/chunk-SMTQ3W3F.js.map +1 -0
- package/dist/{chunk-FJ34NVQ4.js → chunk-WDI43VPW.js} +578 -88
- package/dist/chunk-WDI43VPW.js.map +1 -0
- package/dist/cli.js +107 -27
- package/dist/cli.js.map +1 -1
- package/dist/commands/coderoom/index.js +6 -6
- package/dist/commands/coderoom/index.js.map +1 -1
- package/dist/commands/coderoom/join.js +5 -5
- package/dist/commands/coderoom/share.js +5 -5
- package/dist/commands/hookify/index.js +6 -6
- package/dist/commands/hookify/index.js.map +1 -1
- package/dist/commands/hookify/ingest.js +52 -13
- package/dist/commands/hookify/ingest.js.map +1 -1
- package/dist/commands/hooks/index.js +25 -0
- package/dist/commands/hooks/index.js.map +1 -0
- package/dist/commands/hooks/install.js +40 -0
- package/dist/commands/hooks/install.js.map +1 -0
- package/dist/commands/hooks/uninstall.js +40 -0
- package/dist/commands/hooks/uninstall.js.map +1 -0
- package/dist/commands/index.js +5 -5
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/knowledges/audiences.js +6 -6
- package/dist/commands/knowledges/cat.js +31 -0
- package/dist/commands/knowledges/cat.js.map +1 -0
- package/dist/commands/knowledges/files.js +6 -6
- package/dist/commands/knowledges/find.js +66 -0
- package/dist/commands/knowledges/find.js.map +1 -0
- package/dist/commands/knowledges/glob.js +6 -6
- package/dist/commands/knowledges/grep.js +6 -6
- package/dist/commands/knowledges/head.js +41 -0
- package/dist/commands/knowledges/head.js.map +1 -0
- package/dist/commands/knowledges/index.js +6 -6
- package/dist/commands/knowledges/index.js.map +1 -1
- package/dist/commands/knowledges/list.js +7 -7
- package/dist/commands/knowledges/list.js.map +1 -1
- package/dist/commands/knowledges/ls.js +16 -7
- package/dist/commands/knowledges/ls.js.map +1 -1
- package/dist/commands/knowledges/read.js +6 -6
- package/dist/commands/knowledges/realpath.js +31 -0
- package/dist/commands/knowledges/realpath.js.map +1 -0
- package/dist/commands/knowledges/search.js +6 -6
- package/dist/commands/knowledges/stat.js +31 -0
- package/dist/commands/knowledges/stat.js.map +1 -0
- package/dist/commands/knowledges/status.js +6 -6
- package/dist/commands/knowledges/tail.js +41 -0
- package/dist/commands/knowledges/tail.js.map +1 -0
- package/dist/commands/knowledges/tree.js +46 -0
- package/dist/commands/knowledges/tree.js.map +1 -0
- package/dist/commands/login.js +4 -4
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/scrub.js +38 -15
- package/dist/commands/scrub.js.map +1 -1
- package/dist/commands/transcripts.js +44 -24
- package/dist/commands/transcripts.js.map +1 -1
- package/package.json +3 -4
- package/dist/chunk-C7HFDK4S.js +0 -393
- package/dist/chunk-C7HFDK4S.js.map +0 -1
- package/dist/chunk-CBIVTEZP.js +0 -222
- package/dist/chunk-CBIVTEZP.js.map +0 -1
- package/dist/chunk-FJ34NVQ4.js.map +0 -1
- package/dist/chunk-IB5B3BLY.js.map +0 -1
- package/dist/chunk-KSW6QT5Q.js +0 -628
- package/dist/chunk-KSW6QT5Q.js.map +0 -1
- package/dist/chunk-TWQDLZ6F.js +0 -26
- package/dist/chunk-TWQDLZ6F.js.map +0 -1
- /package/dist/{chunk-ZA4YOWPB.js.map → chunk-NGEWD4BW.js.map} +0 -0
|
@@ -0,0 +1,1590 @@
|
|
|
1
|
+
// src/cli/help-specs.ts
|
|
2
|
+
import { createElement } from "react";
|
|
3
|
+
|
|
4
|
+
// src/cli/help-components.tsx
|
|
5
|
+
import { Box, Text } from "ink";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function HelpDocument({ document }) {
|
|
8
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
9
|
+
/* @__PURE__ */ jsx(Text, { bold: true, color: "magenta", children: document.heading }),
|
|
10
|
+
document.blocks.map((block, index) => /* @__PURE__ */ jsx(HelpBlockView, { block }, `${block.kind}-${index}`))
|
|
11
|
+
] });
|
|
12
|
+
}
|
|
13
|
+
function HelpBlockView({ block }) {
|
|
14
|
+
if (block.kind === "section") {
|
|
15
|
+
return /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(Text, { bold: true, color: "blue", children: block.title }) });
|
|
16
|
+
}
|
|
17
|
+
if (block.kind === "paragraph") {
|
|
18
|
+
return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, { wrap: "wrap", children: /* @__PURE__ */ jsx(InlineText, { text: block.text }) }) });
|
|
19
|
+
}
|
|
20
|
+
if (block.kind === "list") {
|
|
21
|
+
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", children: block.items.map((item, index) => /* @__PURE__ */ jsxs(Text, { wrap: "wrap", children: [
|
|
22
|
+
/* @__PURE__ */ jsx(Text, { color: "cyan", children: "- " }),
|
|
23
|
+
/* @__PURE__ */ jsx(InlineText, { text: item })
|
|
24
|
+
] }, `${item}-${index}`)) });
|
|
25
|
+
}
|
|
26
|
+
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginLeft: 2, children: block.lines.map((line, index) => /* @__PURE__ */ jsx(Text, { color: "green", children: line }, `${line}-${index}`)) });
|
|
27
|
+
}
|
|
28
|
+
function InlineText({ text }) {
|
|
29
|
+
return text.split(/(`[^`]+`)/g).map((part, index) => {
|
|
30
|
+
const isCodeSpan = part.startsWith("`") && part.endsWith("`") && part.length > 1;
|
|
31
|
+
if (isCodeSpan) {
|
|
32
|
+
return /* @__PURE__ */ jsx(Text, { color: "cyan", children: part.slice(1, -1) }, `${part}-${index}`);
|
|
33
|
+
}
|
|
34
|
+
return part;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// src/cli/help-topic-content.ts
|
|
39
|
+
var helpTopicDocuments = [
|
|
40
|
+
{
|
|
41
|
+
title: "cngkit",
|
|
42
|
+
aliases: ["", "overview", "help"],
|
|
43
|
+
heading: "cngkit",
|
|
44
|
+
blocks: [
|
|
45
|
+
{
|
|
46
|
+
kind: "paragraph",
|
|
47
|
+
text: "CNG operator CLI for shared code rooms, safe local cleanup, local agent transcripts, and hosted Harness knowledges."
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
kind: "section",
|
|
51
|
+
title: "Run Now"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
kind: "code",
|
|
55
|
+
language: "bash",
|
|
56
|
+
lines: [
|
|
57
|
+
"npx --yes cngkit@latest --help",
|
|
58
|
+
"npx --yes cngkit@latest knowledges search Cloudflare --limit 3"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
kind: "section",
|
|
63
|
+
title: "Installed Usage"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
kind: "code",
|
|
67
|
+
language: "bash",
|
|
68
|
+
lines: ["cngkit <command> [options]"]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
kind: "section",
|
|
72
|
+
title: "Global Options"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
kind: "code",
|
|
76
|
+
language: "bash",
|
|
77
|
+
lines: ["cngkit --format text|json|markdown ...", "cngkit --no-color ..."]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
kind: "section",
|
|
81
|
+
title: "Commands"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
kind: "list",
|
|
85
|
+
items: [
|
|
86
|
+
"`cngkit login` - open browser login, or print the URL in headless shells.",
|
|
87
|
+
"`cngkit coderoom ...` - share or join a live developer room for a working tree.",
|
|
88
|
+
"`cngkit scrub [path]` - scan for secrets; rewrite only when `--yes` is passed.",
|
|
89
|
+
"`cngkit transcripts ...` - list, read, and grep local Claude/Codex transcripts.",
|
|
90
|
+
"`cngkit knowledges ...` - search and read the hosted Harness knowledge catalog.",
|
|
91
|
+
"`cngkit hooks ...` - install Hookify forwarding hooks into supported AI coding tools.",
|
|
92
|
+
"`cngkit hookify ...` - forward local hook events to Hookify."
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
kind: "section",
|
|
97
|
+
title: "Help Map"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
kind: "code",
|
|
101
|
+
language: "bash",
|
|
102
|
+
lines: [
|
|
103
|
+
"cngkit help <topic>",
|
|
104
|
+
"cngkit <command> --help",
|
|
105
|
+
"cngkit coderoom --help",
|
|
106
|
+
"cngkit coderoom <subcommand> --help",
|
|
107
|
+
"cngkit transcripts --help",
|
|
108
|
+
"cngkit hooks --help",
|
|
109
|
+
"cngkit hooks install --help",
|
|
110
|
+
"cngkit hooks uninstall --help",
|
|
111
|
+
"cngkit knowledges --help",
|
|
112
|
+
"cngkit knowledges <subcommand> --help",
|
|
113
|
+
"cngkit hookify --help",
|
|
114
|
+
"cngkit hookify ingest --help"
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
kind: "section",
|
|
119
|
+
title: "AI And Scripts"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
kind: "list",
|
|
123
|
+
items: [
|
|
124
|
+
"Help renders as structured terminal text by default, even in pipes.",
|
|
125
|
+
"Use `--format json` or `--json` on read-only data commands for typed payloads.",
|
|
126
|
+
"Use `--format markdown` only when raw Markdown source is intentional.",
|
|
127
|
+
"Use `--no-color` or `CNGKIT_COLOR=never` for logs, screenshots, and strict plain text.",
|
|
128
|
+
"Use `npm_config_progress=false npx --yes cngkit@latest ...` for clean one-shot npx captures."
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
kind: "section",
|
|
133
|
+
title: "Backend"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
kind: "paragraph",
|
|
137
|
+
text: "API: `https://curly.ng`"
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
title: "login",
|
|
143
|
+
aliases: ["login"],
|
|
144
|
+
heading: "cngkit login",
|
|
145
|
+
blocks: [
|
|
146
|
+
{
|
|
147
|
+
kind: "paragraph",
|
|
148
|
+
text: "Open browser login. In headless shells, print the URL so an agent can show it to the operator."
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
kind: "section",
|
|
152
|
+
title: "Usage"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
kind: "code",
|
|
156
|
+
language: "bash",
|
|
157
|
+
lines: ["npx --yes cngkit@latest login", "cngkit login"]
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
kind: "section",
|
|
161
|
+
title: "Output"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
kind: "list",
|
|
165
|
+
items: [
|
|
166
|
+
"First line names the login URL being opened.",
|
|
167
|
+
"If no browser opener exists, the CLI prints a direct URL.",
|
|
168
|
+
"No credentials are printed or persisted by this command."
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
title: "transcripts",
|
|
175
|
+
aliases: ["transcripts", "transcript"],
|
|
176
|
+
heading: "cngkit transcripts",
|
|
177
|
+
blocks: [
|
|
178
|
+
{
|
|
179
|
+
kind: "paragraph",
|
|
180
|
+
text: "Read local Claude and Codex transcript JSONL files."
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
kind: "paragraph",
|
|
184
|
+
text: "This is local-only operator tooling. It does not call the backend and it does not upload transcript content."
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
kind: "section",
|
|
188
|
+
title: "Usage"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
kind: "code",
|
|
192
|
+
language: "bash",
|
|
193
|
+
lines: [
|
|
194
|
+
"cngkit transcripts list [--source all|codex|claude] [--limit <n>] [--json|--format json]",
|
|
195
|
+
"cngkit transcripts read <path-or-session-id> [--source all|codex|claude] [--limit <n>] [--include-internal] [--json|--format json]",
|
|
196
|
+
"cngkit transcripts grep <query> [--source all|codex|claude] [--limit <n>] [--file-limit <n>] [--include-internal] [--json|--format json]"
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
kind: "section",
|
|
201
|
+
title: "Sources"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
kind: "list",
|
|
205
|
+
items: [
|
|
206
|
+
"`~/.codex/sessions`",
|
|
207
|
+
"`~/.codex/archived_sessions`",
|
|
208
|
+
"`~/.claude/projects`",
|
|
209
|
+
"`~/.claude/history.jsonl`"
|
|
210
|
+
]
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
kind: "section",
|
|
214
|
+
title: "Defaults"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
kind: "list",
|
|
218
|
+
items: [
|
|
219
|
+
"`list`: newest 12 transcript files.",
|
|
220
|
+
"`read`: newest 80 user/assistant entries from the selected file.",
|
|
221
|
+
"`grep`: first 80 matching user/assistant entries from the newest 60 files.",
|
|
222
|
+
"`--source`: `all`."
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
kind: "section",
|
|
227
|
+
title: "Output"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
kind: "list",
|
|
231
|
+
items: [
|
|
232
|
+
"Text mode prints source, role, timestamp when available, and extracted message text.",
|
|
233
|
+
"Internal developer/system payloads and hook/tool noise are skipped unless `--include-internal` is passed.",
|
|
234
|
+
"Direct file paths, home-relative paths, and partial session ids are accepted by `read`."
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
title: "hookify",
|
|
241
|
+
aliases: ["hookify"],
|
|
242
|
+
heading: "cngkit hookify",
|
|
243
|
+
blocks: [
|
|
244
|
+
{
|
|
245
|
+
kind: "paragraph",
|
|
246
|
+
text: "Forward local hook events to Hookify."
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
kind: "paragraph",
|
|
250
|
+
text: "Hookify is the hosted hook processing surface. The CLI stays small: it reads hook payloads locally, forwards raw stdin to the backend, prints the backend stdout, and exits with the backend exit code. If forwarding fails, it exits with code 0."
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
kind: "section",
|
|
254
|
+
title: "Usage"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
kind: "code",
|
|
258
|
+
language: "bash",
|
|
259
|
+
lines: ["cngkit hookify <subcommand> [options]"]
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
kind: "section",
|
|
263
|
+
title: "Subcommands"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
kind: "list",
|
|
267
|
+
items: ["`ingest` - read a raw hook payload from stdin and forward it to the backend."]
|
|
268
|
+
}
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
title: "hooks",
|
|
273
|
+
aliases: ["hooks"],
|
|
274
|
+
heading: "cngkit hooks",
|
|
275
|
+
blocks: [
|
|
276
|
+
{
|
|
277
|
+
kind: "paragraph",
|
|
278
|
+
text: "Install local Hookify forwarding hooks into supported AI-assisted coding tools."
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
kind: "paragraph",
|
|
282
|
+
text: "The installer writes user-level config for documented hook surfaces and preserves existing non-cngkit hooks. Re-running it is idempotent: old cngkit Hookify entries are replaced with one current entry per event."
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
kind: "section",
|
|
286
|
+
title: "Usage"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
kind: "code",
|
|
290
|
+
language: "bash",
|
|
291
|
+
lines: ["cngkit hooks <subcommand> [options]"]
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
kind: "section",
|
|
295
|
+
title: "Subcommands"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
kind: "list",
|
|
299
|
+
items: [
|
|
300
|
+
"`install` - install Hookify forwarding hooks into supported AI coding tools.",
|
|
301
|
+
"`uninstall` - remove cngkit Hookify forwarding hooks from supported AI coding tools."
|
|
302
|
+
]
|
|
303
|
+
}
|
|
304
|
+
]
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
title: "hooks install",
|
|
308
|
+
aliases: ["hooks-install"],
|
|
309
|
+
heading: "cngkit hooks install",
|
|
310
|
+
blocks: [
|
|
311
|
+
{
|
|
312
|
+
kind: "paragraph",
|
|
313
|
+
text: "Install Hookify forwarding hooks into supported AI-assisted coding tools."
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
kind: "section",
|
|
317
|
+
title: "Usage"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
kind: "code",
|
|
321
|
+
language: "bash",
|
|
322
|
+
lines: ["cngkit hooks install [--tool all|claude|codex] [--dry-run]"]
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
kind: "section",
|
|
326
|
+
title: "Behavior"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
kind: "list",
|
|
330
|
+
items: [
|
|
331
|
+
"Configures Claude Code at `~/.claude/settings.json`.",
|
|
332
|
+
"Configures Codex at `~/.codex/hooks.json`.",
|
|
333
|
+
"Preserves existing hook handlers that do not call `cngkit hookify ingest`.",
|
|
334
|
+
"Replaces older cngkit Hookify handlers to avoid duplicates.",
|
|
335
|
+
"Uses `cngkit hookify ingest --event <EventName>` for every supported event, avoiding npm package resolution in hook hot paths."
|
|
336
|
+
]
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
kind: "section",
|
|
340
|
+
title: "Examples"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
kind: "code",
|
|
344
|
+
language: "bash",
|
|
345
|
+
lines: [
|
|
346
|
+
"cngkit hooks install --dry-run",
|
|
347
|
+
"cngkit hooks install",
|
|
348
|
+
"cngkit hooks install --tool codex"
|
|
349
|
+
]
|
|
350
|
+
}
|
|
351
|
+
]
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
title: "hooks uninstall",
|
|
355
|
+
aliases: ["hooks-uninstall"],
|
|
356
|
+
heading: "cngkit hooks uninstall",
|
|
357
|
+
blocks: [
|
|
358
|
+
{
|
|
359
|
+
kind: "paragraph",
|
|
360
|
+
text: "Remove cngkit Hookify forwarding hooks from supported AI-assisted coding tools."
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
kind: "section",
|
|
364
|
+
title: "Usage"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
kind: "code",
|
|
368
|
+
language: "bash",
|
|
369
|
+
lines: ["cngkit hooks uninstall [--tool all|claude|codex] [--dry-run]"]
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
kind: "section",
|
|
373
|
+
title: "Behavior"
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
kind: "list",
|
|
377
|
+
items: [
|
|
378
|
+
"Reads Claude Code at `~/.claude/settings.json`.",
|
|
379
|
+
"Reads Codex at `~/.codex/hooks.json`.",
|
|
380
|
+
"Removes cngkit Hookify handlers installed with either the current direct `cngkit hookify ingest` command or older `cngkit@latest` npm/npx commands.",
|
|
381
|
+
"Preserves all non-cngkit hook handlers and all other settings.",
|
|
382
|
+
"Reports the exact config file, handler count, and event names changed."
|
|
383
|
+
]
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
kind: "section",
|
|
387
|
+
title: "Examples"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
kind: "code",
|
|
391
|
+
language: "bash",
|
|
392
|
+
lines: [
|
|
393
|
+
"cngkit hooks uninstall --dry-run",
|
|
394
|
+
"cngkit hooks uninstall",
|
|
395
|
+
"cngkit hooks uninstall --tool claude"
|
|
396
|
+
]
|
|
397
|
+
}
|
|
398
|
+
]
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
title: "hookify ingest",
|
|
402
|
+
aliases: ["hookify-ingest"],
|
|
403
|
+
heading: "cngkit hookify ingest",
|
|
404
|
+
blocks: [
|
|
405
|
+
{
|
|
406
|
+
kind: "paragraph",
|
|
407
|
+
text: "Read a raw hook payload from stdin and forward it to Hookify."
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
kind: "section",
|
|
411
|
+
title: "Usage"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
kind: "code",
|
|
415
|
+
language: "bash",
|
|
416
|
+
lines: ["cngkit hookify ingest [--event <name>] [--async]"]
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
kind: "section",
|
|
420
|
+
title: "Behavior"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
kind: "list",
|
|
424
|
+
items: [
|
|
425
|
+
"Reads stdin exactly as the hook provides it.",
|
|
426
|
+
"Sends the payload to `POST /api/hookify/ingest` as `application/octet-stream`.",
|
|
427
|
+
"Handles both immediate backend results and workflow-backed pending results.",
|
|
428
|
+
"Polls `GET /api/hookify/requests/<requestId>` when the backend returns a pending request.",
|
|
429
|
+
"Prints backend `stdout` without extra formatting.",
|
|
430
|
+
"Writes backend `stderr` when present.",
|
|
431
|
+
"Uses backend `exitCode` as the process exit code.",
|
|
432
|
+
"Falls back to exit code `0` if the backend request fails.",
|
|
433
|
+
"`--async` tells the backend that workflow-backed processing is acceptable; the local command still waits for the final hook result."
|
|
434
|
+
]
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
kind: "section",
|
|
438
|
+
title: "Example"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
kind: "code",
|
|
442
|
+
language: "bash",
|
|
443
|
+
lines: [`printf '{"hook":"PreToolUse"}' | cngkit hookify ingest --event PreToolUse`]
|
|
444
|
+
}
|
|
445
|
+
]
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
title: "coderoom",
|
|
449
|
+
aliases: ["coderoom", "code-room", "repo-sync"],
|
|
450
|
+
heading: "cngkit coderoom",
|
|
451
|
+
blocks: [
|
|
452
|
+
{
|
|
453
|
+
kind: "paragraph",
|
|
454
|
+
text: "Create or join a temporary live room for sharing a working tree over the configured backend."
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
kind: "section",
|
|
458
|
+
title: "Usage"
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
kind: "code",
|
|
462
|
+
language: "bash",
|
|
463
|
+
lines: ["cngkit coderoom <subcommand> [options]"]
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
kind: "section",
|
|
467
|
+
title: "Subcommands"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
kind: "list",
|
|
471
|
+
items: [
|
|
472
|
+
"`share [room-code]` - start a live room from the current directory.",
|
|
473
|
+
"`join <room-code>` - join another developer's live room from the current directory."
|
|
474
|
+
]
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
kind: "section",
|
|
478
|
+
title: "Common Flow"
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
kind: "code",
|
|
482
|
+
language: "bash",
|
|
483
|
+
lines: [
|
|
484
|
+
"npx --yes cngkit@latest coderoom share",
|
|
485
|
+
"npx --yes cngkit@latest coderoom join <room-code>"
|
|
486
|
+
]
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
kind: "section",
|
|
490
|
+
title: "Behavior"
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
kind: "list",
|
|
494
|
+
items: [
|
|
495
|
+
"Connects to `/api/cng/sync/:roomCode` on the configured backend.",
|
|
496
|
+
"Uses WebSocket transport backed by the `CngSyncRoom` Durable Object.",
|
|
497
|
+
"Sends an initial snapshot, then file and delete events.",
|
|
498
|
+
"Last received change wins.",
|
|
499
|
+
"Current rooms are live relays, not durable cloud storage."
|
|
500
|
+
]
|
|
501
|
+
}
|
|
502
|
+
]
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
title: "coderoom share",
|
|
506
|
+
aliases: ["coderoom-share"],
|
|
507
|
+
heading: "cngkit coderoom share",
|
|
508
|
+
blocks: [
|
|
509
|
+
{
|
|
510
|
+
kind: "paragraph",
|
|
511
|
+
text: "Start a live repository sync room from the current directory."
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
kind: "section",
|
|
515
|
+
title: "Usage"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
kind: "code",
|
|
519
|
+
language: "bash",
|
|
520
|
+
lines: ["cngkit coderoom share [room-code]"]
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
kind: "section",
|
|
524
|
+
title: "Behavior"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
kind: "list",
|
|
528
|
+
items: [
|
|
529
|
+
"Connects to `/api/cng/sync/:roomCode` on the configured backend.",
|
|
530
|
+
"Uses WebSocket transport backed by the `CngSyncRoom` Durable Object.",
|
|
531
|
+
"Sends an initial snapshot, then file and delete events.",
|
|
532
|
+
"Last received change wins."
|
|
533
|
+
]
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
kind: "section",
|
|
537
|
+
title: "Filesystem Contract"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
kind: "list",
|
|
541
|
+
items: [
|
|
542
|
+
"Preserves `.git/`.",
|
|
543
|
+
"Preserves files ignored by the repo's `.gitignore`.",
|
|
544
|
+
"Sends regular files as base64 payloads in the sync protocol."
|
|
545
|
+
]
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
kind: "section",
|
|
549
|
+
title: "Output"
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
kind: "list",
|
|
553
|
+
items: [
|
|
554
|
+
"Prints room code, repo root, peer id, backend health, and concise sync events.",
|
|
555
|
+
"Keeps running until the socket closes or the process receives a termination signal."
|
|
556
|
+
]
|
|
557
|
+
}
|
|
558
|
+
]
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
title: "coderoom join",
|
|
562
|
+
aliases: ["coderoom-join"],
|
|
563
|
+
heading: "cngkit coderoom join",
|
|
564
|
+
blocks: [
|
|
565
|
+
{
|
|
566
|
+
kind: "paragraph",
|
|
567
|
+
text: "Join an existing live repository sync room from the current directory."
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
kind: "section",
|
|
571
|
+
title: "Usage"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
kind: "code",
|
|
575
|
+
language: "bash",
|
|
576
|
+
lines: ["cngkit coderoom join <room-code>"]
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
kind: "section",
|
|
580
|
+
title: "Behavior"
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
kind: "paragraph",
|
|
584
|
+
text: "Same transport and filesystem contract as `cngkit coderoom share`. The supplied room code selects the Durable Object room."
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
kind: "section",
|
|
588
|
+
title: "Output"
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
kind: "list",
|
|
592
|
+
items: [
|
|
593
|
+
"Prints backend health, room code, repo root, peer id, and concise sync events.",
|
|
594
|
+
"Missing room code exits with a usage error."
|
|
595
|
+
]
|
|
596
|
+
}
|
|
597
|
+
]
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
title: "scrub",
|
|
601
|
+
aliases: ["scrub"],
|
|
602
|
+
heading: "cngkit scrub",
|
|
603
|
+
blocks: [
|
|
604
|
+
{
|
|
605
|
+
kind: "paragraph",
|
|
606
|
+
text: "Scan a file or directory for secrets with TruffleHog. Report-only is the default."
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
kind: "section",
|
|
610
|
+
title: "Usage"
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
kind: "code",
|
|
614
|
+
language: "bash",
|
|
615
|
+
lines: ["cngkit scrub [path]", "cngkit scrub [path] --yes"]
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
kind: "section",
|
|
619
|
+
title: "Safety"
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
kind: "list",
|
|
623
|
+
items: [
|
|
624
|
+
"Default mode does not rewrite files.",
|
|
625
|
+
"Inline masking rewrites files and requires `--yes`.",
|
|
626
|
+
"Raw and redacted secret values are never printed."
|
|
627
|
+
]
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
kind: "section",
|
|
631
|
+
title: "Requirements"
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
kind: "list",
|
|
635
|
+
items: ["`trufflehog` must be available on `PATH`."]
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
kind: "section",
|
|
639
|
+
title: "Mask Format"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
kind: "code",
|
|
643
|
+
language: "text",
|
|
644
|
+
lines: ["[CNGKIT_SECRET:<detector>:<verified|unverified>]"]
|
|
645
|
+
}
|
|
646
|
+
]
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
title: "knowledges",
|
|
650
|
+
aliases: ["knowledges", "knowledge"],
|
|
651
|
+
heading: "cngkit knowledges",
|
|
652
|
+
blocks: [
|
|
653
|
+
{
|
|
654
|
+
kind: "paragraph",
|
|
655
|
+
text: "Search and read the hosted Harness knowledges catalog from the configured backend."
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
kind: "section",
|
|
659
|
+
title: "Usage"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
kind: "code",
|
|
663
|
+
language: "bash",
|
|
664
|
+
lines: ["cngkit knowledges <subcommand> [options]"]
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
kind: "section",
|
|
668
|
+
title: "Subcommands"
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
kind: "list",
|
|
672
|
+
items: [
|
|
673
|
+
"`status` - print remote catalog state.",
|
|
674
|
+
"`audiences` - list valid audience filters.",
|
|
675
|
+
"`search <query>` - search over Postgres-backed knowledges records.",
|
|
676
|
+
"`list [query]` - list known topics.",
|
|
677
|
+
"`files [query]` - list uploaded catalog files.",
|
|
678
|
+
"`ls [path]` - list remote catalog directory entries.",
|
|
679
|
+
"`tree [path]` - print a remote catalog directory tree.",
|
|
680
|
+
"`cat <file-path>` - print a remote catalog file as raw text.",
|
|
681
|
+
"`head <file-path>` - print the first lines of a remote catalog file.",
|
|
682
|
+
"`tail <file-path>` - print the last lines of a remote catalog file.",
|
|
683
|
+
"`stat <path>` - print remote catalog path metadata.",
|
|
684
|
+
"`find [path]` - find remote catalog paths by name and type.",
|
|
685
|
+
"`realpath <path>` - normalize a topics-root catalog path.",
|
|
686
|
+
"`read <file-path>` - Claude-style file read.",
|
|
687
|
+
"`grep <pattern>` - Claude-style content search.",
|
|
688
|
+
"`glob [pattern]` - Claude-style file discovery."
|
|
689
|
+
]
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
kind: "section",
|
|
693
|
+
title: "Progressive Help"
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
kind: "code",
|
|
697
|
+
language: "bash",
|
|
698
|
+
lines: [
|
|
699
|
+
"cngkit help knowledges <subcommand>",
|
|
700
|
+
"cngkit knowledges <subcommand> --help",
|
|
701
|
+
"cngkit knowledges read --help",
|
|
702
|
+
"cngkit knowledges ls --help",
|
|
703
|
+
"cngkit knowledges tree --help",
|
|
704
|
+
"cngkit knowledges cat --help",
|
|
705
|
+
"cngkit knowledges head --help",
|
|
706
|
+
"cngkit knowledges tail --help",
|
|
707
|
+
"cngkit knowledges find --help",
|
|
708
|
+
"cngkit knowledges stat --help",
|
|
709
|
+
"cngkit knowledges realpath --help",
|
|
710
|
+
"cngkit knowledges grep --help",
|
|
711
|
+
"cngkit knowledges glob --help"
|
|
712
|
+
]
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
kind: "section",
|
|
716
|
+
title: "Common Examples"
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
kind: "code",
|
|
720
|
+
language: "bash",
|
|
721
|
+
lines: [
|
|
722
|
+
"npx --yes cngkit@latest knowledges search Cloudflare --limit 3",
|
|
723
|
+
"npx --yes cngkit@latest knowledges ls /",
|
|
724
|
+
"npx --yes cngkit@latest knowledges tree /libraries --depth 2",
|
|
725
|
+
"npx --yes cngkit@latest knowledges cat /libraries/lib-cloudflare/TOPIC.md",
|
|
726
|
+
"npx --yes cngkit@latest knowledges head /libraries/lib-cloudflare/TOPIC.md -n 20",
|
|
727
|
+
"npx --yes cngkit@latest knowledges tail /libraries/lib-cloudflare/TOPIC.md -n 20",
|
|
728
|
+
'npx --yes cngkit@latest knowledges find /libraries -name "*cloudflare*" -type f',
|
|
729
|
+
"npx --yes cngkit@latest knowledges stat /libraries/lib-cloudflare/TOPIC.md",
|
|
730
|
+
"npx --yes cngkit@latest knowledges realpath /libraries/lib-cloudflare",
|
|
731
|
+
"npx --yes cngkit@latest knowledges read /libraries/lib-cloudflare/TOPIC.md --limit 80",
|
|
732
|
+
"npx --yes cngkit@latest knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches",
|
|
733
|
+
'npx --yes cngkit@latest knowledges glob "**/*.md" --path /libraries/lib-cloudflare'
|
|
734
|
+
]
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
kind: "section",
|
|
738
|
+
title: "AI-Friendly Output"
|
|
739
|
+
},
|
|
740
|
+
{
|
|
741
|
+
kind: "list",
|
|
742
|
+
items: [
|
|
743
|
+
"Default output is structured text intended to be directly usable by people and agents.",
|
|
744
|
+
"`ls` prints one name per line; directories end with `/`. Use `--long` or `-l` for type, path, and metadata fields.",
|
|
745
|
+
"`tree` prints a deterministic plain-text tree; directories end with `/`.",
|
|
746
|
+
"`cat`, `head`, and `tail` print raw file content only in text mode.",
|
|
747
|
+
"`find` prints one resolved path per line.",
|
|
748
|
+
"`read` renders Markdown files by default and prints exact source with `--format markdown`.",
|
|
749
|
+
"`grep --output-mode content` prints `path:line` blocks.",
|
|
750
|
+
"`grep --output-mode files_with_matches` and `glob` print one path per line.",
|
|
751
|
+
"`--format json` and `--json` print typed backend payloads for machine consumption."
|
|
752
|
+
]
|
|
753
|
+
}
|
|
754
|
+
]
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
title: "knowledges status",
|
|
758
|
+
aliases: ["knowledges-status", "status"],
|
|
759
|
+
heading: "cngkit knowledges status",
|
|
760
|
+
blocks: [
|
|
761
|
+
{
|
|
762
|
+
kind: "paragraph",
|
|
763
|
+
text: "Print remote Harness catalog state."
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
kind: "section",
|
|
767
|
+
title: "Usage"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
kind: "code",
|
|
771
|
+
language: "bash",
|
|
772
|
+
lines: ["cngkit knowledges status [--json|--format json]"]
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
kind: "section",
|
|
776
|
+
title: "Output"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
kind: "list",
|
|
780
|
+
items: [
|
|
781
|
+
"Text mode prints catalog name, file count, blob count, and database binding.",
|
|
782
|
+
"`--format json` and `--json` print the backend data payload."
|
|
783
|
+
]
|
|
784
|
+
}
|
|
785
|
+
]
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
title: "knowledges audiences",
|
|
789
|
+
aliases: ["knowledges-audiences", "audiences"],
|
|
790
|
+
heading: "cngkit knowledges audiences",
|
|
791
|
+
blocks: [
|
|
792
|
+
{
|
|
793
|
+
kind: "paragraph",
|
|
794
|
+
text: "List valid audience filters for catalog browsing."
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
kind: "section",
|
|
798
|
+
title: "Usage"
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
kind: "code",
|
|
802
|
+
language: "bash",
|
|
803
|
+
lines: ["cngkit knowledges audiences [--json|--format json]"]
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
kind: "section",
|
|
807
|
+
title: "Use When"
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
kind: "paragraph",
|
|
811
|
+
text: "Run this before `cngkit knowledges files --audience <id>`."
|
|
812
|
+
}
|
|
813
|
+
]
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
title: "knowledges search",
|
|
817
|
+
aliases: ["knowledges-search", "search"],
|
|
818
|
+
heading: "cngkit knowledges search",
|
|
819
|
+
blocks: [
|
|
820
|
+
{
|
|
821
|
+
kind: "paragraph",
|
|
822
|
+
text: "Search the hosted Harness index for relevant skills and topics."
|
|
823
|
+
},
|
|
824
|
+
{
|
|
825
|
+
kind: "section",
|
|
826
|
+
title: "Usage"
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
kind: "code",
|
|
830
|
+
language: "bash",
|
|
831
|
+
lines: ["cngkit knowledges search <query> [--limit <n>] [--json|--format json]"]
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
kind: "section",
|
|
835
|
+
title: "Defaults"
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
kind: "list",
|
|
839
|
+
items: ["`--limit`: `5`"]
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
kind: "section",
|
|
843
|
+
title: "Example"
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
kind: "code",
|
|
847
|
+
language: "bash",
|
|
848
|
+
lines: ["npx --yes cngkit@latest knowledges search Cloudflare --limit 3"]
|
|
849
|
+
}
|
|
850
|
+
]
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
title: "knowledges list",
|
|
854
|
+
aliases: ["knowledges-list", "list"],
|
|
855
|
+
heading: "cngkit knowledges list",
|
|
856
|
+
blocks: [
|
|
857
|
+
{
|
|
858
|
+
kind: "paragraph",
|
|
859
|
+
text: "List hosted Harness topics, optionally filtered by query."
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
kind: "section",
|
|
863
|
+
title: "Usage"
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
kind: "code",
|
|
867
|
+
language: "bash",
|
|
868
|
+
lines: ["cngkit knowledges list [query] [--limit <n>] [--json|--format json]"]
|
|
869
|
+
},
|
|
870
|
+
{
|
|
871
|
+
kind: "section",
|
|
872
|
+
title: "Defaults"
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
kind: "list",
|
|
876
|
+
items: ["`--limit`: `25`"]
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
kind: "section",
|
|
880
|
+
title: "Example"
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
kind: "code",
|
|
884
|
+
language: "bash",
|
|
885
|
+
lines: ["cngkit knowledges list cloudflare --limit 10"]
|
|
886
|
+
}
|
|
887
|
+
]
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
title: "knowledges files",
|
|
891
|
+
aliases: ["knowledges-files", "files"],
|
|
892
|
+
heading: "cngkit knowledges files",
|
|
893
|
+
blocks: [
|
|
894
|
+
{
|
|
895
|
+
kind: "paragraph",
|
|
896
|
+
text: "List uploaded Harness catalog files, optionally filtered by query or audience."
|
|
897
|
+
},
|
|
898
|
+
{
|
|
899
|
+
kind: "section",
|
|
900
|
+
title: "Usage"
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
kind: "code",
|
|
904
|
+
language: "bash",
|
|
905
|
+
lines: [
|
|
906
|
+
"cngkit knowledges files [query] [--audience <id>] [--limit <n>] [--json|--format json]"
|
|
907
|
+
]
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
kind: "section",
|
|
911
|
+
title: "Defaults"
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
kind: "list",
|
|
915
|
+
items: ["`--limit`: `25`", "`--audience`: omitted"]
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
kind: "section",
|
|
919
|
+
title: "Example"
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
kind: "code",
|
|
923
|
+
language: "bash",
|
|
924
|
+
lines: [
|
|
925
|
+
"cngkit knowledges files cloudflare --limit 10",
|
|
926
|
+
'cngkit knowledges files "vector search" --audience builders'
|
|
927
|
+
]
|
|
928
|
+
}
|
|
929
|
+
]
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
title: "knowledges ls",
|
|
933
|
+
aliases: ["knowledges-ls", "ls"],
|
|
934
|
+
heading: "cngkit knowledges ls",
|
|
935
|
+
blocks: [
|
|
936
|
+
{
|
|
937
|
+
kind: "paragraph",
|
|
938
|
+
text: "List immediate children for a hosted Harness catalog directory."
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
kind: "section",
|
|
942
|
+
title: "Usage"
|
|
943
|
+
},
|
|
944
|
+
{
|
|
945
|
+
kind: "code",
|
|
946
|
+
language: "bash",
|
|
947
|
+
lines: [
|
|
948
|
+
"cngkit knowledges ls [path] [--limit <n>] [--json|--format json]",
|
|
949
|
+
"cngkit knowledges ls [path] --long"
|
|
950
|
+
]
|
|
951
|
+
},
|
|
952
|
+
{
|
|
953
|
+
kind: "section",
|
|
954
|
+
title: "Inputs"
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
kind: "list",
|
|
958
|
+
items: [
|
|
959
|
+
"`path`: topics-root path prefix. Default: `/`, the hosted equivalent of `~/.agents/topics`.",
|
|
960
|
+
"`--limit`: maximum entries. Default: `100`. CLI max: `1000`.",
|
|
961
|
+
"`--long`, `-l`: print type, path, and tab-separated metadata."
|
|
962
|
+
]
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
kind: "section",
|
|
966
|
+
title: "Output"
|
|
967
|
+
},
|
|
968
|
+
{
|
|
969
|
+
kind: "list",
|
|
970
|
+
items: [
|
|
971
|
+
"Text mode prints one entry name per line. Directories end with `/`.",
|
|
972
|
+
"Long text mode prints one entry per line as tab-separated `type`, `path`, and metadata fields.",
|
|
973
|
+
"Directories are sorted before files, then by path.",
|
|
974
|
+
"`--format json` and `--json` print `{ path, entries, total_entries, truncated }`."
|
|
975
|
+
]
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
kind: "section",
|
|
979
|
+
title: "Examples"
|
|
980
|
+
},
|
|
981
|
+
{
|
|
982
|
+
kind: "code",
|
|
983
|
+
language: "bash",
|
|
984
|
+
lines: [
|
|
985
|
+
"cngkit knowledges ls /",
|
|
986
|
+
"cngkit knowledges ls /libraries/lib-cloudflare",
|
|
987
|
+
"cngkit knowledges ls /libraries/lib-cloudflare -l"
|
|
988
|
+
]
|
|
989
|
+
}
|
|
990
|
+
]
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
title: "knowledges tree",
|
|
994
|
+
aliases: ["knowledges-tree", "tree"],
|
|
995
|
+
heading: "cngkit knowledges tree",
|
|
996
|
+
blocks: [
|
|
997
|
+
{
|
|
998
|
+
kind: "paragraph",
|
|
999
|
+
text: "Print a plain-text tree for a hosted Harness catalog directory."
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
kind: "section",
|
|
1003
|
+
title: "Usage"
|
|
1004
|
+
},
|
|
1005
|
+
{
|
|
1006
|
+
kind: "code",
|
|
1007
|
+
language: "bash",
|
|
1008
|
+
lines: ["cngkit knowledges tree [path] [--depth <n>] [--limit <n>] [--json|--format json]"]
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
kind: "section",
|
|
1012
|
+
title: "Defaults"
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
kind: "list",
|
|
1016
|
+
items: ["`path`: `/`", "`--depth`: `3`", "`--limit`: `500`"]
|
|
1017
|
+
},
|
|
1018
|
+
{
|
|
1019
|
+
kind: "section",
|
|
1020
|
+
title: "Output"
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
kind: "list",
|
|
1024
|
+
items: [
|
|
1025
|
+
"Text mode prints deterministic indented lines.",
|
|
1026
|
+
"Directories end with `/`.",
|
|
1027
|
+
"`--format json` and `--json` print `{ path, entries, total_entries, truncated, depth }`."
|
|
1028
|
+
]
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
kind: "section",
|
|
1032
|
+
title: "Example"
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
kind: "code",
|
|
1036
|
+
language: "bash",
|
|
1037
|
+
lines: ["cngkit knowledges tree /libraries --depth 2"]
|
|
1038
|
+
}
|
|
1039
|
+
]
|
|
1040
|
+
},
|
|
1041
|
+
{
|
|
1042
|
+
title: "knowledges cat",
|
|
1043
|
+
aliases: ["knowledges-cat", "cat"],
|
|
1044
|
+
heading: "cngkit knowledges cat",
|
|
1045
|
+
blocks: [
|
|
1046
|
+
{
|
|
1047
|
+
kind: "paragraph",
|
|
1048
|
+
text: "Print a hosted Harness catalog file as raw text."
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
kind: "section",
|
|
1052
|
+
title: "Usage"
|
|
1053
|
+
},
|
|
1054
|
+
{
|
|
1055
|
+
kind: "code",
|
|
1056
|
+
language: "bash",
|
|
1057
|
+
lines: ["cngkit knowledges cat <file-path> [--json|--format json]"]
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
kind: "section",
|
|
1061
|
+
title: "Output"
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
kind: "list",
|
|
1065
|
+
items: [
|
|
1066
|
+
"Text mode prints returned file content only.",
|
|
1067
|
+
"`--format json` and `--json` print the typed backend read payload."
|
|
1068
|
+
]
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
kind: "section",
|
|
1072
|
+
title: "Example"
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
kind: "code",
|
|
1076
|
+
language: "bash",
|
|
1077
|
+
lines: ["cngkit knowledges cat /libraries/lib-cloudflare/TOPIC.md"]
|
|
1078
|
+
}
|
|
1079
|
+
]
|
|
1080
|
+
},
|
|
1081
|
+
{
|
|
1082
|
+
title: "knowledges head",
|
|
1083
|
+
aliases: ["knowledges-head", "head"],
|
|
1084
|
+
heading: "cngkit knowledges head",
|
|
1085
|
+
blocks: [
|
|
1086
|
+
{
|
|
1087
|
+
kind: "paragraph",
|
|
1088
|
+
text: "Print the first lines of a hosted Harness catalog file as raw text."
|
|
1089
|
+
},
|
|
1090
|
+
{
|
|
1091
|
+
kind: "section",
|
|
1092
|
+
title: "Usage"
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
kind: "code",
|
|
1096
|
+
language: "bash",
|
|
1097
|
+
lines: ["cngkit knowledges head <file-path> [-n <lines>] [--json|--format json]"]
|
|
1098
|
+
},
|
|
1099
|
+
{
|
|
1100
|
+
kind: "section",
|
|
1101
|
+
title: "Defaults"
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
kind: "list",
|
|
1105
|
+
items: ["`-n`, `--lines`: `10`"]
|
|
1106
|
+
},
|
|
1107
|
+
{
|
|
1108
|
+
kind: "section",
|
|
1109
|
+
title: "Output"
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
kind: "list",
|
|
1113
|
+
items: [
|
|
1114
|
+
"Text mode prints returned file content only.",
|
|
1115
|
+
"`--format json` and `--json` print the typed backend read payload."
|
|
1116
|
+
]
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
kind: "section",
|
|
1120
|
+
title: "Example"
|
|
1121
|
+
},
|
|
1122
|
+
{
|
|
1123
|
+
kind: "code",
|
|
1124
|
+
language: "bash",
|
|
1125
|
+
lines: ["cngkit knowledges head /libraries/lib-cloudflare/TOPIC.md -n 20"]
|
|
1126
|
+
}
|
|
1127
|
+
]
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
title: "knowledges tail",
|
|
1131
|
+
aliases: ["knowledges-tail", "tail"],
|
|
1132
|
+
heading: "cngkit knowledges tail",
|
|
1133
|
+
blocks: [
|
|
1134
|
+
{
|
|
1135
|
+
kind: "paragraph",
|
|
1136
|
+
text: "Print the last lines of a hosted Harness catalog file as raw text."
|
|
1137
|
+
},
|
|
1138
|
+
{
|
|
1139
|
+
kind: "section",
|
|
1140
|
+
title: "Usage"
|
|
1141
|
+
},
|
|
1142
|
+
{
|
|
1143
|
+
kind: "code",
|
|
1144
|
+
language: "bash",
|
|
1145
|
+
lines: ["cngkit knowledges tail <file-path> [-n <lines>] [--json|--format json]"]
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
kind: "section",
|
|
1149
|
+
title: "Defaults"
|
|
1150
|
+
},
|
|
1151
|
+
{
|
|
1152
|
+
kind: "list",
|
|
1153
|
+
items: ["`-n`, `--lines`: `10`"]
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
kind: "section",
|
|
1157
|
+
title: "Output"
|
|
1158
|
+
},
|
|
1159
|
+
{
|
|
1160
|
+
kind: "list",
|
|
1161
|
+
items: [
|
|
1162
|
+
"Text mode prints returned file content only.",
|
|
1163
|
+
"`--format json` and `--json` print the typed backend tail payload."
|
|
1164
|
+
]
|
|
1165
|
+
},
|
|
1166
|
+
{
|
|
1167
|
+
kind: "section",
|
|
1168
|
+
title: "Example"
|
|
1169
|
+
},
|
|
1170
|
+
{
|
|
1171
|
+
kind: "code",
|
|
1172
|
+
language: "bash",
|
|
1173
|
+
lines: ["cngkit knowledges tail /libraries/lib-cloudflare/TOPIC.md -n 20"]
|
|
1174
|
+
}
|
|
1175
|
+
]
|
|
1176
|
+
},
|
|
1177
|
+
{
|
|
1178
|
+
title: "knowledges find",
|
|
1179
|
+
aliases: ["knowledges-find", "find"],
|
|
1180
|
+
heading: "cngkit knowledges find",
|
|
1181
|
+
blocks: [
|
|
1182
|
+
{
|
|
1183
|
+
kind: "paragraph",
|
|
1184
|
+
text: "Find hosted Harness catalog paths below a directory."
|
|
1185
|
+
},
|
|
1186
|
+
{
|
|
1187
|
+
kind: "section",
|
|
1188
|
+
title: "Usage"
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
kind: "code",
|
|
1192
|
+
language: "bash",
|
|
1193
|
+
lines: [
|
|
1194
|
+
"cngkit knowledges find [path] [-name <pattern>] [-type f|d] [--max-depth <n>] [--limit <n>] [--json|--format json]"
|
|
1195
|
+
]
|
|
1196
|
+
},
|
|
1197
|
+
{
|
|
1198
|
+
kind: "section",
|
|
1199
|
+
title: "Defaults"
|
|
1200
|
+
},
|
|
1201
|
+
{
|
|
1202
|
+
kind: "list",
|
|
1203
|
+
items: ["`path`: `/`", "`--limit`: `500`"]
|
|
1204
|
+
},
|
|
1205
|
+
{
|
|
1206
|
+
kind: "section",
|
|
1207
|
+
title: "Output"
|
|
1208
|
+
},
|
|
1209
|
+
{
|
|
1210
|
+
kind: "list",
|
|
1211
|
+
items: [
|
|
1212
|
+
"Text mode prints one resolved path per line.",
|
|
1213
|
+
"Directory paths end with `/`.",
|
|
1214
|
+
"`--format json` and `--json` print `{ path, entries, total_entries, truncated }`."
|
|
1215
|
+
]
|
|
1216
|
+
},
|
|
1217
|
+
{
|
|
1218
|
+
kind: "section",
|
|
1219
|
+
title: "Example"
|
|
1220
|
+
},
|
|
1221
|
+
{
|
|
1222
|
+
kind: "code",
|
|
1223
|
+
language: "bash",
|
|
1224
|
+
lines: ['cngkit knowledges find /libraries -name "*cloudflare*" -type f']
|
|
1225
|
+
}
|
|
1226
|
+
]
|
|
1227
|
+
},
|
|
1228
|
+
{
|
|
1229
|
+
title: "knowledges stat",
|
|
1230
|
+
aliases: ["knowledges-stat", "stat"],
|
|
1231
|
+
heading: "cngkit knowledges stat",
|
|
1232
|
+
blocks: [
|
|
1233
|
+
{
|
|
1234
|
+
kind: "paragraph",
|
|
1235
|
+
text: "Print metadata for one hosted Harness catalog file or inferred directory."
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
kind: "section",
|
|
1239
|
+
title: "Usage"
|
|
1240
|
+
},
|
|
1241
|
+
{
|
|
1242
|
+
kind: "code",
|
|
1243
|
+
language: "bash",
|
|
1244
|
+
lines: ["cngkit knowledges stat <path> [--json|--format json]"]
|
|
1245
|
+
},
|
|
1246
|
+
{
|
|
1247
|
+
kind: "section",
|
|
1248
|
+
title: "Inputs"
|
|
1249
|
+
},
|
|
1250
|
+
{
|
|
1251
|
+
kind: "list",
|
|
1252
|
+
items: [
|
|
1253
|
+
"`path`: topics-root path. `/libraries/lib-cloudflare/TOPIC.md` means `~/.agents/topics/libraries/lib-cloudflare/TOPIC.md`."
|
|
1254
|
+
]
|
|
1255
|
+
},
|
|
1256
|
+
{
|
|
1257
|
+
kind: "section",
|
|
1258
|
+
title: "Output"
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
kind: "list",
|
|
1262
|
+
items: [
|
|
1263
|
+
"Text mode prints stable `key=value` lines.",
|
|
1264
|
+
"`--format json` and `--json` print the typed backend path metadata."
|
|
1265
|
+
]
|
|
1266
|
+
},
|
|
1267
|
+
{
|
|
1268
|
+
kind: "section",
|
|
1269
|
+
title: "Example"
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
kind: "code",
|
|
1273
|
+
language: "bash",
|
|
1274
|
+
lines: ["cngkit knowledges stat /libraries/lib-cloudflare/TOPIC.md"]
|
|
1275
|
+
}
|
|
1276
|
+
]
|
|
1277
|
+
},
|
|
1278
|
+
{
|
|
1279
|
+
title: "knowledges realpath",
|
|
1280
|
+
aliases: ["knowledges-realpath", "realpath"],
|
|
1281
|
+
heading: "cngkit knowledges realpath",
|
|
1282
|
+
blocks: [
|
|
1283
|
+
{
|
|
1284
|
+
kind: "paragraph",
|
|
1285
|
+
text: "Normalize a topics-root catalog path without calling the backend."
|
|
1286
|
+
},
|
|
1287
|
+
{
|
|
1288
|
+
kind: "section",
|
|
1289
|
+
title: "Usage"
|
|
1290
|
+
},
|
|
1291
|
+
{
|
|
1292
|
+
kind: "code",
|
|
1293
|
+
language: "bash",
|
|
1294
|
+
lines: ["cngkit knowledges realpath <path> [--json|--format json]"]
|
|
1295
|
+
},
|
|
1296
|
+
{
|
|
1297
|
+
kind: "section",
|
|
1298
|
+
title: "Inputs"
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
kind: "list",
|
|
1302
|
+
items: [
|
|
1303
|
+
"`path`: topics-root catalog path.",
|
|
1304
|
+
"`/` is the hosted equivalent of `~/.agents/topics`."
|
|
1305
|
+
]
|
|
1306
|
+
},
|
|
1307
|
+
{
|
|
1308
|
+
kind: "section",
|
|
1309
|
+
title: "Output"
|
|
1310
|
+
},
|
|
1311
|
+
{
|
|
1312
|
+
kind: "list",
|
|
1313
|
+
items: [
|
|
1314
|
+
"Text mode prints the normalized topics-root path.",
|
|
1315
|
+
"`--format json` and `--json` print `{ path }`."
|
|
1316
|
+
]
|
|
1317
|
+
},
|
|
1318
|
+
{
|
|
1319
|
+
kind: "section",
|
|
1320
|
+
title: "Examples"
|
|
1321
|
+
},
|
|
1322
|
+
{
|
|
1323
|
+
kind: "code",
|
|
1324
|
+
language: "bash",
|
|
1325
|
+
lines: [
|
|
1326
|
+
"cngkit knowledges realpath /",
|
|
1327
|
+
"cngkit knowledges realpath /libraries/lib-cloudflare"
|
|
1328
|
+
]
|
|
1329
|
+
}
|
|
1330
|
+
]
|
|
1331
|
+
},
|
|
1332
|
+
{
|
|
1333
|
+
title: "knowledges read",
|
|
1334
|
+
aliases: ["knowledges-read", "read"],
|
|
1335
|
+
heading: "cngkit knowledges read",
|
|
1336
|
+
blocks: [
|
|
1337
|
+
{
|
|
1338
|
+
kind: "paragraph",
|
|
1339
|
+
text: "Read a hosted Harness catalog file by path."
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
kind: "section",
|
|
1343
|
+
title: "Usage"
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
kind: "code",
|
|
1347
|
+
language: "bash",
|
|
1348
|
+
lines: [
|
|
1349
|
+
"cngkit knowledges read <file-path> [--offset <n>] [--limit <n>] [--json|--format json|--format markdown]"
|
|
1350
|
+
]
|
|
1351
|
+
},
|
|
1352
|
+
{
|
|
1353
|
+
kind: "section",
|
|
1354
|
+
title: "Inputs"
|
|
1355
|
+
},
|
|
1356
|
+
{
|
|
1357
|
+
kind: "list",
|
|
1358
|
+
items: [
|
|
1359
|
+
"`file-path`: topics-root file path. `/libraries/lib-cloudflare/TOPIC.md` means `~/.agents/topics/libraries/lib-cloudflare/TOPIC.md`.",
|
|
1360
|
+
"`--offset`: zero-based starting line. Default: `0`.",
|
|
1361
|
+
"`--limit`: maximum lines. Default in CLI: `200`. Backend max: `2000`."
|
|
1362
|
+
]
|
|
1363
|
+
},
|
|
1364
|
+
{
|
|
1365
|
+
kind: "section",
|
|
1366
|
+
title: "Output"
|
|
1367
|
+
},
|
|
1368
|
+
{
|
|
1369
|
+
kind: "list",
|
|
1370
|
+
items: [
|
|
1371
|
+
"Text mode renders Markdown files for terminal reading.",
|
|
1372
|
+
"`--format markdown` prints the exact returned file content.",
|
|
1373
|
+
"If truncated, a final bracketed truncation note is printed after the content.",
|
|
1374
|
+
"`--format json` and `--json` print `{ file_path, content, total_lines, offset, limit, truncated }`."
|
|
1375
|
+
]
|
|
1376
|
+
},
|
|
1377
|
+
{
|
|
1378
|
+
kind: "section",
|
|
1379
|
+
title: "Example"
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
kind: "code",
|
|
1383
|
+
language: "bash",
|
|
1384
|
+
lines: [
|
|
1385
|
+
"npx --yes cngkit@latest knowledges read /libraries/lib-cloudflare/TOPIC.md --limit 80"
|
|
1386
|
+
]
|
|
1387
|
+
}
|
|
1388
|
+
]
|
|
1389
|
+
},
|
|
1390
|
+
{
|
|
1391
|
+
title: "knowledges grep",
|
|
1392
|
+
aliases: ["knowledges-grep", "grep"],
|
|
1393
|
+
heading: "cngkit knowledges grep",
|
|
1394
|
+
blocks: [
|
|
1395
|
+
{
|
|
1396
|
+
kind: "paragraph",
|
|
1397
|
+
text: "Search inside hosted Harness catalog files with a JavaScript regular expression."
|
|
1398
|
+
},
|
|
1399
|
+
{
|
|
1400
|
+
kind: "section",
|
|
1401
|
+
title: "Usage"
|
|
1402
|
+
},
|
|
1403
|
+
{
|
|
1404
|
+
kind: "code",
|
|
1405
|
+
language: "bash",
|
|
1406
|
+
lines: [
|
|
1407
|
+
"cngkit knowledges grep <pattern> [--path <path>] [--include <glob>] [--output-mode <mode>] [--context <n>] [--case-insensitive] [--json|--format json]"
|
|
1408
|
+
]
|
|
1409
|
+
},
|
|
1410
|
+
{
|
|
1411
|
+
kind: "section",
|
|
1412
|
+
title: "Inputs"
|
|
1413
|
+
},
|
|
1414
|
+
{
|
|
1415
|
+
kind: "list",
|
|
1416
|
+
items: [
|
|
1417
|
+
"`pattern`: JavaScript regular expression source.",
|
|
1418
|
+
"`--path`: topics-root path prefix. Default: `/`.",
|
|
1419
|
+
"`--include`: filename include filter. Default: `*`.",
|
|
1420
|
+
"Modes: content, files_with_matches, or count.",
|
|
1421
|
+
"`--output-mode`: `content`, `files_with_matches`, or `count`. Default: `content`.",
|
|
1422
|
+
"`--context`: context lines around content matches. Default: `0`. Backend max: `20`.",
|
|
1423
|
+
"`--case-insensitive`: maps to backend `case_insensitive=true`."
|
|
1424
|
+
]
|
|
1425
|
+
},
|
|
1426
|
+
{
|
|
1427
|
+
kind: "section",
|
|
1428
|
+
title: "Output"
|
|
1429
|
+
},
|
|
1430
|
+
{
|
|
1431
|
+
kind: "list",
|
|
1432
|
+
items: [
|
|
1433
|
+
"`content`: prints blocks as `file_path:line_number`, optional context lines, then `> matching line`.",
|
|
1434
|
+
"`files_with_matches`: prints one matching file path per line.",
|
|
1435
|
+
"`count`: prints `file_path: match_count` lines.",
|
|
1436
|
+
"`--format json` and `--json` print the typed backend response union."
|
|
1437
|
+
]
|
|
1438
|
+
},
|
|
1439
|
+
{
|
|
1440
|
+
kind: "section",
|
|
1441
|
+
title: "Examples"
|
|
1442
|
+
},
|
|
1443
|
+
{
|
|
1444
|
+
kind: "code",
|
|
1445
|
+
language: "bash",
|
|
1446
|
+
lines: [
|
|
1447
|
+
"npx --yes cngkit@latest knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches",
|
|
1448
|
+
'npx --yes cngkit@latest knowledges grep "Postgres|Hyperdrive" --path /libraries/lib-cloudflare --context 2'
|
|
1449
|
+
]
|
|
1450
|
+
}
|
|
1451
|
+
]
|
|
1452
|
+
},
|
|
1453
|
+
{
|
|
1454
|
+
title: "knowledges glob",
|
|
1455
|
+
aliases: ["knowledges-glob", "glob"],
|
|
1456
|
+
heading: "cngkit knowledges glob",
|
|
1457
|
+
blocks: [
|
|
1458
|
+
{
|
|
1459
|
+
kind: "paragraph",
|
|
1460
|
+
text: "Find hosted Harness catalog files by glob pattern."
|
|
1461
|
+
},
|
|
1462
|
+
{
|
|
1463
|
+
kind: "section",
|
|
1464
|
+
title: "Usage"
|
|
1465
|
+
},
|
|
1466
|
+
{
|
|
1467
|
+
kind: "code",
|
|
1468
|
+
language: "bash",
|
|
1469
|
+
lines: ["cngkit knowledges glob [pattern] [--path <path>] [--json|--format json]"]
|
|
1470
|
+
},
|
|
1471
|
+
{
|
|
1472
|
+
kind: "section",
|
|
1473
|
+
title: "Inputs"
|
|
1474
|
+
},
|
|
1475
|
+
{
|
|
1476
|
+
kind: "list",
|
|
1477
|
+
items: [
|
|
1478
|
+
"`pattern`: supported glob pattern. CLI default: `**/*.md`.",
|
|
1479
|
+
"`--path`: topics-root path prefix. Default: `/`."
|
|
1480
|
+
]
|
|
1481
|
+
},
|
|
1482
|
+
{
|
|
1483
|
+
kind: "section",
|
|
1484
|
+
title: "Supported Patterns"
|
|
1485
|
+
},
|
|
1486
|
+
{
|
|
1487
|
+
kind: "list",
|
|
1488
|
+
items: [
|
|
1489
|
+
"`**/*.md`",
|
|
1490
|
+
"`**/TOPIC.md`",
|
|
1491
|
+
"`**/*.TOPIC.md`",
|
|
1492
|
+
"`**/SKILL.md`",
|
|
1493
|
+
"`*.md`",
|
|
1494
|
+
"`TOPIC.md`",
|
|
1495
|
+
"`*.TOPIC.md`",
|
|
1496
|
+
"`SKILL.md`"
|
|
1497
|
+
]
|
|
1498
|
+
},
|
|
1499
|
+
{
|
|
1500
|
+
kind: "section",
|
|
1501
|
+
title: "Output"
|
|
1502
|
+
},
|
|
1503
|
+
{
|
|
1504
|
+
kind: "list",
|
|
1505
|
+
items: [
|
|
1506
|
+
"Text mode prints one file path per line.",
|
|
1507
|
+
"If truncated, a final bracketed truncation note is printed.",
|
|
1508
|
+
"`--format json` and `--json` print `{ files, total_files, truncated }`."
|
|
1509
|
+
]
|
|
1510
|
+
},
|
|
1511
|
+
{
|
|
1512
|
+
kind: "section",
|
|
1513
|
+
title: "Example"
|
|
1514
|
+
},
|
|
1515
|
+
{
|
|
1516
|
+
kind: "code",
|
|
1517
|
+
language: "bash",
|
|
1518
|
+
lines: [
|
|
1519
|
+
'npx --yes cngkit@latest knowledges glob "**/*.md" --path /libraries/lib-cloudflare'
|
|
1520
|
+
]
|
|
1521
|
+
}
|
|
1522
|
+
]
|
|
1523
|
+
}
|
|
1524
|
+
];
|
|
1525
|
+
|
|
1526
|
+
// src/cli/help-specs.ts
|
|
1527
|
+
var helpTopicNames = helpTopicDocuments.filter((topic) => topic.title !== "cngkit").map((topic) => topic.title).sort();
|
|
1528
|
+
var helpTopicByAlias = /* @__PURE__ */ new Map();
|
|
1529
|
+
for (const topic of helpTopicDocuments) {
|
|
1530
|
+
for (const alias of topic.aliases) {
|
|
1531
|
+
helpTopicByAlias.set(alias, topic);
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
function renderCngkitHelp(topicName) {
|
|
1535
|
+
const normalizedTopicName = normalizeHelpTopicName(topicName);
|
|
1536
|
+
const topic = helpTopicByAlias.get(normalizedTopicName);
|
|
1537
|
+
if (topic) {
|
|
1538
|
+
return createElement(HelpDocument, { document: topic });
|
|
1539
|
+
}
|
|
1540
|
+
if (normalizedTopicName === "") {
|
|
1541
|
+
const defaultTopic = helpTopicByAlias.get("");
|
|
1542
|
+
if (defaultTopic) {
|
|
1543
|
+
return createElement(HelpDocument, { document: defaultTopic });
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
return createElement(HelpDocument, {
|
|
1547
|
+
document: {
|
|
1548
|
+
title: "cngkit help",
|
|
1549
|
+
aliases: [],
|
|
1550
|
+
heading: "cngkit help",
|
|
1551
|
+
blocks: [
|
|
1552
|
+
{
|
|
1553
|
+
kind: "paragraph",
|
|
1554
|
+
text: `No help topic named ${normalizedTopicName}.`
|
|
1555
|
+
},
|
|
1556
|
+
{
|
|
1557
|
+
kind: "section",
|
|
1558
|
+
title: "Available Topics"
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
kind: "list",
|
|
1562
|
+
items: helpTopicNames
|
|
1563
|
+
},
|
|
1564
|
+
{
|
|
1565
|
+
kind: "section",
|
|
1566
|
+
title: "Usage"
|
|
1567
|
+
},
|
|
1568
|
+
{
|
|
1569
|
+
kind: "code",
|
|
1570
|
+
language: "bash",
|
|
1571
|
+
lines: ["cngkit help <topic>", "cngkit <command> --help"]
|
|
1572
|
+
}
|
|
1573
|
+
]
|
|
1574
|
+
}
|
|
1575
|
+
});
|
|
1576
|
+
}
|
|
1577
|
+
function renderKnowledgesHelp(topicName) {
|
|
1578
|
+
const normalizedTopicName = normalizeHelpTopicName(topicName);
|
|
1579
|
+
const topicKey = normalizedTopicName ? `knowledges-${normalizedTopicName}` : "knowledges";
|
|
1580
|
+
return renderCngkitHelp(topicKey);
|
|
1581
|
+
}
|
|
1582
|
+
function normalizeHelpTopicName(value) {
|
|
1583
|
+
return value?.trim().toLowerCase().replace(/\s+/g, "-") ?? "";
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
export {
|
|
1587
|
+
renderCngkitHelp,
|
|
1588
|
+
renderKnowledgesHelp
|
|
1589
|
+
};
|
|
1590
|
+
//# sourceMappingURL=chunk-SKK2XLRZ.js.map
|