@drip-apex/apex-cli 0.17.0 → 0.19.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/AGENTS.md CHANGED
@@ -71,6 +71,8 @@ the first writes: `apex experiments create`, `apex goals create`,
71
71
  - Stale workspace or filesystem: pull fresh files, reapply your edits, and plan again.
72
72
  - Server limit errors: read the JSON error details; Apex includes server-owned limits when available.
73
73
 
74
+ - Windows text corruption: use UTF-8 console settings; Apex repairs reversible Windows-1252 arguments and warns on stderr for U+FFFD. Set `APEX_ARGV_ENCODING=off` to disable repair.
75
+
74
76
  ## Platform Shop Administration
75
77
 
76
78
  - `apex admin shops archive <shopId>` archives a shop; headless callers must
package/README.md CHANGED
@@ -185,7 +185,10 @@ including every subcommand, argument, option, and alias.
185
185
  - `apex triggers disable-capture` — disable setup capture and clear its expiry.
186
186
  - `apex domains` — manage install domains, and landing-page domains (`claim`, `register`, `status`, `unclaim`; registering asks for a price confirmation).
187
187
  - `apex handover` — manage cross-domain identity handover.
188
- - `apex install` — generate storefront installation snippets.
188
+ - `apex install` — check storefront installation and generate a client guide.
189
+ - `apex install kit` — print a ready-to-send installation guide as Markdown or JSON.
190
+ - `apex install check` — verify the snippet, served config, and recent tracking.
191
+ - `apex install steps` — show each installation step with when Apex first and last saw it (`--live` also checks the page and firewall access).
189
192
  - `apex funnels` — manage analytics funnels.
190
193
  - `apex webhooks` — manage shop webhooks.
191
194
  - `apex simulate` — simulate data-layer triggers without emitting events.
@@ -199,8 +202,40 @@ including every subcommand, argument, option, and alias.
199
202
  - `apex roadmap` — consume approved roadmap ideas and handoffs.
200
203
  - `apex harness` — develop AB Test Harness projects with live QA sessions.
201
204
  - `apex workspace` — check out, preview, and publish draft workspace files.
202
- - `apex goals` — manage conversion and revenue goals.
205
+ - `apex goals` — manage conversion and revenue goals. Create/update accept `--page-id <id>` (UUID only, no lookup) or `--page <id-or-key>` (keys need `pages:read` for lookup); use one option.
203
206
  - `apex flags` — manage feature flags.
207
+ - `apex surveys` — list, get, create, update, start, pause, complete, duplicate, and delete surveys.
208
+ Use `apex surveys list --status live` to filter, and `apex surveys create @survey.json`
209
+ or `apex surveys update <id> <body>` with inline JSON, `@file`, or a file path.
210
+ Both create and update also accept `--file survey.json` instead of a positional body;
211
+ providing both is an error. Their `--help` pages include the example and field defaults below.
212
+ `--json` returns the server body unchanged under `data`; publication warnings go to stderr.
213
+ Deleting a live or paused survey returns conflict exit code 5. Complete it before deleting.
214
+
215
+ Example `survey.json` for `apex surveys create --file survey.json` or
216
+ `apex surveys update <id> --file survey.json`:
217
+
218
+ ```json
219
+ {
220
+ "name": "Product feedback",
221
+ "questions": [{
222
+ "type": "single_choice",
223
+ "prompt": "What would help you decide?",
224
+ "options": [{"label": "More details"}, {"label": "Reviews"}, {"label": "Delivery info"}]
225
+ }],
226
+ "targeting": {"url": [{"type": "simple", "pattern": "/products/", "matchType": "contains"}]},
227
+ "sampling_rate": 0.5,
228
+ "frequency_cap": "once_per_visitor",
229
+ "card_style": "quiet",
230
+ "answer_goal": 100
231
+ }
232
+ ```
233
+
234
+ On create, `name` is required. Server defaults: `questions: []` (each question's
235
+ `required: true`), `targeting: null` (all pages/visitors), `sampling_rate: 1`,
236
+ `frequency_cap: "once_per_visitor"`, `card_style: "quiet"`, `answer_goal: null`,
237
+ `environment_key: "production"`, `placement: "sdk_page"`, `active_from: null`,
238
+ and `active_to: null`. Update accepts a partial body and keeps omitted fields unchanged.
204
239
  - `apex personalizations` — manage personalization deliveries.
