@seclai/cli 1.2.1 → 1.3.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.
package/README.md CHANGED
@@ -42,7 +42,7 @@ npx add-mcp https://api.seclai.com/mcp --header "X-API-Key: $SECLAI_API_KEY" --n
42
42
 
43
43
  ## Documentation
44
44
 
45
- Command reference (latest): https://seclai.github.io/seclai-cli/1.2.1/
45
+ Command reference (latest): https://seclai.github.io/seclai-cli/1.3.0/
46
46
 
47
47
  ## Authentication
48
48
 
@@ -171,11 +171,20 @@ seclai agents def get <agentId>
171
171
  seclai agents def update <agentId> --json '{"steps":[...]}'
172
172
  ```
173
173
 
174
- #### Agent Export
174
+ #### Agent Export / Import
175
175
 
176
176
  ```bash
177
177
  seclai agents export <agentId>
178
178
  seclai agents export <agentId> --no-download
179
+
180
+ # Validate an agent_definition payload without creating an agent.
181
+ # Reports counts and any unresolved_refs you'll need to map with entity_remap
182
+ # when calling `agents create` or `agents update`.
183
+ # The body shape is `{ "agent_definition": <export payload> }`.
184
+ seclai agents preview-import --json-file ./preview-body.json
185
+ seclai agents export <agentId> \
186
+ | jq '{agent_definition: .}' \
187
+ | seclai agents preview-import --json-file -
179
188
  ```
180
189
 
181
190
  #### Agent Input Upload
package/dist/cli.js CHANGED
@@ -131,6 +131,9 @@ async function run(rt, main) {
131
131
  rt.setExitCode(1);
132
132
  }
133
133
  }
134
+ function withJsonInputOptions(cmd) {
135
+ return cmd.option("--json <json>", "Inline JSON body. Use '-' to read from stdin.").option("--json-file <path>", "Path to JSON file. Use '-' to read from stdin.");
136
+ }
134
137
  function withFileUploadOptions(cmd) {
135
138
  return cmd.requiredOption("--file <path>", "Path to a local file to upload.").option("--title <title>", "Optional title.").option("--metadata <json>", "Metadata JSON object. Use '-' for stdin.").option("--metadata-file <path>", "Path to metadata JSON file. Use '-' for stdin.").option("--file-name <name>", "Override filename sent to API.").option("--mime-type <type>", "Explicit MIME type.");
136
139
  }
@@ -308,6 +311,15 @@ function register(program, rt) {
308
311
  printJson(rt, await client.exportAgent(agentId, opts.download));
309
312
  });
310
313
  });
314
+ agents.command("preview-import").description(
315
+ "Validate an agent_definition payload without creating any agent. Reports step/schedule/alert/criteria/policy counts and any unresolved_refs (workflow refs to KBs, memory banks, source connections, or sub-agents that don't exist in this account)."
316
+ ).option("--json <json>", "Inline JSON body ({ agent_definition: ... }). Use '-' for stdin.").option("--json-file <path>", "JSON file path. Use '-' for stdin.").action(async (opts) => {
317
+ await run(rt, async () => {
318
+ const client = createClient(program.opts());
319
+ const body = await readJsonInput(rt, { json: opts.json, jsonFile: opts.jsonFile });
320
+ printJson(rt, await client.previewImportAgent(body));
321
+ });
322
+ });
311
323
  agents.command("upload-input").description("Upload a file as agent input.").argument("<agentId>", "Agent ID.").requiredOption("--file <path>", "File to upload.").option("--file-name <name>", "Override filename.").option("--mime-type <type>", "MIME type.").action(async (agentId, opts) => {
312
324
  await run(rt, async () => {
313
325
  const client = createClient(program.opts());
@@ -1041,7 +1053,23 @@ function register9(program, rt) {
1041
1053
 
1042
1054
  // src/commands/models.ts
1043
1055
  function register10(program, rt) {
1044
- const models = program.command("models").description("Model alerts and recommendations.");
1056
+ const models = program.command("models").description("Models, model alerts, recommendations, and playground experiments.");
1057
+ models.command("list").description("List models grouped by provider.").option("--provider <provider>", "Filter by provider name.").option("--supports-tool-use", "Only models that support tool use.").option("--supports-thinking", "Only models that support thinking.").action(async (opts) => {
1058
+ await run(rt, async () => {
1059
+ const client = createClient(program.opts());
1060
+ const o = {};
1061
+ if (opts.provider !== void 0) o.provider = opts.provider;
1062
+ if (opts.supportsToolUse !== void 0) o.supportsToolUse = opts.supportsToolUse;
1063
+ if (opts.supportsThinking !== void 0) o.supportsThinking = opts.supportsThinking;
1064
+ printJson(rt, await client.listModels(o));
1065
+ });
1066
+ });
1067
+ models.command("get").description("Get full details for a specific model.").argument("<modelId>", "Model ID.").action(async (modelId) => {
1068
+ await run(rt, async () => {
1069
+ const client = createClient(program.opts());
1070
+ printJson(rt, await client.getModel(modelId));
1071
+ });
1072
+ });
1045
1073
  const alerts = models.command("alerts").description("Model alerts.");
1046
1074
  alerts.command("list").description("List model alerts.").option("--page <n>", "Page number.", (v) => Number(v)).option("--limit <n>", "Page size.", (v) => Number(v)).action(async (opts) => {
1047
1075
  await run(rt, async () => {
@@ -1075,6 +1103,38 @@ function register10(program, rt) {
1075
1103
  printJson(rt, await client.getModelRecommendations(modelId));
1076
1104
  });
1077
1105
  });
1106
+ const experiments = models.command("experiments").description("Model playground experiments.");
1107
+ experiments.command("list").description("List model playground experiments.").option("--days <n>", "Filter to last N days.", (v) => Number(v)).option("--start-date <date>", "Start date (ISO 8601).").option("--end-date <date>", "End date (ISO 8601).").option("--limit <n>", "Page size.", (v) => Number(v)).option("--offset <n>", "Offset.", (v) => Number(v)).action(async (opts) => {
1108
+ await run(rt, async () => {
1109
+ const client = createClient(program.opts());
1110
+ const o = {};
1111
+ if (opts.days !== void 0) o.days = opts.days;
1112
+ if (opts.startDate !== void 0) o.startDate = opts.startDate;
1113
+ if (opts.endDate !== void 0) o.endDate = opts.endDate;
1114
+ if (opts.limit !== void 0) o.limit = opts.limit;
1115
+ if (opts.offset !== void 0) o.offset = opts.offset;
1116
+ printJson(rt, await client.listExperiments(o));
1117
+ });
1118
+ });
1119
+ withJsonInputOptions(experiments.command("create").description("Create a model playground experiment.")).action(async (opts) => {
1120
+ await run(rt, async () => {
1121
+ const client = createClient(program.opts());
1122
+ const body = await readJsonInput(rt, { json: opts.json, jsonFile: opts.jsonFile });
1123
+ printJson(rt, await client.createExperiment(body));
1124
+ });
1125
+ });
1126
+ experiments.command("get").description("Get a model playground experiment by ID.").argument("<experimentId>", "Experiment ID.").action(async (experimentId) => {
1127
+ await run(rt, async () => {
1128
+ const client = createClient(program.opts());
1129
+ printJson(rt, await client.getExperiment(experimentId));
1130
+ });
1131
+ });
1132
+ experiments.command("cancel").description("Cancel a running model playground experiment.").argument("<experimentId>", "Experiment ID.").action(async (experimentId) => {
1133
+ await run(rt, async () => {
1134
+ const client = createClient(program.opts());
1135
+ printJson(rt, await client.cancelExperiment(experimentId));
1136
+ });
1137
+ });
1078
1138
  }
1079
1139
 
1080
1140
  // src/commands/search.ts