@cantinasecurity/apex-cli 0.1.17 → 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.
@@ -17,22 +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. If Apex is unauthenticated, call `apex-auth-start`, ask the user to approve the device-login URL, then call `apex-auth-wait` with the returned `deviceCode`.
24
- 3. For repository-scoped work, pass `cwd` explicitly.
25
- 4. Call `apex-doctor` before starting a scan if workspace binding or source planning might be unclear.
26
- 5. If the directory is not bound to the right workspace, call `apex-workspaces` and `apex-workspace-use`.
27
- 6. Use `apex-scan`, `apex-status`, `apex-scans`, `apex-findings`, and `apex-export-findings` for the scan lifecycle.
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.
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.
32
45
 
33
46
  If the Apex MCP server is not configured, fall back to the local CLI:
34
47
 
35
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.
36
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.
37
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.
38
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.
@@ -51,8 +69,8 @@ If the Apex MCP server is not configured, fall back to the local CLI:
51
69
  - `apex-workspace-use` accepts a workspace name, prefix, or ID.
52
70
  - Use `sourceMode: "remote"` only when the user explicitly wants to forbid local snapshot fallbacks.
53
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.
54
- - 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.
55
- - 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.
56
74
  - Invalid finding feedback requires `dismissalReason`; valid feedback can include `suggestedSeverity`, including `extreme`.
57
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`.
58
76
  - Current-repository fix reviews omit `fixPrUrls` and require Bedrock original scan repository context for the finding.
@@ -60,6 +78,7 @@ If the Apex MCP server is not configured, fall back to the local CLI:
60
78
 
61
79
  ## Examples
62
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.
63
82
  - Start a scan for the current repository or directory: run `apex-doctor`, bind a workspace if needed, then call `apex-scan`.
64
83
  - Start a Lite scan: call `apex-scan` with `mode: "lite"` after confirming beta access and provider-backed sources.
65
84
  - Start a PR scan: call `apex-scan` with `mode: "pr"` and `pullRequests`.
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Cantina agent plugins for security review workflows.",
9
- "version": "0.1.17"
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"
17
+ "version": "0.1.18"
18
18
  },
19
19
  "description": "Run Apex security scans and review findings from Claude Code.",
20
- "version": "0.1.17",
20
+ "version": "0.1.18",
21
21
  "author": {
22
22
  "name": "Cantina",
23
23
  "email": "support@cantina.xyz"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apex-cli",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "Run Apex security scans and review findings from Claude Code.",
5
5
  "author": {
6
6
  "name": "Cantina",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apex-cli",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "Run Apex security scans and review findings from Codex.",
5
5
  "author": {
6
6
  "name": "Cantina",
package/.mcp.claude.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "args": [
6
6
  "-y",
7
7
  "-p",
8
- "@cantinasecurity/apex-cli@0.1.17",
8
+ "@cantinasecurity/apex-cli@0.1.18",
9
9
  "apex-mcp"
10
10
  ],
11
11
  "env": {
package/.mcp.codex.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "args": [
5
5
  "-y",
6
6
  "-p",
7
- "@cantinasecurity/apex-cli@0.1.17",
7
+ "@cantinasecurity/apex-cli@0.1.18",
8
8
  "apex-mcp"
9
9
  ],
10
10
  "env": {
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.17 apex-mcp
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:
@@ -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`
@@ -151,6 +245,8 @@ Supported shell commands:
151
245
  - `apex status [--scan <scan-id>]`
152
246
  - `apex doctor`
153
247
  - `apex login`
248
+ - `apex redeem <code> [--json] [--replace]`
249
+ - `apex claim [--json] [--no-open]`
154
250
  - `apex logout`
155
251
  - `apex service-key create --name <name> [--company <id-or-handle>] [--scope <scope[,scope]>] [--expires-at <ISO-8601>] [--json]`
156
252
  - `apex service-key list [--company <id-or-handle>] [--json]`
@@ -254,7 +350,7 @@ Finding review collaboration now has explicit write commands:
254
350
 
255
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.
256
352
 
257
- 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` followed by `apex-auth-wait` is enough to authenticate these write tools.
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.
258
354
 
259
355
  Invalid feedback requires a dismissal reason. Valid feedback can include `--suggested-severity extreme|critical|high|medium|low|informational`.
260
356
 
@@ -382,6 +478,7 @@ Do not point an MCP client at plain `pnpm mcp`. `pnpm` writes its script banner
382
478
  The MCP server exposes Apex-specific tools for:
383
479
 
384
480
  - auth status and device login
481
+ - local guest-session deadlines through `apex-trial-status` (never the code or claim token)
385
482
  - doctor, credits, and provider connection URLs
386
483
  - workspace inspection and workspace binding
387
484
  - scan start, status, cancellation, findings, and findings export
@@ -390,7 +487,7 @@ The MCP server exposes Apex-specific tools for:
390
487
  - finding comments and valid/invalid feedback with `apex-finding-comment` and `apex-finding-feedback`
391
488
  - Fix PR and current-repository fix review scans with `apex-finding-fix-review`, optionally after `apex-finding-feedback`
392
489
 
393
- 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.
394
491
 
395
492
  For repository-scoped operations, pass `cwd` explicitly so the server can resolve the right `.apex/workspace.json` binding and repository roots.
396
493
 
@@ -419,7 +516,7 @@ APEX_TELEMETRY_DISABLED=1 apex scan
419
516
 
420
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.
421
518
 
422
- 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.
423
520
 
424
521
  Telemetry event posts do not include bearer tokens. The telemetry endpoint is `POST /api/cli/v1/telemetry/events` with a batch payload:
425
522
 
@@ -429,7 +526,7 @@ Telemetry event posts do not include bearer tokens. The telemetry endpoint is `P
429
526
  {
430
527
  "schemaVersion": 1,
431
528
  "event": "apex.invocation.completed",
432
- "cliVersion": "0.1.17",
529
+ "cliVersion": "0.1.18",
433
530
  "invocation": {
434
531
  "surface": "mcp",
435
532
  "command": "apex-scan",
@@ -460,7 +557,7 @@ The npm package also includes marketplace-ready plugin artifacts:
460
557
  - `.claude-plugin/plugin.json` and `.mcp.claude.json` for Claude Code plugin installs
461
558
  - `.claude-plugin/marketplace.json` for a Claude marketplace entry backed by the public npm package
462
559
 
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.
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.
464
561
 
465
562
  The repository also includes `.agents/plugins/marketplace.json` for local Codex marketplace testing from a checkout.
466
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;