205
240
  - `apex backlog` — manage experiment backlog items.
206
241
  - `apex signals` — inspect research and opportunity signals.
@@ -212,7 +247,7 @@ including every subcommand, argument, option, and alias.
212
247
  - `apex events export` — export all raw events in a fixed ISO 8601 window with automatic pagination.
213
248
  - `apex environments` — inspect delivery environments.
214
249
  - `apex analytics` — read shop analytics.
215
- - `apex pages` — manage page targeting resources.
250
+ - `apex pages` — manage page targeting resources. Body keys are listed in `apex pages create --help` (and `update --help`); the CLI refuses a `url_pattern` or rule pattern whose shape contradicts `match_type` (`match_type_mismatch`) unless `--literal` is passed. `apex schema --json` carries the body schema.
216
251
  - `apex segments` — manage audience segments.
217
252
  - `apex exclusion-groups` — manage mutually exclusive experiment groups.
218
253
  - `apex targeting` — inspect targeting evaluation and coverage.
@@ -222,7 +257,7 @@ including every subcommand, argument, option, and alias.
222
257
  ### Shop configuration and operations
223
258
 
224
259
  - `apex external-pixels` — manage external pixel snippets.
225
- - `apex assets` — manage uploaded assets.
260
+ - `apex assets` — manage uploaded assets. Upload returns `delivery_url`; embed that permanent URL in variation code. `public_url` expires after 300 seconds. Delivery is anonymous once the referencing experiment or snippet is published, and resolves through the owning shop's dashboard session or a QA preview before that. Only the absolute https form is recognized as an owned reference; protocol-relative or http forms are not granted at publication.
226
261
  - `apex landing-pages` — build landing pages with your own tools, then apply, preview, deploy and roll them back.
227
262
  - `apex brand` — manage brand context.
228
263
  - `apex shops` — manage shops and active-shop context.
@@ -526,6 +561,27 @@ latest/minimum policy is cached for seven days, so offline commands still enforc
526
561
  known floor. `APEX_NO_UPDATE_CHECK=1` disables the npm lookup and optional update
527
562
  notice, but never hides a required server-floor upgrade.
528
563
 
564
+ ### Windows: UTF-8 arguments
565
+
566
+ A Windows console or launcher can decode UTF-8 as Windows-1252, turning `A – B · C`
567
+ into `A – B · C`. On Windows, Apex automatically repairs reversible argument
568
+ values at startup and writes a note to stderr. Set `APEX_ARGV_ENCODING=off` to
569
+ keep arguments unchanged, or `APEX_ARGV_ENCODING=repair` to enable repair on
570
+ another platform.
571
+
572
+ Use UTF-8 in PowerShell:
573
+
574
+ ```powershell
575
+ [Console]::InputEncoding = [Console]::OutputEncoding = [Text.Encoding]::UTF8
576
+ ```
577
+
578
+ For Git Bash, set `LANG=C.UTF-8` and run `chcp 65001`.
579
+
580
+ A replacement character (`�`, U+FFFD) means the shell already lost a character.
581
+ Apex sends that value as given and warns on stderr. It also warns when stored
582
+ experiment names, descriptions, variation names, or goal names contain U+FFFD.
583
+ These notes leave JSON stdout unchanged.
584
+
529
585
  ## Usage telemetry
530
586
 
531
587
  Authenticated invocations send a process invocation ID, full command path, explicitly set
@@ -587,3 +643,7 @@ store ID (or null), invitation results and partial delivery status.
587
643
  ## Import past results
588
644
 
589
645
  Upload CSV or JSON exports with `apex results import --file results.csv --dry-run`. Apex suggests column and outcome-value mappings from the file; use repeated `--map 'Column=field'` and `--outcome-value 'Source value=won|lost|inconclusive'` overrides, then pass `--yes` for non-interactive confirmation. Files are inspected and previewed before any rows are written. `--source <name>` applies to the confirmed rows; the preview shows the uploaded file name.
646
+
647
+ ### Tracking health
648
+
649
+ `apex tracking health [--json]` reads one tracking-health report for the current shop: every check with pass, warn, fail or unknown, a plain summary and the deciding numbers, plus each running test's first-hour verdict and traffic split overall and per device (`--json` carries visitors per arm per day). Exit code 0 is pass, 1 is warn or fail, 3 is unknown.