@cantinasecurity/apex-cli 0.1.16 → 0.1.17
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/.claude/skills/apex-cli/SKILL.md +7 -4
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.mcp.claude.json +1 -1
- package/.mcp.codex.json +1 -1
- package/MARKETPLACE.md +1 -1
- package/README.md +9 -5
- package/dist/commands.js +34 -4
- package/dist/help.js +7 -4
- package/dist/mcp.js +4 -4
- package/dist/shell.js +3 -3
- package/dist/telemetry.js +15 -2
- package/package.json +1 -1
- package/skills/apex-cli/SKILL.md +6 -4
|
@@ -25,9 +25,10 @@ Recommended workflow:
|
|
|
25
25
|
4. Call `apex-doctor` before starting a scan if workspace binding or source planning might be unclear.
|
|
26
26
|
5. If the directory is not bound to the right workspace, call `apex-workspaces` and `apex-workspace-use`.
|
|
27
27
|
6. Use `apex-scan`, `apex-status`, `apex-scans`, `apex-findings`, and `apex-export-findings` for the scan lifecycle.
|
|
28
|
-
7. For
|
|
29
|
-
8.
|
|
30
|
-
9.
|
|
28
|
+
7. For Lite scans, call `apex-scan` with `mode: "lite"` only when the company has Lite Scan beta access and the sources are provider-backed.
|
|
29
|
+
8. For PR scans, call `apex-scan` with `mode: "pr"` and `pullRequests`.
|
|
30
|
+
9. Use `apex-finding-comment` and `apex-finding-feedback` when the user wants to leave review notes or valid/invalid feedback on a finding.
|
|
31
|
+
10. For fix reviews, call `apex-finding-fix-review`. Pass `fixPrUrls` for a PR-based review, or omit them to review the current repository state when Bedrock has original scan repository context.
|
|
31
32
|
|
|
32
33
|
If the Apex MCP server is not configured, fall back to the local CLI:
|
|
33
34
|
|
|
@@ -39,12 +40,13 @@ If the Apex MCP server is not configured, fall back to the local CLI:
|
|
|
39
40
|
- Hosted scan triggers require `Idempotency-Key`. Reuse one stable key only for an identical transport/timeout/5xx retry. After correcting a definitive 4xx response, or for any new intended scan, use a new key.
|
|
40
41
|
- Use `--non-interactive` and `--no-open` for automation-friendly CLI calls.
|
|
41
42
|
- Use `--json` whenever structured output is helpful.
|
|
42
|
-
- `apex credits` reports standard credits plus audit
|
|
43
|
+
- `apex credits` reports standard credits plus audit, fix review, and Lite scan entitlements when Bedrock returns those balances.
|
|
43
44
|
- Work from the target repository directory so Apex can resolve `.apex/workspace.json`.
|
|
44
45
|
- `apex scan` scans the current working directory by default; pass `--repo` only when the user asks to scan explicit alternate roots.
|
|
45
46
|
- `apex-doctor` reports whether Apex will use remote materialization or a local snapshot upload for each selected source.
|
|
46
47
|
- Plain local directories and dirty git worktrees can scan through local snapshot uploads without provider access.
|
|
47
48
|
- Audit scans use `--mode audit` in user-facing CLI calls and request payloads. The legacy `ultra` mode remains accepted as an alias, but audit scans still require provider-backed GitHub or GitLab sources.
|
|
49
|
+
- Lite scans use `--mode lite` in CLI calls or `mode: "lite"` in MCP, require Lite Scan beta access, and require provider-backed GitHub or GitLab sources without local snapshot fallback.
|
|
48
50
|
- PR scans use `--mode pr --pr <number>` in CLI calls, or `mode: "pr"` with `pullRequests` in MCP. They require one provider-backed GitHub repository.
|
|
49
51
|
- `apex-workspace-use` accepts a workspace name, prefix, or ID.
|
|
50
52
|
- Use `sourceMode: "remote"` only when the user explicitly wants to forbid local snapshot fallbacks.
|
|
@@ -59,6 +61,7 @@ If the Apex MCP server is not configured, fall back to the local CLI:
|
|
|
59
61
|
## Examples
|
|
60
62
|
|
|
61
63
|
- Start a scan for the current repository or directory: run `apex-doctor`, bind a workspace if needed, then call `apex-scan`.
|
|
64
|
+
- Start a Lite scan: call `apex-scan` with `mode: "lite"` after confirming beta access and provider-backed sources.
|
|
62
65
|
- Start a PR scan: call `apex-scan` with `mode: "pr"` and `pullRequests`.
|
|
63
66
|
- Check an active scan: call `apex-status`, passing `scanId` when the scan is not the latest binding, then `apex-findings` when the scan completes.
|
|
64
67
|
- Export findings for review: call `apex-export-findings` with `format` set to `markdown`, `json`, or `gitlab-sast`.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Cantina agent plugins for security review workflows.",
|
|
9
|
-
"version": "0.1.
|
|
9
|
+
"version": "0.1.17"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"source": {
|
|
15
15
|
"source": "npm",
|
|
16
16
|
"package": "@cantinasecurity/apex-cli",
|
|
17
|
-
"version": "0.1.
|
|
17
|
+
"version": "0.1.17"
|
|
18
18
|
},
|
|
19
19
|
"description": "Run Apex security scans and review findings from Claude Code.",
|
|
20
|
-
"version": "0.1.
|
|
20
|
+
"version": "0.1.17",
|
|
21
21
|
"author": {
|
|
22
22
|
"name": "Cantina",
|
|
23
23
|
"email": "support@cantina.xyz"
|
package/.mcp.claude.json
CHANGED
package/.mcp.codex.json
CHANGED
package/MARKETPLACE.md
CHANGED
|
@@ -13,7 +13,7 @@ This package is prepared as both a Claude Code plugin and a Codex plugin. The pu
|
|
|
13
13
|
The plugin MCP configs launch the pinned npm CLI package with:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npx -y -p @cantinasecurity/apex-cli@0.1.
|
|
16
|
+
npx -y -p @cantinasecurity/apex-cli@0.1.17 apex-mcp
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
That keeps marketplace installs independent of a user's global `apex` install.
|
package/README.md
CHANGED
|
@@ -103,7 +103,7 @@ If Apex asks for a workspace name, that is the Apex workspace name for the curre
|
|
|
103
103
|
Supported shell commands:
|
|
104
104
|
|
|
105
105
|
- `/credits`
|
|
106
|
-
- `/scan [standard|audit]`
|
|
106
|
+
- `/scan [standard|audit|lite]`
|
|
107
107
|
- `/scan pr <pr-number>`
|
|
108
108
|
- `/scans`
|
|
109
109
|
- `/findings [scan-id]`
|
|
@@ -136,6 +136,7 @@ Supported shell commands:
|
|
|
136
136
|
|
|
137
137
|
- `apex credits`
|
|
138
138
|
- `apex scan`
|
|
139
|
+
- `apex scan --mode lite`
|
|
139
140
|
- `apex scan --mode pr --pr <number> [--pr <number>] [--pr-path <path>]`
|
|
140
141
|
- `apex scans`
|
|
141
142
|
- `apex findings [--scan <scan-id>]`
|
|
@@ -165,7 +166,7 @@ Helpful workspace flags:
|
|
|
165
166
|
- `--company <id-or-handle>` to choose the Apex company when more than one is available
|
|
166
167
|
- `--workspace-name <name>` to set the Apex workspace name for this directory
|
|
167
168
|
|
|
168
|
-
`apex credits` shows standard
|
|
169
|
+
`apex credits` shows standard, audit, fix review, and Lite scan entitlements when the server returns them.
|
|
169
170
|
|
|
170
171
|
## Service Keys And The Hosted API
|
|
171
172
|
|
|
@@ -278,7 +279,7 @@ Useful flags:
|
|
|
278
279
|
|
|
279
280
|
- `--repo <path>` to scan one or more explicit local roots instead of the current directory
|
|
280
281
|
- `--source-mode auto|remote|local` to control remote-first fallback behavior
|
|
281
|
-
- `--mode standard|audit|pr` to choose the scan mode
|
|
282
|
+
- `--mode standard|audit|lite|pr` to choose the scan mode
|
|
282
283
|
- `--pr <number>` to select one or more GitHub pull requests for `--mode pr`
|
|
283
284
|
- `--pr <number:path,path>` or `--pr-path <path>` to limit a PR scan to changed paths
|
|
284
285
|
|
|
@@ -286,6 +287,8 @@ Useful flags:
|
|
|
286
287
|
|
|
287
288
|
Audit scans use `audit` as the scan mode and still require provider-backed GitHub or GitLab repositories that Apex can materialize remotely without a local snapshot fallback. `ultra` remains accepted as a backwards-compatible alias.
|
|
288
289
|
|
|
290
|
+
Lite scans use `lite` as the scan mode and require the Lite Scan beta feature plus provider-backed GitHub or GitLab repositories that Apex can materialize remotely. Local snapshot uploads are not supported for Lite scans.
|
|
291
|
+
|
|
289
292
|
PR scans require exactly one provider-backed GitHub repository. If the current directory resolves to multiple sources, pass `--repo <path>` to select the one that contains the pull request.
|
|
290
293
|
|
|
291
294
|
## LLM / MCP Usage
|
|
@@ -382,6 +385,7 @@ The MCP server exposes Apex-specific tools for:
|
|
|
382
385
|
- doctor, credits, and provider connection URLs
|
|
383
386
|
- workspace inspection and workspace binding
|
|
384
387
|
- scan start, status, cancellation, findings, and findings export
|
|
388
|
+
- Lite scan start by calling `apex-scan` with `mode: "lite"`
|
|
385
389
|
- PR scan start by calling `apex-scan` with `mode: "pr"` and `pullRequests`
|
|
386
390
|
- finding comments and valid/invalid feedback with `apex-finding-comment` and `apex-finding-feedback`
|
|
387
391
|
- Fix PR and current-repository fix review scans with `apex-finding-fix-review`, optionally after `apex-finding-feedback`
|
|
@@ -425,7 +429,7 @@ Telemetry event posts do not include bearer tokens. The telemetry endpoint is `P
|
|
|
425
429
|
{
|
|
426
430
|
"schemaVersion": 1,
|
|
427
431
|
"event": "apex.invocation.completed",
|
|
428
|
-
"cliVersion": "0.1.
|
|
432
|
+
"cliVersion": "0.1.17",
|
|
429
433
|
"invocation": {
|
|
430
434
|
"surface": "mcp",
|
|
431
435
|
"command": "apex-scan",
|
|
@@ -456,7 +460,7 @@ The npm package also includes marketplace-ready plugin artifacts:
|
|
|
456
460
|
- `.claude-plugin/plugin.json` and `.mcp.claude.json` for Claude Code plugin installs
|
|
457
461
|
- `.claude-plugin/marketplace.json` for a Claude marketplace entry backed by the public npm package
|
|
458
462
|
|
|
459
|
-
These plugin installs launch the pinned npm package with `npx -y -p @cantinasecurity/apex-cli@0.1.
|
|
463
|
+
These plugin installs launch the pinned npm package with `npx -y -p @cantinasecurity/apex-cli@0.1.17 apex-mcp`, so users do not need to install `apex` globally before enabling the plugin.
|
|
460
464
|
|
|
461
465
|
The repository also includes `.agents/plugins/marketplace.json` for local Codex marketplace testing from a checkout.
|
|
462
466
|
|
package/dist/commands.js
CHANGED
|
@@ -184,6 +184,28 @@ function formatFixReviewScanBalance(scanBalance) {
|
|
|
184
184
|
}
|
|
185
185
|
return `Fix review scans: ${detailParts.join(", ")}`;
|
|
186
186
|
}
|
|
187
|
+
function formatLiteScanBalance(scanBalance) {
|
|
188
|
+
const purchased = getOptionalCount(scanBalance.litePurchased);
|
|
189
|
+
const used = getOptionalCount(scanBalance.liteUsed);
|
|
190
|
+
const remaining = getOptionalCount(scanBalance.liteRemaining);
|
|
191
|
+
const available = remaining ??
|
|
192
|
+
(purchased !== null && used !== null ? Math.max(0, purchased - used) : null);
|
|
193
|
+
if (purchased === null && used === null && available === null) {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
const detailParts = [];
|
|
197
|
+
if (purchased !== null) {
|
|
198
|
+
detailParts.push(`${purchased} purchased`);
|
|
199
|
+
}
|
|
200
|
+
if (used !== null) {
|
|
201
|
+
detailParts.push(`${used} used`);
|
|
202
|
+
}
|
|
203
|
+
if (available !== null) {
|
|
204
|
+
const detailSuffix = detailParts.length ? ` (${detailParts.join(", ")})` : "";
|
|
205
|
+
return `Lite scan credits: ${available} available${detailSuffix}`;
|
|
206
|
+
}
|
|
207
|
+
return `Lite scan credits: ${detailParts.join(", ")}`;
|
|
208
|
+
}
|
|
187
209
|
function normalizeRequestedScanMode(value) {
|
|
188
210
|
if (value === "ultra" || value === "audit") {
|
|
189
211
|
return "audit";
|
|
@@ -191,6 +213,9 @@ function normalizeRequestedScanMode(value) {
|
|
|
191
213
|
if (value === "pr") {
|
|
192
214
|
return "pr";
|
|
193
215
|
}
|
|
216
|
+
if (value === "lite") {
|
|
217
|
+
return "lite";
|
|
218
|
+
}
|
|
194
219
|
return "standard";
|
|
195
220
|
}
|
|
196
221
|
function getFlagValues(flags, key) {
|
|
@@ -574,6 +599,10 @@ export async function commandCredits(client, cwd, flags) {
|
|
|
574
599
|
if (redeemableFixReviewScans && redeemableFixReviewScans > 0) {
|
|
575
600
|
logLine(`Redeemable fix review scans from standard credits: ${redeemableFixReviewScans}`, flags);
|
|
576
601
|
}
|
|
602
|
+
const liteBalance = formatLiteScanBalance(payload.scanBalance);
|
|
603
|
+
if (liteBalance) {
|
|
604
|
+
logLine(liteBalance, flags);
|
|
605
|
+
}
|
|
577
606
|
logLine(`Scans enabled: ${payload.scansEnabled ? "yes" : "no"}`, flags);
|
|
578
607
|
return payload;
|
|
579
608
|
}
|
|
@@ -855,16 +884,17 @@ export async function commandScan(client, cwd, flags) {
|
|
|
855
884
|
},
|
|
856
885
|
}));
|
|
857
886
|
}
|
|
858
|
-
else if (requestedMode === "audit") {
|
|
887
|
+
else if (requestedMode === "audit" || requestedMode === "lite") {
|
|
888
|
+
const modeLabel = requestedMode === "audit" ? "Audit" : "Lite";
|
|
859
889
|
if (!supportsLegacyRemoteFlow(result.resolve.plannedSources)) {
|
|
860
|
-
throw new Error(
|
|
890
|
+
throw new Error(`${modeLabel} scans currently require provider-backed GitHub or GitLab repositories without local snapshot fallbacks.`);
|
|
861
891
|
}
|
|
862
|
-
const legacyResolve = await withLoadingIndicator(
|
|
892
|
+
const legacyResolve = await withLoadingIndicator(`Preparing ${modeLabel.toLowerCase()} scan...`, flags, () => resolveWorkspaceSelectionLegacy(client, selection, resolvedWorkspaceId));
|
|
863
893
|
if (!legacyResolve.workspaceId) {
|
|
864
894
|
throw new Error("Workspace resolution did not return a workspaceId.");
|
|
865
895
|
}
|
|
866
896
|
workspaceId = legacyResolve.workspaceId;
|
|
867
|
-
scan = await withLoadingIndicator(
|
|
897
|
+
scan = await withLoadingIndicator(`Starting ${modeLabel.toLowerCase()} scan...`, flags, () => client.request(`/api/cli/v1/local-workspaces/${encodeURIComponent(workspaceId)}/scan`, {
|
|
868
898
|
method: "POST",
|
|
869
899
|
json: {
|
|
870
900
|
mode: requestedMode,
|
package/dist/help.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const CLI_HELP_TEXT = `Usage:
|
|
2
2
|
apex Open the interactive Apex shell
|
|
3
|
-
apex credits Show
|
|
3
|
+
apex credits Show standard, audit, fix review, and Lite scan entitlements for the active company
|
|
4
4
|
apex scan Create or resolve a workspace for this directory and start a scan
|
|
5
5
|
apex scans List scans for the current workspace binding
|
|
6
6
|
apex findings List findings for the latest or selected scan
|
|
@@ -55,7 +55,7 @@ Flags:
|
|
|
55
55
|
Choose the export format for findings
|
|
56
56
|
--output <path> Write exported findings to this file path
|
|
57
57
|
--limit <count> Limit the number of findings returned
|
|
58
|
-
--mode standard|audit|pr
|
|
58
|
+
--mode standard|audit|lite|pr Choose the scan mode
|
|
59
59
|
--pr <number[:path,path]> Select a GitHub pull request for --mode pr
|
|
60
60
|
--pr-path <path> Limit a single-PR scan to a changed file path
|
|
61
61
|
--source-mode auto|remote|local Control remote-vs-local source materialization
|
|
@@ -71,6 +71,7 @@ Tips:
|
|
|
71
71
|
apex scan uses the current directory as the default source root unless you pass --repo.
|
|
72
72
|
PR scans require --mode pr and at least one --pr selection for a GitHub repository.
|
|
73
73
|
audit is the current scan mode for audit scans; ultra remains accepted as a legacy alias.
|
|
74
|
+
Lite scans use --mode lite and require beta access plus provider-backed GitHub or GitLab sources.
|
|
74
75
|
apex workspace use accepts a workspace name, prefix, or ID.
|
|
75
76
|
Finding comments, feedback, and fix review scans use the same Apex login credentials as other CLI commands.
|
|
76
77
|
Service-key commands require an existing login; run apex login first when needed.
|
|
@@ -87,8 +88,9 @@ Tips:
|
|
|
87
88
|
export const SHELL_HELP_TEXT = `Press Tab to autocomplete commands and common arguments.
|
|
88
89
|
|
|
89
90
|
Commands:
|
|
90
|
-
/credits Show
|
|
91
|
-
/scan [standard|audit]
|
|
91
|
+
/credits Show standard, audit, fix review, and Lite scan entitlements for the active company
|
|
92
|
+
/scan [standard|audit|lite]
|
|
93
|
+
Start a new Apex scan for this workspace
|
|
92
94
|
/scan pr <pr-number> Start a PR scan for this workspace
|
|
93
95
|
/scans List scans for this workspace
|
|
94
96
|
/findings [scan-id] List findings for the latest or selected scan
|
|
@@ -132,6 +134,7 @@ Scripted-only commands (run outside the interactive shell):
|
|
|
132
134
|
Tips:
|
|
133
135
|
PR scans require a GitHub PR number and provider-backed repository access.
|
|
134
136
|
audit is the current scan mode for audit scans; ultra remains accepted as a legacy alias.
|
|
137
|
+
Lite scans require beta access plus provider-backed GitHub or GitLab sources.
|
|
135
138
|
/workspace use accepts a workspace name, prefix, or ID.
|
|
136
139
|
/findings comment, /findings feedback, and /findings fix-review use the current Apex login.
|
|
137
140
|
Service-key commands automatically use your company when only one is available. With multiple companies, choose one interactively or pass --company.
|
package/dist/mcp.js
CHANGED
|
@@ -26,7 +26,7 @@ Notes:
|
|
|
26
26
|
- Finding write tools use the same Apex device-login credentials as read tools.
|
|
27
27
|
- Organization service-key creation, listing, and revocation are intentionally scripted-CLI-only and are not exposed as MCP tools. Never ask a user to paste a service key into an MCP prompt or tool call.
|
|
28
28
|
- HTTP-only serverless and cron integrations should use the hosted API documented at https://ai.cantina.xyz/docs/apex-api instead of launching this stdio server.
|
|
29
|
-
- Use mode "audit" for audit scans; "ultra" remains accepted as a legacy alias. Use mode "pr" for GitHub pull request scans.
|
|
29
|
+
- Use mode "audit" for audit scans; "ultra" remains accepted as a legacy alias. Use mode "lite" only for beta-enabled provider-backed Lite scans, and mode "pr" for GitHub pull request scans.
|
|
30
30
|
- Doctor reports whether Apex will use remote materialization or a local snapshot upload for each source.`;
|
|
31
31
|
const WORKSPACE_BINDING_ERROR = "This directory is not bound to an Apex workspace yet. Run `apex workspaces` to list workspace names, prefixes, and IDs, then bind one with `apex workspace use \"<workspace name>\"`, or run `apex scan` to create or resolve one automatically.";
|
|
32
32
|
const MISSING_PROVIDER_CONNECTIONS_ERROR = "Missing provider connections. Re-run interactively or pre-connect providers.";
|
|
@@ -292,7 +292,7 @@ function registerTools(server) {
|
|
|
292
292
|
}));
|
|
293
293
|
server.registerTool("apex-credits", {
|
|
294
294
|
title: "Get Apex Credits",
|
|
295
|
-
description: "Show scan credits plus audit
|
|
295
|
+
description: "Show scan credits plus audit, fix review, and Lite scan entitlements for the active or selected company.",
|
|
296
296
|
inputSchema: {
|
|
297
297
|
cwd: z.string().optional(),
|
|
298
298
|
company: z.string().optional(),
|
|
@@ -376,13 +376,13 @@ function registerTools(server) {
|
|
|
376
376
|
}));
|
|
377
377
|
server.registerTool("apex-scan", {
|
|
378
378
|
title: "Start Apex Scan",
|
|
379
|
-
description: "Start a new Apex scan for the provided cwd by default. Pass repoPaths only to scan explicit alternate local roots. Use mode audit for audit scans and mode pr for GitHub pull request scans.",
|
|
379
|
+
description: "Start a new Apex scan for the provided cwd by default. Pass repoPaths only to scan explicit alternate local roots. Use mode audit for audit scans, mode lite for beta-gated provider-backed Lite scans, and mode pr for GitHub pull request scans.",
|
|
380
380
|
inputSchema: {
|
|
381
381
|
cwd: z.string().optional(),
|
|
382
382
|
company: z.string().optional(),
|
|
383
383
|
workspaceName: z.string().optional(),
|
|
384
384
|
repoPaths: z.array(z.string()).optional(),
|
|
385
|
-
mode: z.enum(["standard", "audit", "ultra", "pr"]).optional(),
|
|
385
|
+
mode: z.enum(["standard", "audit", "ultra", "lite", "pr"]).optional(),
|
|
386
386
|
pullRequests: z
|
|
387
387
|
.array(z.object({
|
|
388
388
|
number: z.number().int().positive(),
|
package/dist/shell.js
CHANGED
|
@@ -7,7 +7,7 @@ import { formatApiError } from "./api-client.js";
|
|
|
7
7
|
import { createShellTelemetryInvocation, emitInvocationCompleted, emitInvocationStarted, withTelemetryContext, } from "./telemetry.js";
|
|
8
8
|
const SHELL_COMPLETIONS = [
|
|
9
9
|
{ command: "credits" },
|
|
10
|
-
{ command: "scan", args: ["standard", "audit", "ultra", "pr"] },
|
|
10
|
+
{ command: "scan", args: ["standard", "audit", "ultra", "lite", "pr"] },
|
|
11
11
|
{ command: "scans" },
|
|
12
12
|
{ command: "findings", args: ["comment", "feedback", "fix-review"] },
|
|
13
13
|
{ command: "export" },
|
|
@@ -195,8 +195,8 @@ async function runShellCommand(client, cwd, parsed, shellFlags, session) {
|
|
|
195
195
|
return {};
|
|
196
196
|
case "scan": {
|
|
197
197
|
const mode = parsed.args[0];
|
|
198
|
-
if (mode && !["standard", "audit", "ultra", "pr"].includes(mode)) {
|
|
199
|
-
process.stderr.write("Usage: /scan [standard|audit|ultra|pr] [pr-number]\n");
|
|
198
|
+
if (mode && !["standard", "audit", "ultra", "lite", "pr"].includes(mode)) {
|
|
199
|
+
process.stderr.write("Usage: /scan [standard|audit|ultra|lite|pr] [pr-number]\n");
|
|
200
200
|
return {};
|
|
201
201
|
}
|
|
202
202
|
const prNumber = mode === "pr" ? parsed.args[1] : null;
|
package/dist/telemetry.js
CHANGED
|
@@ -184,7 +184,13 @@ function sanitizeCliFlags(flags) {
|
|
|
184
184
|
contentProvided: stringFlag(flags, "content") !== null,
|
|
185
185
|
commentProvided: stringFlag(flags, "comment") !== null,
|
|
186
186
|
parentCommentProvided: stringFlag(flags, "parent-comment") !== null,
|
|
187
|
-
mode: safeEnum(stringFlag(flags, "mode"), [
|
|
187
|
+
mode: safeEnum(stringFlag(flags, "mode"), [
|
|
188
|
+
"standard",
|
|
189
|
+
"audit",
|
|
190
|
+
"ultra",
|
|
191
|
+
"lite",
|
|
192
|
+
"pr",
|
|
193
|
+
]),
|
|
188
194
|
sourceMode: safeEnum(stringFlag(flags, "source-mode"), ["auto", "remote", "local"]),
|
|
189
195
|
format: safeEnum(stringFlag(flags, "format"), ["markdown", "json", "gitlab-sast"]),
|
|
190
196
|
feedbackStatus: safeEnum(stringFlag(flags, "status"), ["valid", "invalid"]),
|
|
@@ -351,6 +357,7 @@ export function sanitizeMcpInput(input = {}) {
|
|
|
351
357
|
"standard",
|
|
352
358
|
"audit",
|
|
353
359
|
"ultra",
|
|
360
|
+
"lite",
|
|
354
361
|
"pr",
|
|
355
362
|
]),
|
|
356
363
|
sourceMode: safeEnum(typeof input.sourceMode === "string" ? input.sourceMode : null, [
|
|
@@ -538,7 +545,13 @@ export function createCliTelemetryInvocation(parsed) {
|
|
|
538
545
|
}
|
|
539
546
|
export function createShellTelemetryInvocation(parsed, flags) {
|
|
540
547
|
const shellMode = parsed.command === "scan"
|
|
541
|
-
? safeEnum(parsed.args[0] ?? "default", [
|
|
548
|
+
? safeEnum(parsed.args[0] ?? "default", [
|
|
549
|
+
"standard",
|
|
550
|
+
"audit",
|
|
551
|
+
"ultra",
|
|
552
|
+
"lite",
|
|
553
|
+
"pr",
|
|
554
|
+
]) ??
|
|
542
555
|
(parsed.args[0] ? "other" : "default")
|
|
543
556
|
: null;
|
|
544
557
|
return createInvocation({
|
package/package.json
CHANGED
package/skills/apex-cli/SKILL.md
CHANGED
|
@@ -23,9 +23,10 @@ Workflow:
|
|
|
23
23
|
4. Call `apex-doctor` before starting a scan if workspace binding or source planning might be unclear.
|
|
24
24
|
5. If the directory is not bound to the right workspace, call `apex-workspaces` and `apex-workspace-use`.
|
|
25
25
|
6. Use `apex-scan`, `apex-status`, `apex-scans`, `apex-findings`, and `apex-export-findings` for the scan lifecycle.
|
|
26
|
-
7. For
|
|
27
|
-
8.
|
|
28
|
-
9.
|
|
26
|
+
7. For Lite scans, call `apex-scan` with `mode: "lite"` only when the company has Lite Scan beta access and the sources are provider-backed.
|
|
27
|
+
8. For PR scans, call `apex-scan` with `mode: "pr"` and `pullRequests`.
|
|
28
|
+
9. Use `apex-finding-comment` and `apex-finding-feedback` when the user wants to leave review notes or valid/invalid feedback on a finding.
|
|
29
|
+
10. For fix reviews, call `apex-finding-fix-review`. Pass `fixPrUrls` for a PR-based review, or omit them to review the current repository state when Bedrock has original scan repository context.
|
|
29
30
|
|
|
30
31
|
Guidelines:
|
|
31
32
|
|
|
@@ -35,11 +36,12 @@ Guidelines:
|
|
|
35
36
|
- For a headless HTTP adapter, read the service key from a secret-backed environment variable, send it as a bearer token to `/api/apex/v1`, and redact it from errors and logs. Do not shell out to `apex` or launch MCP from the adapter.
|
|
36
37
|
- Hosted API v1 requires the GitHub repository to be linked to an active Apex workspace. It never creates or mutates workspaces; use optional `workspaceId` to disambiguate matches and treat zero or ambiguous matches as HTTP `409` setup errors.
|
|
37
38
|
- Hosted scan triggers require `Idempotency-Key`. Reuse one stable key only for an identical transport/timeout/5xx retry. After correcting a definitive 4xx response, or for any new intended scan, use a new key.
|
|
38
|
-
- `apex-credits` reports standard credits plus audit
|
|
39
|
+
- `apex-credits` reports standard credits plus audit, fix review, and Lite scan entitlements when Bedrock returns those balances.
|
|
39
40
|
- `apex-scan` scans the provided `cwd` by default; pass `repoPaths` only when the user asks to scan explicit alternate roots.
|
|
40
41
|
- `apex-doctor` reports whether Apex will use remote materialization or a local snapshot upload for each selected source.
|
|
41
42
|
- Apex can scan plain local directories and dirty git worktrees without provider connections by using local snapshot uploads.
|
|
42
43
|
- Audit scans use `mode: "audit"` in user-facing instructions and request payloads. The legacy `ultra` mode remains accepted as an alias, but audit scans still require provider-backed GitHub or GitLab sources.
|
|
44
|
+
- Lite scans use `mode: "lite"`, require Lite Scan beta access, and require provider-backed GitHub or GitLab sources without local snapshot fallback.
|
|
43
45
|
- PR scans use `mode: "pr"` and require one provider-backed GitHub repository plus one or more `pullRequests`.
|
|
44
46
|
- `apex-workspace-use` accepts a workspace name, prefix, or ID.
|
|
45
47
|
- Use `sourceMode: "remote"` only when the user explicitly wants to forbid local snapshot fallbacks.
|