@cantinasecurity/apex-cli 0.1.16 → 0.1.18
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 +33 -11
- 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 +109 -8
- package/dist/apex.js +15 -1
- package/dist/api-client.js +255 -35
- package/dist/args.js +8 -1
- package/dist/auth.js +171 -54
- package/dist/claim-proof.js +65 -0
- package/dist/commands.js +287 -23
- package/dist/config.js +357 -23
- package/dist/findings.js +50 -9
- package/dist/help.js +21 -5
- package/dist/local-source-scan.js +200 -24
- package/dist/mcp.js +132 -23
- package/dist/onboarding.js +661 -0
- package/dist/redaction.js +34 -0
- package/dist/session.js +10 -1
- package/dist/shell.js +13 -6
- package/dist/telemetry.js +98 -14
- package/dist/workspace-binding.js +16 -6
- package/package.json +3 -1
- package/skills/apex-cli/SKILL.md +45 -11
|
@@ -17,21 +17,40 @@ For serverless, cron, or other HTTP-only integrations, use the hosted Apex REST
|
|
|
17
17
|
|
|
18
18
|
For on-prem or other non-default Apex hosts, make sure the CLI or MCP server runs with `APEX_BASE_URL` set to the external HTTPS Bedrock origin before auth or provider connection flows.
|
|
19
19
|
|
|
20
|
+
When the user provides a Cantina trial code, redemption is the one deliberate
|
|
21
|
+
terminal exception to the MCP-first workflow. From the repository root, run
|
|
22
|
+
`apex redeem <code> --json`; do not start device login. The code is secret:
|
|
23
|
+
send it only to `apex redeem`; never echo or restate it, save it, or place it in an MCP
|
|
24
|
+
tool call or result. Trial redemption, claim, and revocation are hosted-only;
|
|
25
|
+
stop before passing the code when `APEX_BASE_URL` has any origin other than
|
|
26
|
+
`https://ai.cantina.xyz`. Only when the first attempt has an ambiguous
|
|
27
|
+
transport/connection failure or interrupted/missing response with no typed
|
|
28
|
+
server error may you retry that exact same command once on the same machine,
|
|
29
|
+
HOME, and repository root. Never retry a typed server rejection or make more
|
|
30
|
+
than one recovery retry. Continue only for `redeemed` or `idempotent` outcomes.
|
|
31
|
+
|
|
20
32
|
Recommended workflow:
|
|
21
33
|
|
|
22
34
|
1. Start with `apex-auth-status`.
|
|
23
|
-
2.
|
|
24
|
-
3.
|
|
25
|
-
4.
|
|
26
|
-
5.
|
|
27
|
-
6.
|
|
28
|
-
7.
|
|
29
|
-
8.
|
|
30
|
-
9. For
|
|
35
|
+
2. Always call `apex-trial-status` next, even when account authentication succeeded. When `claimAvailable` is true, do not call `apex-auth-start`; tell the user to run `apex claim` in a terminal first so the trial workspace, scans, and findings are kept. When the claim deadline has passed and `claimAvailable` is false, continue normal account authentication instead of steering the user to an expired claim.
|
|
36
|
+
3. Only when Apex is unauthenticated, no unexpired claim proof is available, and no trial code was supplied, call `apex-auth-start`, ask the user to approve the device-login URL, then call `apex-auth-wait` with both the returned `deviceCode` and opaque `credentialGeneration`. If the wait is superseded, keep the current credential state and re-check `apex-auth-status` before starting another login.
|
|
37
|
+
4. For repository-scoped work, pass `cwd` explicitly.
|
|
38
|
+
5. Call `apex-doctor` before starting a scan if workspace binding or source planning might be unclear.
|
|
39
|
+
6. If the directory is not bound to the right workspace, call `apex-workspaces` and `apex-workspace-use`.
|
|
40
|
+
7. Use `apex-scan`, `apex-status`, `apex-scans`, `apex-findings`, and `apex-export-findings` for the scan lifecycle.
|
|
41
|
+
8. For Lite scans, call `apex-scan` with `mode: "lite"` only when the company has Lite Scan beta access and the sources are provider-backed.
|
|
42
|
+
9. For PR scans, call `apex-scan` with `mode: "pr"` and `pullRequests`.
|
|
43
|
+
10. Use `apex-finding-comment` and `apex-finding-feedback` when the user wants to leave review notes or valid/invalid feedback on a finding.
|
|
44
|
+
11. 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
45
|
|
|
32
46
|
If the Apex MCP server is not configured, fall back to the local CLI:
|
|
33
47
|
|
|
34
48
|
- Prefer scripted commands over the interactive shell.
|
|
49
|
+
- A trial redeem with an ambiguous transport or response-loss failure may be retried exactly once with the same code, machine, HOME, and repository root. Never retry a typed server rejection or use `--replace` for response-loss recovery.
|
|
50
|
+
- After a successful scan JSON response, inspect `localPersistence.workspaceBindingSaved`. If it is `false`, the server scan already started: capture and report `binding.lastScanId`, then STOP; do not run status or findings until local repository permissions are repaired.
|
|
51
|
+
- `apex-trial-status` is MCP-only; do not invoke it as a CLI command. In a CLI-only flow, use the `claimDeadline` returned by `apex redeem <code> --json` without repeating or persisting the secret code.
|
|
52
|
+
- After a guest scan, tell the user to run `apex claim` on the same machine before that returned claim deadline. If the deadline is unavailable or uncertain, do not guess or start a replacement login; run `apex claim` and let the server validate the proof.
|
|
53
|
+
- Claim currently requires a Cantina account that does not already own a personal Apex tenant. If the user already completed Cantina Apex onboarding, explain that CLI linking is not available yet and tell them to contact Cantina support before the claim deadline.
|
|
35
54
|
- Service-key management has no MCP tools. Never ask a user to paste a service key into a prompt, and never place one in an MCP call, tool result, source file, or log.
|
|
36
55
|
- If a user explicitly needs a new service key, tell them to run `apex login` if needed, then run `apex service-key create --name <name> --scope <scope[,scope]>` directly in their own terminal. Use only the required scopes: `scans:create` to trigger, `scans:read` to poll status, and `findings:read` to retrieve findings. A P1-only adapter can use `--scope scans:read,findings:read`; omitting `--scope` grants all three. The CLI automatically selects the company when only one is available and prompts when there are several; use `--company <id-or-handle>` to skip that prompt or resolve a non-interactive command. Service-key commands never initiate login, and the secret is shown once.
|
|
37
56
|
- 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.
|
|
@@ -39,18 +58,19 @@ If the Apex MCP server is not configured, fall back to the local CLI:
|
|
|
39
58
|
- 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
59
|
- Use `--non-interactive` and `--no-open` for automation-friendly CLI calls.
|
|
41
60
|
- Use `--json` whenever structured output is helpful.
|
|
42
|
-
- `apex credits` reports standard credits plus audit
|
|
61
|
+
- `apex credits` reports standard credits plus audit, fix review, and Lite scan entitlements when Bedrock returns those balances.
|
|
43
62
|
- Work from the target repository directory so Apex can resolve `.apex/workspace.json`.
|
|
44
63
|
- `apex scan` scans the current working directory by default; pass `--repo` only when the user asks to scan explicit alternate roots.
|
|
45
64
|
- `apex-doctor` reports whether Apex will use remote materialization or a local snapshot upload for each selected source.
|
|
46
65
|
- Plain local directories and dirty git worktrees can scan through local snapshot uploads without provider access.
|
|
47
66
|
- 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.
|
|
67
|
+
- 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
68
|
- 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
69
|
- `apex-workspace-use` accepts a workspace name, prefix, or ID.
|
|
50
70
|
- Use `sourceMode: "remote"` only when the user explicitly wants to forbid local snapshot fallbacks.
|
|
51
71
|
- When checking a scan that is not the workspace binding's latest scan, pass `scanId` to `apex-status`; use `apex scans` or `apex-scans` first if you need to discover scan IDs.
|
|
52
|
-
- Finding comments, feedback, and fix review scan starts use the same Apex device-login credentials as read tools. If a write tool reports missing auth, re-run `apex-auth-status` and complete `apex-auth-start` / `apex-auth-wait` instead of asking for browser cookies or auth tokens.
|
|
53
|
-
- Anonymous telemetry records only sanitized command/tool metadata such as command names, enum modes, counts, durations, success/failure categories, CLI version, and client integration. It must not include raw repository paths, scan IDs, finding IDs, comments, file paths, PR URLs, or tokens.
|
|
72
|
+
- Finding comments, feedback, and fix review scan starts use the same Apex device-login credentials as read tools. If a write tool reports missing auth, re-run `apex-auth-status`, check `apex-trial-status`, and complete `apex-auth-start` / `apex-auth-wait` only when no unexpired local claim proof is available, instead of asking for browser cookies or auth tokens.
|
|
73
|
+
- Anonymous telemetry records only sanitized command/tool metadata such as command names, enum modes, counts, durations, success/failure categories, CLI version, and client integration. It must not include raw repository paths, scan IDs, finding IDs, comments, file paths, PR URLs, trial codes, claim tokens, onboarding fingerprints, or bearer tokens.
|
|
54
74
|
- Invalid finding feedback requires `dismissalReason`; valid feedback can include `suggestedSeverity`, including `extreme`.
|
|
55
75
|
- PR-based fix reviews can pass `fixPrUrls` directly to `apex-finding-fix-review`; agents that also need to record fixed feedback can first call `apex-finding-feedback` with `status: "valid"`, `labels: ["fixed"]`, and `fixPrUrls`.
|
|
56
76
|
- Current-repository fix reviews omit `fixPrUrls` and require Bedrock original scan repository context for the finding.
|
|
@@ -58,7 +78,9 @@ If the Apex MCP server is not configured, fall back to the local CLI:
|
|
|
58
78
|
|
|
59
79
|
## Examples
|
|
60
80
|
|
|
81
|
+
- Redeem a supplied trial code: run `apex redeem <code> --json` in a terminal, continue with MCP only after a `redeemed` or `idempotent` outcome, then check `apex-trial-status` and remind the user about `apex claim` after findings only while `claimAvailable` remains true.
|
|
61
82
|
- Start a scan for the current repository or directory: run `apex-doctor`, bind a workspace if needed, then call `apex-scan`.
|
|
83
|
+
- Start a Lite scan: call `apex-scan` with `mode: "lite"` after confirming beta access and provider-backed sources.
|
|
62
84
|
- Start a PR scan: call `apex-scan` with `mode: "pr"` and `pullRequests`.
|
|
63
85
|
- 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
86
|
- 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.18"
|
|
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.18"
|
|
18
18
|
},
|
|
19
19
|
"description": "Run Apex security scans and review findings from Claude Code.",
|
|
20
|
-
"version": "0.1.
|
|
20
|
+
"version": "0.1.18",
|
|
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.18 apex-mcp
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
That keeps marketplace installs independent of a user's global `apex` install.
|
package/README.md
CHANGED
|
@@ -56,6 +56,10 @@ pnpm install
|
|
|
56
56
|
|
|
57
57
|
MCP registrations keep working across package updates because they point at the stable `apex-mcp` shim. Re-run `apex setup` after upgrading if you want to refresh copied skill files, and run `apex setup claude` in each repository where you want the Claude project skill.
|
|
58
58
|
|
|
59
|
+
Restart any already-running MCP client after an Apex CLI upgrade before using
|
|
60
|
+
trial redemption or claim. A process that loaded an older credential writer
|
|
61
|
+
cannot adopt the new merge and generation-safety rules until it restarts.
|
|
62
|
+
|
|
59
63
|
When `apex` is run in an interactive terminal, it checks for updates periodically and offers to install them.
|
|
60
64
|
|
|
61
65
|
## Local Development
|
|
@@ -83,6 +87,95 @@ public origin for GitHub callback and success redirects.
|
|
|
83
87
|
APEX_BASE_URL=https://bedrock.customer.example pnpm apex
|
|
84
88
|
```
|
|
85
89
|
|
|
90
|
+
## Try Apex With A Trial Code
|
|
91
|
+
|
|
92
|
+
A Cantina-issued trial code can start a temporary guest scan without a Cantina
|
|
93
|
+
account, browser, or device login. Redeem it from the repository root, run the
|
|
94
|
+
normal scan lifecycle, and create a Cantina account only after reviewing the
|
|
95
|
+
findings:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
apex redeem SPBT-DEVREL-XXXXXXXX --json
|
|
99
|
+
apex scan --non-interactive --json
|
|
100
|
+
apex status --json
|
|
101
|
+
apex findings --json
|
|
102
|
+
apex claim
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`apex redeem` never opens a browser. It saves a machine-local onboarding
|
|
106
|
+
fingerprint before the first request, exchanges the code for a seven-day guest
|
|
107
|
+
session, and stores the single-use claim proof only in the mode-0600 Apex
|
|
108
|
+
credentials file. A one-way code hash distinguishes safe same-code retries
|
|
109
|
+
without retaining the trial code. `apex claim` is the one onboarding command
|
|
110
|
+
that may open a browser; it creates or signs into a Cantina account, then
|
|
111
|
+
attaches the existing workspace, scans, and findings to that account. Run it on
|
|
112
|
+
the same machine within 30 days. Unclaimed guest data is retained only for the
|
|
113
|
+
limited period disclosed during redemption and is then queued for deletion.
|
|
114
|
+
Currently, the account used for claim must not already own a personal Apex
|
|
115
|
+
tenant. If you already completed Cantina Apex onboarding, the CLI cannot link
|
|
116
|
+
the guest tenant to that account yet; contact Cantina support before the claim
|
|
117
|
+
deadline.
|
|
118
|
+
Trial redemption, claim, and revocation are hosted-only and fail before sending
|
|
119
|
+
any onboarding secret when `APEX_BASE_URL` is not `https://ai.cantina.xyz`.
|
|
120
|
+
|
|
121
|
+
If the local claim proof is lost while the seven-day guest session is still
|
|
122
|
+
active, run `apex redeem <the-same-code>` again on the same machine to rotate
|
|
123
|
+
the guest credentials and re-mint the claim proof over the authenticated guest
|
|
124
|
+
channel. After the guest session expires, Apex cannot safely recover a lost
|
|
125
|
+
claim proof from the public trial code and machine fingerprint alone.
|
|
126
|
+
|
|
127
|
+
If the current credentials already belong to a real account, `apex redeem`
|
|
128
|
+
exits with code 2 and `outcome: "already_authenticated"`; it never silently
|
|
129
|
+
spends that account's credits. Re-redeeming the same code on the same machine
|
|
130
|
+
is idempotent while the guest session remains active. A different active trial
|
|
131
|
+
requires the explicit `--replace` flag, which revokes the outgoing guest
|
|
132
|
+
session before redeeming the new code.
|
|
133
|
+
|
|
134
|
+
Logging out of an active guest trial, or discarding a proof-only trial stub,
|
|
135
|
+
requires explicit confirmation (`apex logout --force` in non-interactive
|
|
136
|
+
flows). Apex first attempts a proof-bound server revoke; an explicitly
|
|
137
|
+
confirmed logout may discard a stale local proof when the server can no longer
|
|
138
|
+
verify it. Logging out of a separately authenticated account preserves any
|
|
139
|
+
unclaimed local trial proof so `apex claim` can still use it.
|
|
140
|
+
|
|
141
|
+
Agent-safe copy/paste prompt (substitute the issued code):
|
|
142
|
+
|
|
143
|
+
```text
|
|
144
|
+
Install and run Cantina Apex CLI 0.1.18 to start one free standard security scan of this repository immediately.
|
|
145
|
+
|
|
146
|
+
Use this trial code only where <TRIAL_CODE> appears below: SPBT-DEVREL-XXXXXXXX
|
|
147
|
+
|
|
148
|
+
Run the commands yourself from the repository root; do not stop after setup or only explain the steps. Use terminal CLI commands only. Do not use an Apex MCP tool or run `apex setup`, `apex mcp`, `apex login`, `apex-auth-start`, or `apex-auth-wait`. Never use `--replace` or `--force`.
|
|
149
|
+
|
|
150
|
+
Use this exact command prefix for every Apex command:
|
|
151
|
+
npx -y -p @cantinasecurity/apex-cli@0.1.18 apex
|
|
152
|
+
|
|
153
|
+
1. Before redeeming, confirm every command will use the same persistent, user-accessible machine or container, HOME, filesystem, and repository root. Confirm Node.js 20+ and npx are available. If `APEX_BASE_URL` is set, continue only when its origin is `https://ai.cantina.xyz`. Run the exact prefix with `--help` and continue only if help lists both `redeem` and `claim`. If any check fails, STOP before sending the code; do not install system packages.
|
|
154
|
+
2. Redeem, with at most one response-loss recovery retry:
|
|
155
|
+
npx -y -p @cantinasecurity/apex-cli@0.1.18 apex redeem <TRIAL_CODE> --json
|
|
156
|
+
This terminal command is the only allowed tool call containing the code. Never echo or restate the code, store it in a file or environment variable, put it in a URL or MCP call, or include it in your response. Continue when the command exits 0 and stdout is JSON with `redeemed: true` and `outcome` equal to `redeemed` or `idempotent`. If and only if the first attempt ends with an ambiguous transport/connection failure or an interrupted/missing response and no typed server error code, retry this exact same command once on the same machine, HOME, and repository root. Never retry a typed server rejection and never make more than one recovery retry. If the allowed retry does not return a successful JSON outcome, STOP.
|
|
157
|
+
3. Immediately start exactly one scan; do not wait for another instruction:
|
|
158
|
+
npx -y -p @cantinasecurity/apex-cli@0.1.18 apex scan --mode standard --non-interactive --no-open --json
|
|
159
|
+
On any error or nonzero exit, STOP. After a successful scan JSON response, inspect `localPersistence.workspaceBindingSaved`. If it is `false`, the server scan already started: capture and report `binding.lastScanId`, then STOP; do not run status or findings until local repository permissions are repaired. Otherwise capture `binding.lastScanId` from the JSON as <SCAN_ID>; if it is absent, STOP.
|
|
160
|
+
4. About every 60 seconds, poll that exact scan:
|
|
161
|
+
npx -y -p @cantinasecurity/apex-cli@0.1.18 apex status --scan <SCAN_ID> --json
|
|
162
|
+
Read `progress.progress.status`. Wait while it is `created`, `pending`, `queued`, `starting`, `running`, `in_progress`, or `processing`. Continue on `completed`. STOP on `failed`, `cancelled`, a missing or unknown status, or a command failure.
|
|
163
|
+
5. Fetch that exact scan's findings:
|
|
164
|
+
npx -y -p @cantinasecurity/apex-cli@0.1.18 apex findings --scan <SCAN_ID> --json
|
|
165
|
+
On success, summarize findings by severity, most severe first, including identifier, title, status, and confidence. This command does not return file locations, so do not invent them. On failure, STOP.
|
|
166
|
+
6. Do not claim automatically. Tell me the claim deadline from step 2 and remind me to run this exact command myself from the same repository root, machine, and HOME:
|
|
167
|
+
npx -y -p @cantinasecurity/apex-cli@0.1.18 apex claim
|
|
168
|
+
It may open a browser so I can create or sign in to a Cantina account and keep the results. The account must not already own a personal Apex tenant; if it does, tell me to contact Cantina support before the claim deadline because CLI linking is not available yet.
|
|
169
|
+
|
|
170
|
+
Never paste raw command transcripts. For any failure, report only the step, exit code, and sanitized error. Redact the trial code and every `apex_at_`, `apex_rt_`, or `apex_ct_` value from all reports.
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Trial codes and claim tokens must never be logged, telemetered, printed in JSON
|
|
174
|
+
output, placed in URLs, or sent through MCP tool calls. The MCP server does not
|
|
175
|
+
expose redemption or claim tools. After terminal redemption, its read-only
|
|
176
|
+
`apex-trial-status` tool can report local guest and claim deadlines without
|
|
177
|
+
returning either secret.
|
|
178
|
+
|
|
86
179
|
## Interactive Shell
|
|
87
180
|
|
|
88
181
|
Bare `apex` opens the interactive shell:
|
|
@@ -103,7 +196,7 @@ If Apex asks for a workspace name, that is the Apex workspace name for the curre
|
|
|
103
196
|
Supported shell commands:
|
|
104
197
|
|
|
105
198
|
- `/credits`
|
|
106
|
-
- `/scan [standard|audit]`
|
|
199
|
+
- `/scan [standard|audit|lite]`
|
|
107
200
|
- `/scan pr <pr-number>`
|
|
108
201
|
- `/scans`
|
|
109
202
|
- `/findings [scan-id]`
|
|
@@ -117,6 +210,7 @@ Supported shell commands:
|
|
|
117
210
|
- `/status [scan-id]`
|
|
118
211
|
- `/doctor`
|
|
119
212
|
- `/update`
|
|
213
|
+
- `/claim`
|
|
120
214
|
- `/logout`
|
|
121
215
|
- `/repos`
|
|
122
216
|
- `/workspace`
|
|
@@ -136,6 +230,7 @@ Supported shell commands:
|
|
|
136
230
|
|
|
137
231
|
- `apex credits`
|
|
138
232
|
- `apex scan`
|
|
233
|
+
- `apex scan --mode lite`
|
|
139
234
|
- `apex scan --mode pr --pr <number> [--pr <number>] [--pr-path <path>]`
|
|
140
235
|
- `apex scans`
|
|
141
236
|
- `apex findings [--scan <scan-id>]`
|
|
@@ -150,6 +245,8 @@ Supported shell commands:
|
|
|
150
245
|
- `apex status [--scan <scan-id>]`
|
|
151
246
|
- `apex doctor`
|
|
152
247
|
- `apex login`
|
|
248
|
+
- `apex redeem <code> [--json] [--replace]`
|
|
249
|
+
- `apex claim [--json] [--no-open]`
|
|
153
250
|
- `apex logout`
|
|
154
251
|
- `apex service-key create --name <name> [--company <id-or-handle>] [--scope <scope[,scope]>] [--expires-at <ISO-8601>] [--json]`
|
|
155
252
|
- `apex service-key list [--company <id-or-handle>] [--json]`
|
|
@@ -165,7 +262,7 @@ Helpful workspace flags:
|
|
|
165
262
|
- `--company <id-or-handle>` to choose the Apex company when more than one is available
|
|
166
263
|
- `--workspace-name <name>` to set the Apex workspace name for this directory
|
|
167
264
|
|
|
168
|
-
`apex credits` shows standard
|
|
265
|
+
`apex credits` shows standard, audit, fix review, and Lite scan entitlements when the server returns them.
|
|
169
266
|
|
|
170
267
|
## Service Keys And The Hosted API
|
|
171
268
|
|
|
@@ -253,7 +350,7 @@ Finding review collaboration now has explicit write commands:
|
|
|
253
350
|
|
|
254
351
|
Identifiers such as `KERN2-25` are resolved against the selected or latest scan for the current workspace binding. Pass `--scan <scan-id>` when you need a specific scan, or pass the finding UUID directly to skip workspace-based resolution.
|
|
255
352
|
|
|
256
|
-
Finding comments, valid/invalid feedback, and fix review scan starts use the same Apex login credentials as read commands. In MCP clients, `apex-auth-start`
|
|
353
|
+
Finding comments, valid/invalid feedback, and fix review scan starts use the same Apex login credentials as read commands. In MCP clients, call `apex-auth-start`, then pass both its returned `deviceCode` and opaque `credentialGeneration` to `apex-auth-wait` to authenticate these write tools safely.
|
|
257
354
|
|
|
258
355
|
Invalid feedback requires a dismissal reason. Valid feedback can include `--suggested-severity extreme|critical|high|medium|low|informational`.
|
|
259
356
|
|
|
@@ -278,7 +375,7 @@ Useful flags:
|
|
|
278
375
|
|
|
279
376
|
- `--repo <path>` to scan one or more explicit local roots instead of the current directory
|
|
280
377
|
- `--source-mode auto|remote|local` to control remote-first fallback behavior
|
|
281
|
-
- `--mode standard|audit|pr` to choose the scan mode
|
|
378
|
+
- `--mode standard|audit|lite|pr` to choose the scan mode
|
|
282
379
|
- `--pr <number>` to select one or more GitHub pull requests for `--mode pr`
|
|
283
380
|
- `--pr <number:path,path>` or `--pr-path <path>` to limit a PR scan to changed paths
|
|
284
381
|
|
|
@@ -286,6 +383,8 @@ Useful flags:
|
|
|
286
383
|
|
|
287
384
|
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
385
|
|
|
386
|
+
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.
|
|
387
|
+
|
|
289
388
|
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
389
|
|
|
291
390
|
## LLM / MCP Usage
|
|
@@ -379,14 +478,16 @@ Do not point an MCP client at plain `pnpm mcp`. `pnpm` writes its script banner
|
|
|
379
478
|
The MCP server exposes Apex-specific tools for:
|
|
380
479
|
|
|
381
480
|
- auth status and device login
|
|
481
|
+
- local guest-session deadlines through `apex-trial-status` (never the code or claim token)
|
|
382
482
|
- doctor, credits, and provider connection URLs
|
|
383
483
|
- workspace inspection and workspace binding
|
|
384
484
|
- scan start, status, cancellation, findings, and findings export
|
|
485
|
+
- Lite scan start by calling `apex-scan` with `mode: "lite"`
|
|
385
486
|
- PR scan start by calling `apex-scan` with `mode: "pr"` and `pullRequests`
|
|
386
487
|
- finding comments and valid/invalid feedback with `apex-finding-comment` and `apex-finding-feedback`
|
|
387
488
|
- Fix PR and current-repository fix review scans with `apex-finding-fix-review`, optionally after `apex-finding-feedback`
|
|
388
489
|
|
|
389
|
-
The MCP server does not expose service-key creation, listing, or revocation. For HTTP-only serverless and cron integrations, use the [hosted Apex API](https://ai.cantina.xyz/docs/apex-api) directly instead of launching the stdio MCP server.
|
|
490
|
+
The MCP server does not expose trial redemption, trial claim, or service-key creation, listing, or revocation. When a user supplies a Cantina trial code, run `apex redeem <code>` in a terminal instead of starting device login or putting the code in an MCP call. For HTTP-only serverless and cron integrations, use the [hosted Apex API](https://ai.cantina.xyz/docs/apex-api) directly instead of launching the stdio MCP server.
|
|
390
491
|
|
|
391
492
|
For repository-scoped operations, pass `cwd` explicitly so the server can resolve the right `.apex/workspace.json` binding and repository roots.
|
|
392
493
|
|
|
@@ -415,7 +516,7 @@ APEX_TELEMETRY_DISABLED=1 apex scan
|
|
|
415
516
|
|
|
416
517
|
Telemetry records lifecycle events such as command/tool start and completion, duration, success/failure category, CLI version, Node/platform basics, anonymous install/session IDs, and sanitized command metadata. It also adds attribution headers to Apex API requests, including surface (`cli`, `interactive_shell`, or `mcp`), client integration, invocation ID, command/tool name, and CLI version.
|
|
417
518
|
|
|
418
|
-
Telemetry does not send raw cwd paths, repository URLs, finding IDs, scan IDs, PR URLs, comments, file paths, tokens, or raw flag values. Sensitive inputs are reduced to booleans, counts, enum values, or length buckets.
|
|
519
|
+
Telemetry does not send raw cwd paths, repository URLs, finding IDs, scan IDs, PR URLs, comments, file paths, trial codes, claim tokens, onboarding fingerprints, bearer tokens, or raw flag values. Sensitive inputs are reduced to booleans, counts, enum values, or length buckets.
|
|
419
520
|
|
|
420
521
|
Telemetry event posts do not include bearer tokens. The telemetry endpoint is `POST /api/cli/v1/telemetry/events` with a batch payload:
|
|
421
522
|
|
|
@@ -425,7 +526,7 @@ Telemetry event posts do not include bearer tokens. The telemetry endpoint is `P
|
|
|
425
526
|
{
|
|
426
527
|
"schemaVersion": 1,
|
|
427
528
|
"event": "apex.invocation.completed",
|
|
428
|
-
"cliVersion": "0.1.
|
|
529
|
+
"cliVersion": "0.1.18",
|
|
429
530
|
"invocation": {
|
|
430
531
|
"surface": "mcp",
|
|
431
532
|
"command": "apex-scan",
|
|
@@ -456,7 +557,7 @@ The npm package also includes marketplace-ready plugin artifacts:
|
|
|
456
557
|
- `.claude-plugin/plugin.json` and `.mcp.claude.json` for Claude Code plugin installs
|
|
457
558
|
- `.claude-plugin/marketplace.json` for a Claude marketplace entry backed by the public npm package
|
|
458
559
|
|
|
459
|
-
These plugin installs launch the pinned npm package with `npx -y -p @cantinasecurity/apex-cli@0.1.
|
|
560
|
+
These plugin installs launch the pinned npm package with `npx -y -p @cantinasecurity/apex-cli@0.1.18 apex-mcp`, so users do not need to install `apex` globally before enabling the plugin.
|
|
460
561
|
|
|
461
562
|
The repository also includes `.agents/plugins/marketplace.json` for local Codex marketplace testing from a checkout.
|
|
462
563
|
|
package/dist/apex.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApexApiClient, formatApiError } from "./api-client.js";
|
|
2
2
|
import { parseArgs } from "./args.js";
|
|
3
|
-
import { commandCancelScan, commandConnect, commandCredits, commandDoctor, commandExportFindings, commandFindingComment, commandFindingFeedback, commandFindingFixReview, commandFindings, commandLogin, commandLogout, commandScan, commandScans, commandServiceKeyCreate, commandServiceKeyList, commandServiceKeyRevoke, commandSetup, commandStatus, commandTelemetry, commandUpdate, commandWorkspace, commandWorkspaceUse, commandWorkspaces, } from "./commands.js";
|
|
3
|
+
import { commandCancelScan, commandClaim, commandConnect, commandCredits, commandDoctor, commandExportFindings, commandFindingComment, commandFindingFeedback, commandFindingFixReview, commandFindings, commandLogin, commandLogout, commandRedeem, commandScan, commandScans, commandServiceKeyCreate, commandServiceKeyList, commandServiceKeyRevoke, commandSetup, commandStatus, commandTelemetry, commandUpdate, commandWorkspace, commandWorkspaceUse, commandWorkspaces, getRedeemExitCode, } from "./commands.js";
|
|
4
4
|
import { CLI_HELP_TEXT } from "./help.js";
|
|
5
5
|
import { runMcpServer } from "./mcp.js";
|
|
6
6
|
import { runInteractiveShell } from "./shell.js";
|
|
@@ -36,6 +36,20 @@ async function dispatch(parsed) {
|
|
|
36
36
|
case "login":
|
|
37
37
|
await commandLogin(client, parsed.flags);
|
|
38
38
|
return;
|
|
39
|
+
case "redeem": {
|
|
40
|
+
if (parsed.args.length > 0) {
|
|
41
|
+
throw new Error("Usage: apex redeem [trial-code] [--replace] [--json]");
|
|
42
|
+
}
|
|
43
|
+
const result = await commandRedeem(client, parsed.flags, parsed.subcommand);
|
|
44
|
+
process.exitCode = getRedeemExitCode(result);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
case "claim":
|
|
48
|
+
if (parsed.subcommand || parsed.args.length > 0) {
|
|
49
|
+
throw new Error("Usage: apex claim [--json] [--no-open]");
|
|
50
|
+
}
|
|
51
|
+
await commandClaim(client, cwd, parsed.flags);
|
|
52
|
+
return;
|
|
39
53
|
case "logout":
|
|
40
54
|
await commandLogout(client, parsed.flags);
|
|
41
55
|
return;
|