@seclai/cli 1.0.6 → 1.1.1

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.
Files changed (4) hide show
  1. package/README.md +393 -59
  2. package/dist/cli.js +2076 -219
  3. package/dist/cli.js.map +1 -1
  4. package/package.json +24 -5
package/README.md CHANGED
@@ -1,143 +1,471 @@
1
1
  # Seclai CLI
2
2
 
3
- Seclai Command Line Interface
3
+ Full-featured command-line interface for the [Seclai](https://seclai.com) platform.
4
+ Manage agents, knowledge bases, sources, memory banks, evaluations, solutions, governance, and more — all from the terminal.
4
5
 
5
- ## Install
6
+ All commands return JSON to stdout, so you can pipe into `jq` or other tools.
6
7
 
7
- Global install (recommended):
8
+ ## Install
8
9
 
9
10
  ```bash
10
11
  npm i -g @seclai/cli
11
12
  ```
12
13
 
13
- ## Documentation
14
+ Or run directly via npx (no install needed):
14
15
 
15
- Command reference (latest):
16
+ ```bash
17
+ npx @seclai/cli agents list
18
+ ```
16
19
 
17
- https://seclai.github.io/seclai-cli/1.0.6/
20
+ ### Setup Skills and MCP
18
21
 
19
- ## Authentication
22
+ If you are using an AI coding agent like Claude Code, you can also install the skill individually with:
23
+
24
+ ```sh
25
+ seclai skills install
26
+ ```
27
+
28
+ This installs skills into all detected coding editors by default. Use `--tool <tool>` to scope it to one editor.
29
+
30
+ To install the Seclai MCP server into your editors (Cursor, Claude Code, VS Code, etc.):
31
+
32
+ ```sh
33
+ seclai mcp configure --key "$SECLAI_API_KEY"
34
+ ```
35
+
36
+ Or directly via npx:
37
+
38
+ ```sh
39
+ npx skills add seclai/seclai-cli --full-depth --global --all
40
+ npx add-mcp https://api.seclai.com/mcp --header "X-API-Key: $SECLAI_API_KEY" --name Seclai
41
+ ```
42
+
43
+ ## Documentation
20
44
 
21
- The CLI uses API key authentication.
45
+ Command reference (latest): https://seclai.github.io/seclai-cli/1.1.1/
22
46
 
23
- Set `SECLAI_API_KEY` (or pass `--api-key`).
47
+ ## Authentication
24
48
 
25
- You can also pass options per command:
49
+ Set the `SECLAI_API_KEY` environment variable, or pass `--api-key` per-command:
26
50
 
27
51
  ```bash
28
- seclai --api-key "$SECLAI_API_KEY" sources list
52
+ export SECLAI_API_KEY="sk-..."
53
+
54
+ # or inline
55
+ seclai --api-key "$SECLAI_API_KEY" agents list
29
56
  ```
30
57
 
58
+ ## Environment Variables
59
+
60
+ | Variable | Description |
61
+ |---|---|
62
+ | `SECLAI_API_KEY` | Default API key (alternative to `--api-key`) |
63
+ | `SECLAI_API_URL` | Override API base URL (default: `https://api.seclai.com`) |
64
+
65
+ ## Global Options
66
+
67
+ | Flag | Description |
68
+ |---|---|
69
+ | `--api-key <key>` | Seclai API key |
70
+ | `--compact` | Output compact (single-line) JSON |
71
+ | `-V, --version` | Print version |
72
+
73
+ ---
74
+
31
75
  ## Commands
32
76
 
33
- ### Sources
77
+ ### Agents
34
78
 
35
- List sources:
79
+ ```bash
80
+ seclai agents list [--page N] [--limit N]
81
+ seclai agents create --json '{"name":"My Agent"}'
82
+ seclai agents get <agentId>
83
+ seclai agents update <agentId> --json '{"name":"Renamed"}'
84
+ seclai agents delete <agentId>
85
+ ```
86
+
87
+ #### Running Agents
88
+
89
+ Four modes: basic, streaming (SSE wait), events (NDJSON), and polling.
36
90
 
37
91
  ```bash
38
- seclai sources list
39
- seclai sources list --page 1 --limit 20 --sort created_at --order desc
40
- seclai sources list --account-id 9f3c2a7d-2d4a-4c8e-9d1d-3f7a2f1c0b5e
92
+ # Basic run (returns final result)
93
+ seclai agents run <agentId> --json '{"input":"Hello"}'
94
+ seclai agents run <agentId> --json-file ./run.json
95
+ cat run.json | seclai agents run <agentId> --json-file -
96
+
97
+ # SSE streaming (waits for done event or timeout)
98
+ seclai agents run <agentId> --json '{"input":"Hi"}' --stream --timeout-ms 60000
99
+
100
+ # NDJSON event stream (outputs every SSE event as a JSON line)
101
+ seclai agents run <agentId> --json '{"input":"Hi"}' --events
102
+ seclai agents run <agentId> --json '{"input":"Hi"}' --events --event-filter status
103
+ seclai agents run <agentId> --json '{"input":"Hi"}' --events --output data
104
+
105
+ # Polling (submit then poll until complete)
106
+ seclai agents run <agentId> --json '{"input":"Hi"}' --poll --poll-interval-ms 2000
41
107
  ```
42
108
 
43
- Upload a file to a source connection:
109
+ #### Agent Runs
44
110
 
45
111
  ```bash
46
- seclai sources upload 2b1f0f3a-1d2c-4b5a-8e9f-0a1b2c3d4e5f --file ./mydoc.pdf
47
- seclai sources upload 2b1f0f3a-1d2c-4b5a-8e9f-0a1b2c3d4e5f --file ./notes.txt --title "Notes" --mime-type text/plain
48
- seclai sources upload 2b1f0f3a-1d2c-4b5a-8e9f-0a1b2c3d4e5f --file ./mydoc.pdf --metadata '{"category":"docs","author":"Ada"}'
112
+ seclai agents runs list <agentId> [--page N] [--limit N]
113
+ seclai agents runs get <runId> [--include-step-outputs]
114
+ seclai agents runs delete <runId>
115
+ seclai agents runs cancel <runId>
116
+ seclai agents runs search [--page N] [--limit N] [--json '...']
117
+ seclai agents runs eval-results <agentId> <runId> [--page N] [--limit N]
49
118
  ```
50
119
 
51
- ### Agents
120
+ #### Agent Definition
52
121
 
53
- Run an agent (body is JSON):
122
+ ```bash
123
+ seclai agents def get <agentId>
124
+ seclai agents def update <agentId> --json '{"steps":[...]}'
125
+ ```
126
+
127
+ #### Agent Input Upload
54
128
 
55
129
  ```bash
56
- seclai agents run 6b9e2a1c-4d5f-4a7b-9c0d-1e2f3a4b5c6d --json '{"query":"hello"}'
57
- seclai agents run 6b9e2a1c-4d5f-4a7b-9c0d-1e2f3a4b5c6d --json-file ./run.json
58
- cat ./run.json | seclai agents run 6b9e2a1c-4d5f-4a7b-9c0d-1e2f3a4b5c6d --json-file -
130
+ seclai agents upload-input <agentId> --file ./data.csv [--file-name data.csv] [--mime-type text/csv]
131
+ seclai agents input-status <agentId> <uploadId>
59
132
  ```
60
133
 
61
- Run an agent via SSE streaming (waits until the final result or timeout):
134
+ #### Agent AI Assistant
62
135
 
63
- This command exits successfully when the stream emits the final `done` event; it fails if the stream ends early or the timeout is reached.
136
+ ```bash
137
+ seclai agents ai gen-steps <agentId> --user-input "Build a QA chatbot"
138
+ seclai agents ai step-config <agentId> --user-input "Configure the search step"
139
+ seclai agents ai history <agentId>
140
+ seclai agents ai mark <agentId> <conversationId> --json '{"accepted":true}'
141
+ ```
142
+
143
+ ### Sources
64
144
 
65
145
  ```bash
66
- seclai agents run 6b9e2a1c-4d5f-4a7b-9c0d-1e2f3a4b5c6d \
67
- --json '{"input":"Hello from streaming"}' \
68
- --stream \
69
- --timeout-ms 60000
146
+ seclai sources list [--page N] [--limit N] [--sort <field>] [--order asc|desc]
147
+ seclai sources create --json '{"name":"Docs","type":"manual"}'
148
+ seclai sources get <sourceId>
149
+ seclai sources update <sourceId> --json '{"name":"Renamed"}'
150
+ seclai sources delete <sourceId>
70
151
  ```
71
152
 
72
- List runs:
153
+ `source` is an alias for `sources` (e.g. `seclai source list`).
154
+
155
+ #### Upload
73
156
 
74
157
  ```bash
75
- seclai agents runs list 6b9e2a1c-4d5f-4a7b-9c0d-1e2f3a4b5c6d
76
- seclai agents runs list 6b9e2a1c-4d5f-4a7b-9c0d-1e2f3a4b5c6d --page 1 --limit 50
158
+ seclai sources upload <sourceId> --file ./doc.pdf [--title "Doc"] [--mime-type application/pdf] [--metadata '{}']
159
+ seclai sources upload-text <sourceId> --json '{"title":"Note","text":"Hello world"}'
77
160
  ```
78
161
 
79
- Get a run:
162
+ #### Exports
80
163
 
81
164
  ```bash
82
- seclai runs get 3f1a2b4c-5d6e-4f70-8a9b-1c2d3e4f5a6b
83
- seclai runs get 3f1a2b4c-5d6e-4f70-8a9b-1c2d3e4f5a6b --include-step-outputs
165
+ seclai sources exports list <sourceId> [--page N] [--limit N]
166
+ seclai sources exports create <sourceId>
167
+ seclai sources exports get <sourceId> <exportId>
168
+ seclai sources exports cancel <sourceId> <exportId>
169
+ seclai sources exports delete <sourceId> <exportId>
170
+ seclai sources exports download <sourceId> <exportId>
171
+ seclai sources exports estimate <sourceId>
84
172
  ```
85
173
 
86
- Cancel/delete a run:
174
+ #### Embedding Migration
87
175
 
88
176
  ```bash
89
- seclai runs delete 3f1a2b4c-5d6e-4f70-8a9b-1c2d3e4f5a6b
177
+ seclai sources migration get <sourceId>
178
+ seclai sources migration start <sourceId>
179
+ seclai sources migration cancel <sourceId>
90
180
  ```
91
181
 
92
182
  ### Contents
93
183
 
94
- Get content detail:
184
+ ```bash
185
+ seclai contents get <contentVersionId> [--start N] [--end N]
186
+ seclai contents delete <contentVersionId>
187
+ seclai contents embeddings <contentVersionId> [--page N] [--limit N]
188
+ ```
189
+
190
+ #### Upload / Replace
95
191
 
96
192
  ```bash
97
- seclai contents get a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d
98
- seclai contents get a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d --start 0 --end 5000
193
+ seclai contents upload <contentVersionId> --file ./updated.pdf [--metadata '{}']
194
+ seclai contents replace <contentVersionId> --file ./updated.pdf # alias
195
+ seclai contents replace-text <contentVersionId> --json '{"title":"Note","text":"Updated content"}'
99
196
  ```
100
197
 
101
- Delete a content version:
198
+ ### Knowledge Bases
102
199
 
103
200
  ```bash
104
- seclai contents delete a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d
201
+ seclai kb list [--page N] [--limit N] [--sort <field>] [--order asc|desc]
202
+ seclai kb create --json '{"name":"Support KB"}'
203
+ seclai kb get <kbId>
204
+ seclai kb update <kbId> --json '{"name":"Renamed"}'
205
+ seclai kb delete <kbId>
105
206
  ```
106
207
 
107
- List embeddings:
208
+ ### Memory Banks
108
209
 
109
210
  ```bash
110
- seclai contents embeddings a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d
111
- seclai contents embeddings a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d --page 1 --limit 20
211
+ seclai memory list [--page N] [--limit N]
212
+ seclai memory create --json '{"name":"Chat Memory","type":"conversation"}'
213
+ seclai memory get <memoryBankId>
214
+ seclai memory update <memoryBankId> --json '{"name":"Renamed"}'
215
+ seclai memory delete <memoryBankId>
216
+ seclai memory stats <memoryBankId>
217
+ seclai memory agents <memoryBankId>
218
+ seclai memory compact <memoryBankId>
219
+ seclai memory delete-source <memoryBankId>
220
+ seclai memory templates
221
+ seclai memory test-compaction <memoryBankId> [--json '...']
222
+ seclai memory test-compaction-standalone [--json '...']
112
223
  ```
113
224
 
114
- Replace a content version by uploading a new file (keeps the same content version ID):
225
+ #### Memory AI Assistant
115
226
 
116
227
  ```bash
117
- seclai contents upload a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d --file ./updated.pdf
118
- seclai contents upload a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d --file ./updated.pdf --metadata '{"revision":2}'
119
- seclai contents replace a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d --file ./updated.pdf # alias
228
+ seclai memory ai generate --user-input "Configure compaction"
229
+ seclai memory ai last
230
+ seclai memory ai accept <conversationId> --json '{"accepted":true}'
120
231
  ```
121
232
 
122
- ## Development
233
+ ### Evaluations
234
+
235
+ #### Criteria
236
+
237
+ ```bash
238
+ seclai evals criteria list <agentId> [--page N] [--limit N]
239
+ seclai evals criteria create <agentId> --json '{"name":"Quality"}'
240
+ seclai evals criteria get <criteriaId>
241
+ seclai evals criteria update <criteriaId> --json '{"name":"Renamed"}'
242
+ seclai evals criteria delete <criteriaId>
243
+ seclai evals criteria summary <criteriaId>
244
+ ```
245
+
246
+ #### Results
247
+
248
+ ```bash
249
+ seclai evals results list <criteriaId> [--page N] [--limit N]
250
+ seclai evals results create <criteriaId> --json '{"run_id":"...","score":0.9}'
251
+ ```
252
+
253
+ #### Agent-level
254
+
255
+ ```bash
256
+ seclai evals compatible-runs <criteriaId> [--page N] [--limit N]
257
+ seclai evals test-draft <agentId> --json '{"criteria":{...}}'
258
+ seclai evals agent-results <agentId> [--page N] [--limit N]
259
+ seclai evals agent-runs <agentId> [--page N] [--limit N]
260
+ seclai evals non-manual-summary <agentId>
261
+ ```
262
+
263
+ ### Solutions
264
+
265
+ ```bash
266
+ seclai solutions list [--page N] [--limit N]
267
+ seclai solutions create --json '{"name":"My Solution"}'
268
+ seclai solutions get <solutionId>
269
+ seclai solutions update <solutionId> --json '{"name":"Renamed"}'
270
+ seclai solutions delete <solutionId>
271
+ ```
272
+
273
+ #### Link / Unlink Resources
274
+
275
+ ```bash
276
+ seclai solutions link <solutionId> --agents '["id1","id2"]' --kb '["id3"]' --sources '["id4"]'
277
+ seclai solutions unlink <solutionId> --agents '["id1"]'
278
+ ```
279
+
280
+ #### Conversations
281
+
282
+ ```bash
283
+ seclai solutions convos list <solutionId>
284
+ seclai solutions convos add <solutionId> --json '{"user_input":"Add a source"}'
285
+ seclai solutions convos mark <solutionId> <conversationId> --json '{"accepted":true}'
286
+ ```
287
+
288
+ #### Solution AI Assistant
289
+
290
+ ```bash
291
+ seclai solutions ai generate <solutionId> --user-input "Add a FAQ source"
292
+ seclai solutions ai kb <solutionId> --user-input "Create a knowledge base"
293
+ seclai solutions ai source <solutionId> --user-input "Create a file source"
294
+ seclai solutions ai accept <solutionId> <conversationId>
295
+ seclai solutions ai decline <solutionId> <conversationId>
296
+ ```
297
+
298
+ ### Governance
299
+
300
+ ```bash
301
+ seclai governance ai generate --user-input "Create a content safety policy"
302
+ seclai governance ai list
303
+ seclai governance ai accept <conversationId>
304
+ seclai governance ai decline <conversationId>
305
+ ```
306
+
307
+ ### Alerts
308
+
309
+ ```bash
310
+ seclai alerts list [--page N] [--limit N] [--status open] [--severity high]
311
+ seclai alerts get <alertId>
312
+ seclai alerts status <alertId> --json '{"status":"resolved"}'
313
+ seclai alerts comment <alertId> --json '{"comment":"Investigating"}'
314
+ seclai alerts subscribe <alertId>
315
+ seclai alerts unsubscribe <alertId>
316
+ ```
317
+
318
+ #### Alert Configurations
319
+
320
+ ```bash
321
+ seclai alerts configs list [--page N] [--limit N]
322
+ seclai alerts configs create --json '{"name":"Critical Alerts","type":"email"}'
323
+ seclai alerts configs get <configId>
324
+ seclai alerts configs update <configId> --json '{"name":"Renamed"}'
325
+ seclai alerts configs delete <configId>
326
+ ```
327
+
328
+ #### Organization Alert Preferences
329
+
330
+ ```bash
331
+ seclai alerts prefs list
332
+ seclai alerts prefs update <organizationId> <alertType> --json '{"enabled":true}'
333
+ ```
334
+
335
+ ### Models
336
+
337
+ #### Model Alerts
338
+
339
+ ```bash
340
+ seclai models alerts list [--page N] [--limit N]
341
+ seclai models alerts mark-read <alertId>
342
+ seclai models alerts mark-all-read
343
+ seclai models alerts unread-count
344
+ ```
345
+
346
+ #### Recommendations
347
+
348
+ ```bash
349
+ seclai models recommendations <modelId>
350
+ ```
351
+
352
+ ### Search
353
+
354
+ ```bash
355
+ seclai search --query "deployment guide" [--limit N] [--entity-type agent|source|kb]
356
+ ```
357
+
358
+ ### AI Assistant
359
+
360
+ Top-level AI assistant for multi-domain operations.
361
+
362
+ ```bash
363
+ seclai ai feedback --json '{"conversation_id":"...","feedback":"helpful"}'
364
+ seclai ai kb --user-input "Create a support knowledge base"
365
+ seclai ai source --user-input "Create a documentation source"
366
+ seclai ai solution --user-input "Build a customer support solution"
367
+ seclai ai memory --user-input "Create a conversation memory bank"
368
+ seclai ai memory-history
369
+ seclai ai accept <conversationId> [--json '...']
370
+ seclai ai decline <conversationId>
371
+ seclai ai memory-accept <conversationId> [--json '...']
372
+ ```
373
+
374
+ ### Skills
375
+
376
+ Install Seclai skill files for AI coding tools (Copilot, Claude Code, Cursor, Windsurf, Codex, Kiro, Cline, Roo Code, Gemini, Antigravity).
377
+
378
+ ```bash
379
+ # Auto-detect tools from workspace directory structure
380
+ seclai skills install
381
+
382
+ # Target a specific tool
383
+ seclai skills install --tool copilot
384
+ seclai skills install --tool claude
385
+ seclai skills install --tool cursor
386
+ seclai skills install --tool kiro
387
+ seclai skills install --tool cline
388
+
389
+ # Install for all supported tools
390
+ seclai skills install --tool all
391
+
392
+ # Specify a custom directory
393
+ seclai skills install --tool copilot --dir /path/to/project
394
+
395
+ # Via npx (no install required)
396
+ npx @seclai/cli skills install
397
+ ```
398
+
399
+ Skills follow the [Agent Skills specification](https://agentskills.io/specification). Each tool gets a `seclai-cli/` directory containing a `SKILL.md` with YAML frontmatter and a `references/` subdirectory for progressive disclosure:
400
+
401
+ | Tool | Directory |
402
+ |---|---|
403
+ | Copilot | `.github/copilot/seclai-cli/` |
404
+ | Claude Code | `.claude/skills/seclai-cli/` |
405
+ | Cursor | `.cursor/skills/seclai-cli/` |
406
+ | Windsurf | `.windsurf/skills/seclai-cli/` |
407
+ | Codex | `.codex/skills/seclai-cli/` |
408
+ | Kiro | `.kiro/steering/seclai-cli/` |
409
+ | Cline | `.clinerules/seclai-cli/` |
410
+ | Roo Code | `.roo/rules/seclai-cli/` |
411
+ | Gemini | `.gemini/seclai-cli/` |
412
+ | Antigravity | `.antigravity/seclai-cli/` |
123
413
 
124
- ### Base URL
414
+ You can also install skills using the [skills CLI](https://github.com/vercel-labs/skills):
125
415
 
126
- Overriding the base URL is intended for development/staging.
416
+ ```bash
417
+ npx skills add seclai/seclai-cli
418
+ ```
419
+
420
+ ### MCP Server
127
421
 
128
- Set `SECLAI_API_URL` to point at a different API host:
422
+ Configure the [Seclai MCP server](https://github.com/seclai/seclai-mcp) for AI coding tools:
129
423
 
130
424
  ```bash
131
- export SECLAI_API_URL="https://example.invalid"
425
+ # Auto-detect tools and write MCP config
426
+ seclai mcp configure --key YOUR_API_KEY
427
+
428
+ # Target a specific tool
429
+ seclai mcp configure --key YOUR_API_KEY --target claude-code
430
+ seclai mcp configure --key YOUR_API_KEY --target cursor
431
+ seclai mcp configure --key YOUR_API_KEY --target claude-desktop
432
+ seclai mcp configure --key YOUR_API_KEY --target windsurf
433
+
434
+ # Configure all known targets
435
+ seclai mcp configure --key YOUR_API_KEY --target all
436
+
437
+ # Show the MCP config snippet (for manual setup)
438
+ seclai mcp show
439
+ seclai mcp show --key YOUR_API_KEY
132
440
  ```
133
441
 
134
- Or pass it per-invocation:
442
+ | Target | Config File | Scope |
443
+ |---|---|---|
444
+ | claude-code | `.mcp.json` | Project |
445
+ | cursor | `.cursor/mcp.json` | Project |
446
+ | claude-desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` | Global |
447
+ | windsurf | `~/.codeium/windsurf/mcp_config.json` | Global |
448
+
449
+ The command merges into existing config files — it won't overwrite other MCP servers.
450
+
451
+ ### Shell Completion
452
+
453
+ Generate shell completion scripts for tab-completion of commands:
135
454
 
136
455
  ```bash
137
- SECLAI_API_URL="https://example.invalid" seclai sources list
456
+ # Bash add to ~/.bashrc
457
+ eval "$(seclai completion bash)"
458
+
459
+ # Zsh — add to ~/.zshrc
460
+ eval "$(seclai completion zsh)"
461
+
462
+ # Fish — save to completions directory
463
+ seclai completion fish > ~/.config/fish/completions/seclai.fish
138
464
  ```
139
465
 
140
- This is intentionally environment-variable-only (there is no CLI flag for it).
466
+ ---
467
+
468
+ ## Development
141
469
 
142
470
  ### Install dependencies
143
471
 
@@ -163,6 +491,12 @@ npm run build
163
491
  npm run dev -- --help
164
492
  ```
165
493
 
494
+ ### Test
495
+
496
+ ```bash
497
+ npm test
498
+ ```
499
+
166
500
  ### Test global install locally
167
501
 
168
502
  ```bash