@seclai/cli 1.0.5 → 1.1.0

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