cngkit 1.1.17 → 1.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -7
- package/dist/chunk-3A6GRNEV.js +1590 -0
- package/dist/chunk-3A6GRNEV.js.map +1 -0
- package/dist/{chunk-HRFI2IEP.js → chunk-7SO75QXJ.js} +886 -68
- package/dist/chunk-7SO75QXJ.js.map +1 -0
- package/dist/chunk-DBA3BZXP.js +231 -0
- package/dist/chunk-DBA3BZXP.js.map +1 -0
- package/dist/{chunk-5ZNV3FDG.js → chunk-GBONV6XP.js} +16 -4
- package/dist/chunk-GBONV6XP.js.map +1 -0
- package/dist/chunk-L6ZVQRSY.js +569 -0
- package/dist/chunk-L6ZVQRSY.js.map +1 -0
- package/dist/{chunk-VCWNKNUE.js → chunk-NGEWD4BW.js} +10 -1
- package/dist/chunk-NGEWD4BW.js.map +1 -0
- package/dist/chunk-TYDIBWZV.js +35 -0
- package/dist/chunk-TYDIBWZV.js.map +1 -0
- package/dist/{chunk-GT2MTS6E.js → chunk-X4E7NAN4.js} +2 -2
- package/dist/cli.js +82 -16
- 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 +25 -0
- package/dist/commands/hookify/index.js.map +1 -0
- package/dist/commands/hookify/ingest.js +127 -0
- package/dist/commands/hookify/ingest.js.map +1 -0
- 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 +40 -0
- package/dist/commands/knowledges/ls.js.map +1 -0
- 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 +3 -3
- package/dist/commands/scrub.js +3 -3
- package/dist/commands/transcripts.js +6 -6
- package/dist/commands/transcripts.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-5ZNV3FDG.js.map +0 -1
- package/dist/chunk-BL3XMLIH.js +0 -573
- package/dist/chunk-BL3XMLIH.js.map +0 -1
- package/dist/chunk-HRFI2IEP.js.map +0 -1
- package/dist/chunk-K36DKQWH.js +0 -327
- package/dist/chunk-K36DKQWH.js.map +0 -1
- package/dist/chunk-VCWNKNUE.js.map +0 -1
- package/dist/chunk-WYJTGGMN.js +0 -222
- package/dist/chunk-WYJTGGMN.js.map +0 -1
- /package/dist/{chunk-GT2MTS6E.js.map → chunk-X4E7NAN4.js.map} +0 -0
package/dist/chunk-BL3XMLIH.js
DELETED
|
@@ -1,573 +0,0 @@
|
|
|
1
|
-
// src/cli/help-specs.ts
|
|
2
|
-
var commandList = [
|
|
3
|
-
"- `cngkit login` - open Curly.ng login, or print the URL in headless shells.",
|
|
4
|
-
"- `cngkit coderoom ...` - share or join a live developer room for a working tree.",
|
|
5
|
-
"- `cngkit scrub [path]` - scan for secrets; rewrite only when `--yes` is passed.",
|
|
6
|
-
"- `cngkit transcripts ...` - list, read, and grep local Claude/Codex transcripts.",
|
|
7
|
-
"- `cngkit knowledges ...` - search and read the hosted Harness knowledge catalog."
|
|
8
|
-
].join("\n");
|
|
9
|
-
var coderoomCommandList = [
|
|
10
|
-
"- `share [room-code]` - start a live room from the current directory.",
|
|
11
|
-
"- `join <room-code>` - join another developer's live room from the current directory."
|
|
12
|
-
].join("\n");
|
|
13
|
-
var knowledgesCommandList = [
|
|
14
|
-
"- `status` - print remote catalog state.",
|
|
15
|
-
"- `audiences` - list valid audience filters.",
|
|
16
|
-
"- `search <query>` - search over Postgres-backed knowledges records.",
|
|
17
|
-
"- `list [query]` - list known subskills.",
|
|
18
|
-
"- `files [query]` - list uploaded catalog files.",
|
|
19
|
-
"- `read <file-path>` - Claude-style file read.",
|
|
20
|
-
"- `grep <pattern>` - Claude-style content search.",
|
|
21
|
-
"- `glob [pattern]` - Claude-style file discovery."
|
|
22
|
-
].join("\n");
|
|
23
|
-
var helpTopics = [
|
|
24
|
-
{
|
|
25
|
-
title: "cngkit",
|
|
26
|
-
aliases: ["", "overview", "help"],
|
|
27
|
-
body: `# cngkit
|
|
28
|
-
|
|
29
|
-
Curly.ng operator CLI for shared code rooms, safe local cleanup, local agent transcripts, and hosted Harness knowledges.
|
|
30
|
-
|
|
31
|
-
## Run Now
|
|
32
|
-
|
|
33
|
-
\`\`\`bash
|
|
34
|
-
npx --yes cngkit@latest --help
|
|
35
|
-
npx --yes cngkit@latest knowledges search Cloudflare --limit 3
|
|
36
|
-
\`\`\`
|
|
37
|
-
|
|
38
|
-
## Installed Usage
|
|
39
|
-
|
|
40
|
-
\`\`\`bash
|
|
41
|
-
cngkit <command> [options]
|
|
42
|
-
\`\`\`
|
|
43
|
-
|
|
44
|
-
## Global Options
|
|
45
|
-
|
|
46
|
-
\`\`\`bash
|
|
47
|
-
cngkit --format text|json|markdown ...
|
|
48
|
-
cngkit --no-color ...
|
|
49
|
-
\`\`\`
|
|
50
|
-
|
|
51
|
-
## Commands
|
|
52
|
-
|
|
53
|
-
${commandList}
|
|
54
|
-
|
|
55
|
-
## Help Map
|
|
56
|
-
|
|
57
|
-
\`\`\`bash
|
|
58
|
-
cngkit help <topic>
|
|
59
|
-
cngkit <command> --help
|
|
60
|
-
cngkit coderoom --help
|
|
61
|
-
cngkit coderoom <subcommand> --help
|
|
62
|
-
cngkit transcripts --help
|
|
63
|
-
cngkit knowledges --help
|
|
64
|
-
cngkit knowledges <subcommand> --help
|
|
65
|
-
\`\`\`
|
|
66
|
-
|
|
67
|
-
## AI And Scripts
|
|
68
|
-
|
|
69
|
-
- Help renders as structured terminal text by default, even in pipes.
|
|
70
|
-
- Use \`--format json\` or \`--json\` on read-only data commands for typed payloads.
|
|
71
|
-
- Use \`--format markdown\` only when raw Markdown source is intentional.
|
|
72
|
-
- Use \`--no-color\` or \`CNGKIT_COLOR=never\` for logs, screenshots, and strict plain text.
|
|
73
|
-
- Use \`npm_config_progress=false npx --yes cngkit@latest ...\` for clean one-shot npx captures.
|
|
74
|
-
|
|
75
|
-
## Backend
|
|
76
|
-
|
|
77
|
-
API: \`https://curly.ng\`
|
|
78
|
-
`
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
title: "login",
|
|
82
|
-
aliases: ["login"],
|
|
83
|
-
body: `# cngkit login
|
|
84
|
-
|
|
85
|
-
Open Curly.ng login in a browser. In headless shells, print the URL so an agent can show it to the operator.
|
|
86
|
-
|
|
87
|
-
## Usage
|
|
88
|
-
|
|
89
|
-
\`\`\`bash
|
|
90
|
-
npx --yes cngkit@latest login
|
|
91
|
-
cngkit login
|
|
92
|
-
\`\`\`
|
|
93
|
-
|
|
94
|
-
## Output
|
|
95
|
-
|
|
96
|
-
- First line names the login URL being opened.
|
|
97
|
-
- If no browser opener exists, the CLI prints a direct URL.
|
|
98
|
-
- No credentials are printed or persisted by this command.
|
|
99
|
-
`
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
title: "transcripts",
|
|
103
|
-
aliases: ["transcripts", "transcript"],
|
|
104
|
-
body: `# cngkit transcripts
|
|
105
|
-
|
|
106
|
-
Read local Claude and Codex transcript JSONL files.
|
|
107
|
-
|
|
108
|
-
This is local-only operator tooling. It does not call Curly.ng and it does not upload transcript content.
|
|
109
|
-
|
|
110
|
-
## Usage
|
|
111
|
-
|
|
112
|
-
\`\`\`bash
|
|
113
|
-
cngkit transcripts list [--source all|codex|claude] [--limit <n>] [--json|--format json]
|
|
114
|
-
cngkit transcripts read <path-or-session-id> [--source all|codex|claude] [--limit <n>] [--include-internal] [--json|--format json]
|
|
115
|
-
cngkit transcripts grep <query> [--source all|codex|claude] [--limit <n>] [--file-limit <n>] [--include-internal] [--json|--format json]
|
|
116
|
-
\`\`\`
|
|
117
|
-
|
|
118
|
-
## Sources
|
|
119
|
-
|
|
120
|
-
- \`~/.codex/sessions\`
|
|
121
|
-
- \`~/.codex/archived_sessions\`
|
|
122
|
-
- \`~/.claude/projects\`
|
|
123
|
-
- \`~/.claude/history.jsonl\`
|
|
124
|
-
|
|
125
|
-
## Defaults
|
|
126
|
-
|
|
127
|
-
- \`list\`: newest 12 transcript files.
|
|
128
|
-
- \`read\`: newest 80 user/assistant entries from the selected file.
|
|
129
|
-
- \`grep\`: first 80 matching user/assistant entries from the newest 60 files.
|
|
130
|
-
- \`--source\`: \`all\`.
|
|
131
|
-
|
|
132
|
-
## Output
|
|
133
|
-
|
|
134
|
-
- Text mode prints source, role, timestamp when available, and extracted message text.
|
|
135
|
-
- Internal developer/system payloads and hook/tool noise are skipped unless \`--include-internal\` is passed.
|
|
136
|
-
- Direct file paths, home-relative paths, and partial session ids are accepted by \`read\`.
|
|
137
|
-
`
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
title: "coderoom",
|
|
141
|
-
aliases: ["coderoom", "code-room", "repo-sync"],
|
|
142
|
-
body: `# cngkit coderoom
|
|
143
|
-
|
|
144
|
-
Create or join a temporary live room for sharing a working tree over the Curly backend.
|
|
145
|
-
|
|
146
|
-
## Usage
|
|
147
|
-
|
|
148
|
-
\`\`\`bash
|
|
149
|
-
cngkit coderoom <subcommand> [options]
|
|
150
|
-
\`\`\`
|
|
151
|
-
|
|
152
|
-
## Subcommands
|
|
153
|
-
|
|
154
|
-
${coderoomCommandList}
|
|
155
|
-
|
|
156
|
-
## Common Flow
|
|
157
|
-
|
|
158
|
-
\`\`\`bash
|
|
159
|
-
npx --yes cngkit@latest coderoom share
|
|
160
|
-
npx --yes cngkit@latest coderoom join <room-code>
|
|
161
|
-
\`\`\`
|
|
162
|
-
|
|
163
|
-
## Behavior
|
|
164
|
-
|
|
165
|
-
- Connects to \`/api/cng/sync/:roomCode\` on the configured Curly backend.
|
|
166
|
-
- Uses WebSocket transport backed by the \`CngSyncRoom\` Durable Object.
|
|
167
|
-
- Sends an initial snapshot, then file and delete events.
|
|
168
|
-
- Last received change wins.
|
|
169
|
-
- Current rooms are live relays, not durable cloud storage.
|
|
170
|
-
`
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
title: "coderoom share",
|
|
174
|
-
aliases: ["coderoom-share"],
|
|
175
|
-
body: `# cngkit coderoom share
|
|
176
|
-
|
|
177
|
-
Start a live repository sync room from the current directory.
|
|
178
|
-
|
|
179
|
-
## Usage
|
|
180
|
-
|
|
181
|
-
\`\`\`bash
|
|
182
|
-
cngkit coderoom share [room-code]
|
|
183
|
-
\`\`\`
|
|
184
|
-
|
|
185
|
-
## Behavior
|
|
186
|
-
|
|
187
|
-
- Connects to \`/api/cng/sync/:roomCode\` on the configured Curly backend.
|
|
188
|
-
- Uses WebSocket transport backed by the \`CngSyncRoom\` Durable Object.
|
|
189
|
-
- Sends an initial snapshot, then file and delete events.
|
|
190
|
-
- Last received change wins.
|
|
191
|
-
|
|
192
|
-
## Filesystem Contract
|
|
193
|
-
|
|
194
|
-
- Preserves \`.git/\`.
|
|
195
|
-
- Preserves files ignored by the repo's \`.gitignore\`.
|
|
196
|
-
- Sends regular files as base64 payloads in the sync protocol.
|
|
197
|
-
|
|
198
|
-
## Output
|
|
199
|
-
|
|
200
|
-
- Prints room code, repo root, peer id, backend health, and concise sync events.
|
|
201
|
-
- Keeps running until the socket closes or the process receives a termination signal.
|
|
202
|
-
`
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
title: "coderoom join",
|
|
206
|
-
aliases: ["coderoom-join"],
|
|
207
|
-
body: `# cngkit coderoom join
|
|
208
|
-
|
|
209
|
-
Join an existing live repository sync room from the current directory.
|
|
210
|
-
|
|
211
|
-
## Usage
|
|
212
|
-
|
|
213
|
-
\`\`\`bash
|
|
214
|
-
cngkit coderoom join <room-code>
|
|
215
|
-
\`\`\`
|
|
216
|
-
|
|
217
|
-
## Behavior
|
|
218
|
-
|
|
219
|
-
Same transport and filesystem contract as \`cngkit coderoom share\`. The supplied room code selects the Durable Object room.
|
|
220
|
-
|
|
221
|
-
## Output
|
|
222
|
-
|
|
223
|
-
- Prints backend health, room code, repo root, peer id, and concise sync events.
|
|
224
|
-
- Missing room code exits with a usage error.
|
|
225
|
-
`
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
title: "scrub",
|
|
229
|
-
aliases: ["scrub"],
|
|
230
|
-
body: `# cngkit scrub
|
|
231
|
-
|
|
232
|
-
Scan a file or directory for secrets with TruffleHog. Report-only is the default.
|
|
233
|
-
|
|
234
|
-
## Usage
|
|
235
|
-
|
|
236
|
-
\`\`\`bash
|
|
237
|
-
cngkit scrub [path]
|
|
238
|
-
cngkit scrub [path] --yes
|
|
239
|
-
\`\`\`
|
|
240
|
-
|
|
241
|
-
## Safety
|
|
242
|
-
|
|
243
|
-
- Default mode does not rewrite files.
|
|
244
|
-
- Inline masking rewrites files and requires \`--yes\`.
|
|
245
|
-
- Raw and redacted secret values are never printed.
|
|
246
|
-
|
|
247
|
-
## Requirements
|
|
248
|
-
|
|
249
|
-
- \`trufflehog\` must be available on \`PATH\`.
|
|
250
|
-
|
|
251
|
-
## Mask Format
|
|
252
|
-
|
|
253
|
-
\`\`\`text
|
|
254
|
-
[CNGKIT_SECRET:<detector>:<verified|unverified>]
|
|
255
|
-
\`\`\`
|
|
256
|
-
`
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
title: "knowledges",
|
|
260
|
-
aliases: ["knowledges", "knowledge"],
|
|
261
|
-
body: `# cngkit knowledges
|
|
262
|
-
|
|
263
|
-
Search and read the hosted Harness knowledges catalog from the Curly backend.
|
|
264
|
-
|
|
265
|
-
## Usage
|
|
266
|
-
|
|
267
|
-
\`\`\`bash
|
|
268
|
-
cngkit knowledges <subcommand> [options]
|
|
269
|
-
\`\`\`
|
|
270
|
-
|
|
271
|
-
## Subcommands
|
|
272
|
-
|
|
273
|
-
${knowledgesCommandList}
|
|
274
|
-
|
|
275
|
-
## Progressive Help
|
|
276
|
-
|
|
277
|
-
\`\`\`bash
|
|
278
|
-
cngkit help knowledges <subcommand>
|
|
279
|
-
cngkit knowledges <subcommand> --help
|
|
280
|
-
cngkit knowledges read --help
|
|
281
|
-
cngkit knowledges grep --help
|
|
282
|
-
cngkit knowledges glob --help
|
|
283
|
-
\`\`\`
|
|
284
|
-
|
|
285
|
-
## Common Examples
|
|
286
|
-
|
|
287
|
-
\`\`\`bash
|
|
288
|
-
npx --yes cngkit@latest knowledges search Cloudflare --limit 3
|
|
289
|
-
npx --yes cngkit@latest knowledges read /libraries/lib-cloudflare/SUBSKILL.md --limit 80
|
|
290
|
-
npx --yes cngkit@latest knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches
|
|
291
|
-
npx --yes cngkit@latest knowledges glob "**/*.md" --path /libraries/lib-cloudflare
|
|
292
|
-
\`\`\`
|
|
293
|
-
|
|
294
|
-
## AI-Friendly Output
|
|
295
|
-
|
|
296
|
-
- Default output is structured text intended to be directly usable by people and agents.
|
|
297
|
-
- \`read\` renders Markdown files by default and prints exact source with \`--format markdown\`.
|
|
298
|
-
- \`grep --output-mode content\` prints \`path:line\` blocks.
|
|
299
|
-
- \`grep --output-mode files_with_matches\` and \`glob\` print one path per line.
|
|
300
|
-
- \`--format json\` and \`--json\` print typed backend payloads for machine consumption.
|
|
301
|
-
`
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
title: "knowledges status",
|
|
305
|
-
aliases: ["knowledges-status", "status"],
|
|
306
|
-
body: `# cngkit knowledges status
|
|
307
|
-
|
|
308
|
-
Print remote Harness catalog state.
|
|
309
|
-
|
|
310
|
-
## Usage
|
|
311
|
-
|
|
312
|
-
\`\`\`bash
|
|
313
|
-
cngkit knowledges status [--json|--format json]
|
|
314
|
-
\`\`\`
|
|
315
|
-
|
|
316
|
-
## Output
|
|
317
|
-
|
|
318
|
-
- Text mode prints catalog name, file count, blob count, database binding, and latest run when present.
|
|
319
|
-
- \`--format json\` and \`--json\` print the backend data payload.
|
|
320
|
-
`
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
title: "knowledges audiences",
|
|
324
|
-
aliases: ["knowledges-audiences", "audiences"],
|
|
325
|
-
body: `# cngkit knowledges audiences
|
|
326
|
-
|
|
327
|
-
List valid audience filters for catalog browsing.
|
|
328
|
-
|
|
329
|
-
## Usage
|
|
330
|
-
|
|
331
|
-
\`\`\`bash
|
|
332
|
-
cngkit knowledges audiences [--json|--format json]
|
|
333
|
-
\`\`\`
|
|
334
|
-
|
|
335
|
-
## Use When
|
|
336
|
-
|
|
337
|
-
Run this before \`cngkit knowledges files --audience <id>\`.
|
|
338
|
-
`
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
title: "knowledges search",
|
|
342
|
-
aliases: ["knowledges-search", "search"],
|
|
343
|
-
body: `# cngkit knowledges search
|
|
344
|
-
|
|
345
|
-
Search the hosted Harness index for relevant skills and subskills.
|
|
346
|
-
|
|
347
|
-
## Usage
|
|
348
|
-
|
|
349
|
-
\`\`\`bash
|
|
350
|
-
cngkit knowledges search <query> [--limit <n>] [--json|--format json]
|
|
351
|
-
\`\`\`
|
|
352
|
-
|
|
353
|
-
## Defaults
|
|
354
|
-
|
|
355
|
-
- \`--limit\`: \`5\`
|
|
356
|
-
|
|
357
|
-
## Example
|
|
358
|
-
|
|
359
|
-
\`\`\`bash
|
|
360
|
-
npx --yes cngkit@latest knowledges search Cloudflare --limit 3
|
|
361
|
-
\`\`\`
|
|
362
|
-
`
|
|
363
|
-
},
|
|
364
|
-
{
|
|
365
|
-
title: "knowledges list",
|
|
366
|
-
aliases: ["knowledges-list", "list"],
|
|
367
|
-
body: `# cngkit knowledges list
|
|
368
|
-
|
|
369
|
-
List hosted Harness subskills, optionally filtered by query.
|
|
370
|
-
|
|
371
|
-
## Usage
|
|
372
|
-
|
|
373
|
-
\`\`\`bash
|
|
374
|
-
cngkit knowledges list [query] [--limit <n>] [--json|--format json]
|
|
375
|
-
\`\`\`
|
|
376
|
-
|
|
377
|
-
## Defaults
|
|
378
|
-
|
|
379
|
-
- \`--limit\`: \`25\`
|
|
380
|
-
|
|
381
|
-
## Example
|
|
382
|
-
|
|
383
|
-
\`\`\`bash
|
|
384
|
-
cngkit knowledges list cloudflare --limit 10
|
|
385
|
-
\`\`\`
|
|
386
|
-
`
|
|
387
|
-
},
|
|
388
|
-
{
|
|
389
|
-
title: "knowledges files",
|
|
390
|
-
aliases: ["knowledges-files", "files"],
|
|
391
|
-
body: `# cngkit knowledges files
|
|
392
|
-
|
|
393
|
-
List uploaded Harness catalog files, optionally filtered by query or audience.
|
|
394
|
-
|
|
395
|
-
## Usage
|
|
396
|
-
|
|
397
|
-
\`\`\`bash
|
|
398
|
-
cngkit knowledges files [query] [--audience <id>] [--limit <n>] [--json|--format json]
|
|
399
|
-
\`\`\`
|
|
400
|
-
|
|
401
|
-
## Defaults
|
|
402
|
-
|
|
403
|
-
- \`--limit\`: \`25\`
|
|
404
|
-
- \`--audience\`: omitted
|
|
405
|
-
|
|
406
|
-
## Example
|
|
407
|
-
|
|
408
|
-
\`\`\`bash
|
|
409
|
-
cngkit knowledges files cloudflare --limit 10
|
|
410
|
-
cngkit knowledges files "vector search" --audience builders
|
|
411
|
-
\`\`\`
|
|
412
|
-
`
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
title: "knowledges read",
|
|
416
|
-
aliases: ["knowledges-read", "read"],
|
|
417
|
-
body: `# cngkit knowledges read
|
|
418
|
-
|
|
419
|
-
Read a hosted Harness catalog file by path.
|
|
420
|
-
|
|
421
|
-
## Usage
|
|
422
|
-
|
|
423
|
-
\`\`\`bash
|
|
424
|
-
cngkit knowledges read <file-path> [--offset <n>] [--limit <n>] [--json|--format json|--format markdown]
|
|
425
|
-
\`\`\`
|
|
426
|
-
|
|
427
|
-
## Inputs
|
|
428
|
-
|
|
429
|
-
- \`file-path\`: normalized catalog path. Shorthand paths such as \`/libraries/lib-cloudflare/SUBSKILL.md\` are expanded to \`skills/knowledges/subskills/libraries/lib-cloudflare/SUBSKILL.md\`.
|
|
430
|
-
- \`--offset\`: zero-based starting line. Default: \`0\`.
|
|
431
|
-
- \`--limit\`: maximum lines. Default in CLI: \`200\`. Backend max: \`2000\`.
|
|
432
|
-
|
|
433
|
-
## Output
|
|
434
|
-
|
|
435
|
-
- Text mode renders Markdown files for terminal reading.
|
|
436
|
-
- \`--format markdown\` prints the exact returned file content.
|
|
437
|
-
- If truncated, a final bracketed truncation note is printed after the content.
|
|
438
|
-
- \`--format json\` and \`--json\` print \`{ file_path, content, total_lines, offset, limit, truncated }\`.
|
|
439
|
-
|
|
440
|
-
## Example
|
|
441
|
-
|
|
442
|
-
\`\`\`bash
|
|
443
|
-
npx --yes cngkit@latest knowledges read /libraries/lib-cloudflare/SUBSKILL.md --limit 80
|
|
444
|
-
\`\`\`
|
|
445
|
-
`
|
|
446
|
-
},
|
|
447
|
-
{
|
|
448
|
-
title: "knowledges grep",
|
|
449
|
-
aliases: ["knowledges-grep", "grep"],
|
|
450
|
-
body: `# cngkit knowledges grep
|
|
451
|
-
|
|
452
|
-
Search inside hosted Harness catalog files with a JavaScript regular expression.
|
|
453
|
-
|
|
454
|
-
## Usage
|
|
455
|
-
|
|
456
|
-
\`\`\`bash
|
|
457
|
-
cngkit knowledges grep <pattern> [--path <path>] [--include <glob>] [--output-mode <mode>] [--context <n>] [--case-insensitive] [--json|--format json]
|
|
458
|
-
\`\`\`
|
|
459
|
-
|
|
460
|
-
## Inputs
|
|
461
|
-
|
|
462
|
-
- \`pattern\`: JavaScript regular expression source.
|
|
463
|
-
- \`--path\`: catalog path prefix. Default: \`skills\`.
|
|
464
|
-
- \`--include\`: filename include filter. Default: \`*\`.
|
|
465
|
-
- Modes: content, files_with_matches, or count.
|
|
466
|
-
- \`--output-mode\`: \`content\`, \`files_with_matches\`, or \`count\`. Default: \`content\`.
|
|
467
|
-
- \`--context\`: context lines around content matches. Default: \`0\`. Backend max: \`20\`.
|
|
468
|
-
- \`--case-insensitive\`: maps to backend \`case_insensitive=true\`.
|
|
469
|
-
|
|
470
|
-
## Output
|
|
471
|
-
|
|
472
|
-
- \`content\`: prints blocks as \`file_path:line_number\`, optional context lines, then \`> matching line\`.
|
|
473
|
-
- \`files_with_matches\`: prints one matching file path per line.
|
|
474
|
-
- \`count\`: prints \`file_path: match_count\` lines.
|
|
475
|
-
- \`--format json\` and \`--json\` print the typed backend response union.
|
|
476
|
-
|
|
477
|
-
## Examples
|
|
478
|
-
|
|
479
|
-
\`\`\`bash
|
|
480
|
-
npx --yes cngkit@latest knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches
|
|
481
|
-
npx --yes cngkit@latest knowledges grep "Postgres|Hyperdrive" --path /libraries/lib-cloudflare --context 2
|
|
482
|
-
\`\`\`
|
|
483
|
-
`
|
|
484
|
-
},
|
|
485
|
-
{
|
|
486
|
-
title: "knowledges glob",
|
|
487
|
-
aliases: ["knowledges-glob", "glob"],
|
|
488
|
-
body: `# cngkit knowledges glob
|
|
489
|
-
|
|
490
|
-
Find hosted Harness catalog files by glob pattern.
|
|
491
|
-
|
|
492
|
-
## Usage
|
|
493
|
-
|
|
494
|
-
\`\`\`bash
|
|
495
|
-
cngkit knowledges glob [pattern] [--path <path>] [--json|--format json]
|
|
496
|
-
\`\`\`
|
|
497
|
-
|
|
498
|
-
## Inputs
|
|
499
|
-
|
|
500
|
-
- \`pattern\`: supported glob pattern. CLI default: \`**/*.md\`.
|
|
501
|
-
- \`--path\`: catalog path prefix. Default: \`skills\`.
|
|
502
|
-
|
|
503
|
-
## Supported Patterns
|
|
504
|
-
|
|
505
|
-
- \`**/*.md\`
|
|
506
|
-
- \`**/*.SUBSKILL.md\`
|
|
507
|
-
- \`**/SKILL.md\`
|
|
508
|
-
- \`*.md\`
|
|
509
|
-
- \`*.SUBSKILL.md\`
|
|
510
|
-
- \`SKILL.md\`
|
|
511
|
-
|
|
512
|
-
## Output
|
|
513
|
-
|
|
514
|
-
- Text mode prints one file path per line.
|
|
515
|
-
- If truncated, a final bracketed truncation note is printed.
|
|
516
|
-
- \`--format json\` and \`--json\` print \`{ files, total_files, truncated }\`.
|
|
517
|
-
|
|
518
|
-
## Example
|
|
519
|
-
|
|
520
|
-
\`\`\`bash
|
|
521
|
-
npx --yes cngkit@latest knowledges glob "**/*.md" --path /libraries/lib-cloudflare
|
|
522
|
-
\`\`\`
|
|
523
|
-
`
|
|
524
|
-
}
|
|
525
|
-
];
|
|
526
|
-
var helpTopicNames = helpTopics.filter((topic) => topic.title !== "cngkit").map((topic) => topic.title).sort();
|
|
527
|
-
var helpTopicByAlias = /* @__PURE__ */ new Map();
|
|
528
|
-
for (const topic of helpTopics) {
|
|
529
|
-
for (const alias of topic.aliases) {
|
|
530
|
-
helpTopicByAlias.set(alias, topic);
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
function formatCngkitHelp(topicName) {
|
|
534
|
-
const normalizedTopicName = normalizeHelpTopicName(topicName);
|
|
535
|
-
const topic = helpTopicByAlias.get(normalizedTopicName);
|
|
536
|
-
if (topic) {
|
|
537
|
-
return topic.body.trim();
|
|
538
|
-
}
|
|
539
|
-
if (normalizedTopicName === "") {
|
|
540
|
-
return helpTopicByAlias.get("")?.body.trim() ?? "";
|
|
541
|
-
}
|
|
542
|
-
return formatUnknownHelpTopic(normalizedTopicName);
|
|
543
|
-
}
|
|
544
|
-
function formatKnowledgesHelp(topicName) {
|
|
545
|
-
const normalizedTopicName = normalizeHelpTopicName(topicName);
|
|
546
|
-
const topicKey = normalizedTopicName ? `knowledges-${normalizedTopicName}` : "knowledges";
|
|
547
|
-
return formatCngkitHelp(topicKey);
|
|
548
|
-
}
|
|
549
|
-
function normalizeHelpTopicName(value) {
|
|
550
|
-
return value?.trim().toLowerCase().replace(/\s+/g, "-") ?? "";
|
|
551
|
-
}
|
|
552
|
-
function formatUnknownHelpTopic(topicName) {
|
|
553
|
-
return `# cngkit help
|
|
554
|
-
|
|
555
|
-
No help topic named \`${topicName}\`.
|
|
556
|
-
|
|
557
|
-
## Available Topics
|
|
558
|
-
|
|
559
|
-
${helpTopicNames.map((name) => `- \`${name}\``).join("\n")}
|
|
560
|
-
|
|
561
|
-
## Usage
|
|
562
|
-
|
|
563
|
-
\`\`\`bash
|
|
564
|
-
cngkit help <topic>
|
|
565
|
-
cngkit <command> --help
|
|
566
|
-
\`\`\``;
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
export {
|
|
570
|
-
formatCngkitHelp,
|
|
571
|
-
formatKnowledgesHelp
|
|
572
|
-
};
|
|
573
|
-
//# sourceMappingURL=chunk-BL3XMLIH.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/help-specs.ts"],"sourcesContent":["type HelpTopic = {\n title: string;\n aliases: string[];\n body: string;\n};\n\nconst commandList = [\n \"- `cngkit login` - open Curly.ng login, or print the URL in headless shells.\",\n \"- `cngkit coderoom ...` - share or join a live developer room for a working tree.\",\n \"- `cngkit scrub [path]` - scan for secrets; rewrite only when `--yes` is passed.\",\n \"- `cngkit transcripts ...` - list, read, and grep local Claude/Codex transcripts.\",\n \"- `cngkit knowledges ...` - search and read the hosted Harness knowledge catalog.\",\n].join(\"\\n\");\n\nconst coderoomCommandList = [\n \"- `share [room-code]` - start a live room from the current directory.\",\n \"- `join <room-code>` - join another developer's live room from the current directory.\",\n].join(\"\\n\");\n\nconst knowledgesCommandList = [\n \"- `status` - print remote catalog state.\",\n \"- `audiences` - list valid audience filters.\",\n \"- `search <query>` - search over Postgres-backed knowledges records.\",\n \"- `list [query]` - list known subskills.\",\n \"- `files [query]` - list uploaded catalog files.\",\n \"- `read <file-path>` - Claude-style file read.\",\n \"- `grep <pattern>` - Claude-style content search.\",\n \"- `glob [pattern]` - Claude-style file discovery.\",\n].join(\"\\n\");\n\nconst helpTopics: HelpTopic[] = [\n {\n title: \"cngkit\",\n aliases: [\"\", \"overview\", \"help\"],\n body: `# cngkit\n\nCurly.ng operator CLI for shared code rooms, safe local cleanup, local agent transcripts, and hosted Harness knowledges.\n\n## Run Now\n\n\\`\\`\\`bash\nnpx --yes cngkit@latest --help\nnpx --yes cngkit@latest knowledges search Cloudflare --limit 3\n\\`\\`\\`\n\n## Installed Usage\n\n\\`\\`\\`bash\ncngkit <command> [options]\n\\`\\`\\`\n\n## Global Options\n\n\\`\\`\\`bash\ncngkit --format text|json|markdown ...\ncngkit --no-color ...\n\\`\\`\\`\n\n## Commands\n\n${commandList}\n\n## Help Map\n\n\\`\\`\\`bash\ncngkit help <topic>\ncngkit <command> --help\ncngkit coderoom --help\ncngkit coderoom <subcommand> --help\ncngkit transcripts --help\ncngkit knowledges --help\ncngkit knowledges <subcommand> --help\n\\`\\`\\`\n\n## AI And Scripts\n\n- Help renders as structured terminal text by default, even in pipes.\n- Use \\`--format json\\` or \\`--json\\` on read-only data commands for typed payloads.\n- Use \\`--format markdown\\` only when raw Markdown source is intentional.\n- Use \\`--no-color\\` or \\`CNGKIT_COLOR=never\\` for logs, screenshots, and strict plain text.\n- Use \\`npm_config_progress=false npx --yes cngkit@latest ...\\` for clean one-shot npx captures.\n\n## Backend\n\nAPI: \\`https://curly.ng\\`\n`,\n },\n {\n title: \"login\",\n aliases: [\"login\"],\n body: `# cngkit login\n\nOpen Curly.ng login in a browser. In headless shells, print the URL so an agent can show it to the operator.\n\n## Usage\n\n\\`\\`\\`bash\nnpx --yes cngkit@latest login\ncngkit login\n\\`\\`\\`\n\n## Output\n\n- First line names the login URL being opened.\n- If no browser opener exists, the CLI prints a direct URL.\n- No credentials are printed or persisted by this command.\n`,\n },\n {\n title: \"transcripts\",\n aliases: [\"transcripts\", \"transcript\"],\n body: `# cngkit transcripts\n\nRead local Claude and Codex transcript JSONL files.\n\nThis is local-only operator tooling. It does not call Curly.ng and it does not upload transcript content.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit transcripts list [--source all|codex|claude] [--limit <n>] [--json|--format json]\ncngkit transcripts read <path-or-session-id> [--source all|codex|claude] [--limit <n>] [--include-internal] [--json|--format json]\ncngkit transcripts grep <query> [--source all|codex|claude] [--limit <n>] [--file-limit <n>] [--include-internal] [--json|--format json]\n\\`\\`\\`\n\n## Sources\n\n- \\`~/.codex/sessions\\`\n- \\`~/.codex/archived_sessions\\`\n- \\`~/.claude/projects\\`\n- \\`~/.claude/history.jsonl\\`\n\n## Defaults\n\n- \\`list\\`: newest 12 transcript files.\n- \\`read\\`: newest 80 user/assistant entries from the selected file.\n- \\`grep\\`: first 80 matching user/assistant entries from the newest 60 files.\n- \\`--source\\`: \\`all\\`.\n\n## Output\n\n- Text mode prints source, role, timestamp when available, and extracted message text.\n- Internal developer/system payloads and hook/tool noise are skipped unless \\`--include-internal\\` is passed.\n- Direct file paths, home-relative paths, and partial session ids are accepted by \\`read\\`.\n`,\n },\n {\n title: \"coderoom\",\n aliases: [\"coderoom\", \"code-room\", \"repo-sync\"],\n body: `# cngkit coderoom\n\nCreate or join a temporary live room for sharing a working tree over the Curly backend.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit coderoom <subcommand> [options]\n\\`\\`\\`\n\n## Subcommands\n\n${coderoomCommandList}\n\n## Common Flow\n\n\\`\\`\\`bash\nnpx --yes cngkit@latest coderoom share\nnpx --yes cngkit@latest coderoom join <room-code>\n\\`\\`\\`\n\n## Behavior\n\n- Connects to \\`/api/cng/sync/:roomCode\\` on the configured Curly backend.\n- Uses WebSocket transport backed by the \\`CngSyncRoom\\` Durable Object.\n- Sends an initial snapshot, then file and delete events.\n- Last received change wins.\n- Current rooms are live relays, not durable cloud storage.\n`,\n },\n {\n title: \"coderoom share\",\n aliases: [\"coderoom-share\"],\n body: `# cngkit coderoom share\n\nStart a live repository sync room from the current directory.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit coderoom share [room-code]\n\\`\\`\\`\n\n## Behavior\n\n- Connects to \\`/api/cng/sync/:roomCode\\` on the configured Curly backend.\n- Uses WebSocket transport backed by the \\`CngSyncRoom\\` Durable Object.\n- Sends an initial snapshot, then file and delete events.\n- Last received change wins.\n\n## Filesystem Contract\n\n- Preserves \\`.git/\\`.\n- Preserves files ignored by the repo's \\`.gitignore\\`.\n- Sends regular files as base64 payloads in the sync protocol.\n\n## Output\n\n- Prints room code, repo root, peer id, backend health, and concise sync events.\n- Keeps running until the socket closes or the process receives a termination signal.\n`,\n },\n {\n title: \"coderoom join\",\n aliases: [\"coderoom-join\"],\n body: `# cngkit coderoom join\n\nJoin an existing live repository sync room from the current directory.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit coderoom join <room-code>\n\\`\\`\\`\n\n## Behavior\n\nSame transport and filesystem contract as \\`cngkit coderoom share\\`. The supplied room code selects the Durable Object room.\n\n## Output\n\n- Prints backend health, room code, repo root, peer id, and concise sync events.\n- Missing room code exits with a usage error.\n`,\n },\n {\n title: \"scrub\",\n aliases: [\"scrub\"],\n body: `# cngkit scrub\n\nScan a file or directory for secrets with TruffleHog. Report-only is the default.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit scrub [path]\ncngkit scrub [path] --yes\n\\`\\`\\`\n\n## Safety\n\n- Default mode does not rewrite files.\n- Inline masking rewrites files and requires \\`--yes\\`.\n- Raw and redacted secret values are never printed.\n\n## Requirements\n\n- \\`trufflehog\\` must be available on \\`PATH\\`.\n\n## Mask Format\n\n\\`\\`\\`text\n[CNGKIT_SECRET:<detector>:<verified|unverified>]\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges\",\n aliases: [\"knowledges\", \"knowledge\"],\n body: `# cngkit knowledges\n\nSearch and read the hosted Harness knowledges catalog from the Curly backend.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges <subcommand> [options]\n\\`\\`\\`\n\n## Subcommands\n\n${knowledgesCommandList}\n\n## Progressive Help\n\n\\`\\`\\`bash\ncngkit help knowledges <subcommand>\ncngkit knowledges <subcommand> --help\ncngkit knowledges read --help\ncngkit knowledges grep --help\ncngkit knowledges glob --help\n\\`\\`\\`\n\n## Common Examples\n\n\\`\\`\\`bash\nnpx --yes cngkit@latest knowledges search Cloudflare --limit 3\nnpx --yes cngkit@latest knowledges read /libraries/lib-cloudflare/SUBSKILL.md --limit 80\nnpx --yes cngkit@latest knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches\nnpx --yes cngkit@latest knowledges glob \"**/*.md\" --path /libraries/lib-cloudflare\n\\`\\`\\`\n\n## AI-Friendly Output\n\n- Default output is structured text intended to be directly usable by people and agents.\n- \\`read\\` renders Markdown files by default and prints exact source with \\`--format markdown\\`.\n- \\`grep --output-mode content\\` prints \\`path:line\\` blocks.\n- \\`grep --output-mode files_with_matches\\` and \\`glob\\` print one path per line.\n- \\`--format json\\` and \\`--json\\` print typed backend payloads for machine consumption.\n`,\n },\n {\n title: \"knowledges status\",\n aliases: [\"knowledges-status\", \"status\"],\n body: `# cngkit knowledges status\n\nPrint remote Harness catalog state.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges status [--json|--format json]\n\\`\\`\\`\n\n## Output\n\n- Text mode prints catalog name, file count, blob count, database binding, and latest run when present.\n- \\`--format json\\` and \\`--json\\` print the backend data payload.\n`,\n },\n {\n title: \"knowledges audiences\",\n aliases: [\"knowledges-audiences\", \"audiences\"],\n body: `# cngkit knowledges audiences\n\nList valid audience filters for catalog browsing.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges audiences [--json|--format json]\n\\`\\`\\`\n\n## Use When\n\nRun this before \\`cngkit knowledges files --audience <id>\\`.\n`,\n },\n {\n title: \"knowledges search\",\n aliases: [\"knowledges-search\", \"search\"],\n body: `# cngkit knowledges search\n\nSearch the hosted Harness index for relevant skills and subskills.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges search <query> [--limit <n>] [--json|--format json]\n\\`\\`\\`\n\n## Defaults\n\n- \\`--limit\\`: \\`5\\`\n\n## Example\n\n\\`\\`\\`bash\nnpx --yes cngkit@latest knowledges search Cloudflare --limit 3\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges list\",\n aliases: [\"knowledges-list\", \"list\"],\n body: `# cngkit knowledges list\n\nList hosted Harness subskills, optionally filtered by query.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges list [query] [--limit <n>] [--json|--format json]\n\\`\\`\\`\n\n## Defaults\n\n- \\`--limit\\`: \\`25\\`\n\n## Example\n\n\\`\\`\\`bash\ncngkit knowledges list cloudflare --limit 10\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges files\",\n aliases: [\"knowledges-files\", \"files\"],\n body: `# cngkit knowledges files\n\nList uploaded Harness catalog files, optionally filtered by query or audience.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges files [query] [--audience <id>] [--limit <n>] [--json|--format json]\n\\`\\`\\`\n\n## Defaults\n\n- \\`--limit\\`: \\`25\\`\n- \\`--audience\\`: omitted\n\n## Example\n\n\\`\\`\\`bash\ncngkit knowledges files cloudflare --limit 10\ncngkit knowledges files \"vector search\" --audience builders\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges read\",\n aliases: [\"knowledges-read\", \"read\"],\n body: `# cngkit knowledges read\n\nRead a hosted Harness catalog file by path.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges read <file-path> [--offset <n>] [--limit <n>] [--json|--format json|--format markdown]\n\\`\\`\\`\n\n## Inputs\n\n- \\`file-path\\`: normalized catalog path. Shorthand paths such as \\`/libraries/lib-cloudflare/SUBSKILL.md\\` are expanded to \\`skills/knowledges/subskills/libraries/lib-cloudflare/SUBSKILL.md\\`.\n- \\`--offset\\`: zero-based starting line. Default: \\`0\\`.\n- \\`--limit\\`: maximum lines. Default in CLI: \\`200\\`. Backend max: \\`2000\\`.\n\n## Output\n\n- Text mode renders Markdown files for terminal reading.\n- \\`--format markdown\\` prints the exact returned file content.\n- If truncated, a final bracketed truncation note is printed after the content.\n- \\`--format json\\` and \\`--json\\` print \\`{ file_path, content, total_lines, offset, limit, truncated }\\`.\n\n## Example\n\n\\`\\`\\`bash\nnpx --yes cngkit@latest knowledges read /libraries/lib-cloudflare/SUBSKILL.md --limit 80\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges grep\",\n aliases: [\"knowledges-grep\", \"grep\"],\n body: `# cngkit knowledges grep\n\nSearch inside hosted Harness catalog files with a JavaScript regular expression.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges grep <pattern> [--path <path>] [--include <glob>] [--output-mode <mode>] [--context <n>] [--case-insensitive] [--json|--format json]\n\\`\\`\\`\n\n## Inputs\n\n- \\`pattern\\`: JavaScript regular expression source.\n- \\`--path\\`: catalog path prefix. Default: \\`skills\\`.\n- \\`--include\\`: filename include filter. Default: \\`*\\`.\n- Modes: content, files_with_matches, or count.\n- \\`--output-mode\\`: \\`content\\`, \\`files_with_matches\\`, or \\`count\\`. Default: \\`content\\`.\n- \\`--context\\`: context lines around content matches. Default: \\`0\\`. Backend max: \\`20\\`.\n- \\`--case-insensitive\\`: maps to backend \\`case_insensitive=true\\`.\n\n## Output\n\n- \\`content\\`: prints blocks as \\`file_path:line_number\\`, optional context lines, then \\`> matching line\\`.\n- \\`files_with_matches\\`: prints one matching file path per line.\n- \\`count\\`: prints \\`file_path: match_count\\` lines.\n- \\`--format json\\` and \\`--json\\` print the typed backend response union.\n\n## Examples\n\n\\`\\`\\`bash\nnpx --yes cngkit@latest knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches\nnpx --yes cngkit@latest knowledges grep \"Postgres|Hyperdrive\" --path /libraries/lib-cloudflare --context 2\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges glob\",\n aliases: [\"knowledges-glob\", \"glob\"],\n body: `# cngkit knowledges glob\n\nFind hosted Harness catalog files by glob pattern.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges glob [pattern] [--path <path>] [--json|--format json]\n\\`\\`\\`\n\n## Inputs\n\n- \\`pattern\\`: supported glob pattern. CLI default: \\`**/*.md\\`.\n- \\`--path\\`: catalog path prefix. Default: \\`skills\\`.\n\n## Supported Patterns\n\n- \\`**/*.md\\`\n- \\`**/*.SUBSKILL.md\\`\n- \\`**/SKILL.md\\`\n- \\`*.md\\`\n- \\`*.SUBSKILL.md\\`\n- \\`SKILL.md\\`\n\n## Output\n\n- Text mode prints one file path per line.\n- If truncated, a final bracketed truncation note is printed.\n- \\`--format json\\` and \\`--json\\` print \\`{ files, total_files, truncated }\\`.\n\n## Example\n\n\\`\\`\\`bash\nnpx --yes cngkit@latest knowledges glob \"**/*.md\" --path /libraries/lib-cloudflare\n\\`\\`\\`\n`,\n },\n];\n\nconst helpTopicNames = helpTopics\n .filter((topic) => topic.title !== \"cngkit\")\n .map((topic) => topic.title)\n .sort();\n\nconst helpTopicByAlias = new Map<string, HelpTopic>();\n\nfor (const topic of helpTopics) {\n for (const alias of topic.aliases) {\n helpTopicByAlias.set(alias, topic);\n }\n}\n\nexport function formatCngkitHelp(topicName?: string): string {\n const normalizedTopicName = normalizeHelpTopicName(topicName);\n const topic = helpTopicByAlias.get(normalizedTopicName);\n\n if (topic) {\n return topic.body.trim();\n }\n\n if (normalizedTopicName === \"\") {\n return helpTopicByAlias.get(\"\")?.body.trim() ?? \"\";\n }\n\n return formatUnknownHelpTopic(normalizedTopicName);\n}\n\nexport function formatKnowledgesHelp(topicName?: string): string {\n const normalizedTopicName = normalizeHelpTopicName(topicName);\n const topicKey = normalizedTopicName ? `knowledges-${normalizedTopicName}` : \"knowledges\";\n return formatCngkitHelp(topicKey);\n}\n\nfunction normalizeHelpTopicName(value: string | undefined): string {\n return value?.trim().toLowerCase().replace(/\\s+/g, \"-\") ?? \"\";\n}\n\nfunction formatUnknownHelpTopic(topicName: string): string {\n return `# cngkit help\n\nNo help topic named \\`${topicName}\\`.\n\n## Available Topics\n\n${helpTopicNames.map((name) => `- \\`${name}\\``).join(\"\\n\")}\n\n## Usage\n\n\\`\\`\\`bash\ncngkit help <topic>\ncngkit <command> --help\n\\`\\`\\``;\n}\n"],"mappings":";AAMA,IAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAEX,IAAM,sBAAsB;AAAA,EAC1B;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAEX,IAAM,wBAAwB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAEX,IAAM,aAA0B;AAAA,EAC9B;AAAA,IACE,OAAO;AAAA,IACP,SAAS,CAAC,IAAI,YAAY,MAAM;AAAA,IAChC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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