@drip-apex/apex-cli 0.6.1 → 0.6.3

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
@@ -54,6 +54,15 @@ the first writes: `apex experiments create`, `apex goals create`,
54
54
  - Stale workspace or filesystem: pull fresh files, reapply your edits, and plan again.
55
55
  - Server limit errors: read the JSON error details; Apex includes server-owned limits when available.
56
56
 
57
+ ## Platform Shop Administration
58
+
59
+ - `apex admin shops archive <shopId>` archives a shop; headless callers must
60
+ inspect exit `4` and rerun the supplied `--force` command only when intended.
61
+ - `apex admin shops restore <shopId>` restores an archived shop. Restoration
62
+ does not re-enable delivery; the runtime kill switch remains authoritative.
63
+ - Both commands require a platform user API key. Organization and shop keys
64
+ are intentionally insufficient.
65
+
57
66
  ## Filesystem Rules
58
67
 
59
68
  - Formatting is enforced by Biome (`npm run format`); do not hand-wrap code.
@@ -61,3 +70,31 @@ the first writes: `apex experiments create`, `apex goals create`,
61
70
  - Edit experiment files, variation code, metrics, and targeting only through supported paths.
62
71
  - Do not bypass the variation artifact persistence path with direct API writes.
63
72
  - Keep generated evidence outside `qa.json`; attach it through QA commands.
73
+
74
+
75
+ ## Project code
76
+
77
+ ```sh
78
+ apex project-code get --shop example.com --json
79
+ apex project-code diff --file project-code.json --shop example.com --json
80
+ apex project-code set --file project-code.json --shop example.com --backup previous-code.json --json
81
+ ```
82
+
83
+ The input is a partial projectCode object, for example `{ "css": "body { color: red; }" }`.
84
+ Supported fields are `enabled` (boolean) and `css`, `helperJs`, and `js` (strings or null).
85
+ Each code field permits at most 20,000 characters. Omitted fields remain unchanged.
86
+ Null or blank code clears that field. Unknown fields and empty objects are rejected.
87
+
88
+ GET returns complete code, shop identity, and an opaque version. DIFF returns effective
89
+ before/after values and changed fields without writing. SET creates a new backup file
90
+ with complete previous code, identity, capture time, and the exact version before PATCH.
91
+ It never replaces an existing backup. Backup failures prevent the write. An effective
92
+ no-op returns `unchanged`, without a PATCH or backup file.
93
+
94
+ The backed-up version becomes expectedVersion unchanged. A conflict returns exit 5,
95
+ keeps the backup, and does not retry. Read the latest state and preview it before a new
96
+ attempt with a new backup path. Authentication uses exit 2; invalid input uses exit 3.
97
+ A successful write returns `saved`, its diff, backup path, current version, writtenVersion,
98
+ and precompile result. A failed precompile is a saved-write warning. All warnings remain
99
+ in JSON and are also written to stderr. User keys resolve domains or pin UUID context;
100
+ shop keys must match the requested identity before any backup or write.
package/README.md CHANGED
@@ -72,6 +72,8 @@ apex experiments pull <id-or-slug> --out ./my-test
72
72
  apex experiments plan ./my-test --json
73
73
  apex experiments apply ./my-test --json
74
74
  apex experiments qa status ./my-test --json
75
+ apex experiments qa evidence ./my-test --file ./desktop.png --device desktop
76
+ apex experiments qa evidence <id-or-slug> --job <screenshot-job-id>
75
77
  apex experiments screenshots <id-or-slug> --out ./screenshots
76
78
 
77
79
  apex workspace checkout <experimentId> --variation <variationId> --out ./workspace
@@ -107,6 +109,10 @@ including every subcommand, argument, option, and alias.
107
109
  ### Experiments and delivery
108
110
 
109
111
  - `apex consent` — manage consent gating.
112
+ - `apex project-code` — inspect and safely change shop project code.
113
+ - `apex project-code get` — read complete code and its opaque version.
114
+ - `apex project-code diff` — preview a partial JSON change without writing.
115
+ - `apex project-code set` — create a backup before a version-checked write.
110
116
  - `apex triggers` — manage data-layer triggers and temporary setup capture.
111
117
  - `apex triggers get --shop <domain-or-id>` — read the identified shop's runtime triggers.
112
118
  - `apex triggers set` — replace the shop's runtime triggers from a JSON file.
@@ -121,7 +127,7 @@ including every subcommand, argument, option, and alias.
121
127
  - `apex webhooks` — manage shop webhooks.
122
128
  - `apex simulate` — simulate data-layer triggers without emitting events.
123
129
  - `apex experiments` — create, inspect, operate, and synchronize experiments.
124
- Use `apex experiments screenshots <id-or-slug>` to force-assign every capture, including control, to its variation server-side for deterministic screenshots; choose devices with `--devices`, filter treatments with `--variations`, and use `--json` for the signed result payload.
130
+ Use `apex experiments screenshots <id-or-slug>` to force-assign every capture, including control, to its variation server-side for deterministic screenshots. The command attaches terminal jobs to the QA run by default; use `--no-attach-qa` to opt out. Choose devices with `--devices`, filter treatments with `--variations`, and use `--json` for the signed result payload. Use `apex experiments qa evidence` with `--job`, repeatable `--file`, or `--records` to write QA evidence directly.
125
131
  - `apex push` — synchronize `.drip.config.ts` with Apex.
126
132
  - `apex preview` — open a variation QA preview.
127
133
  - `apex roadmap` — consume approved roadmap ideas and handoffs.
@@ -156,6 +162,14 @@ including every subcommand, argument, option, and alias.
156
162
  - `apex schema` — emit the machine-readable CLI schema.
157
163
  - `apex discover` — read observed tracking shapes or mine a public GTM container.
158
164
 
165
+ Platform-administrator shop commands are intentionally outside the public
166
+ command inventory:
167
+
168
+ | Command | Purpose |
169
+ | --- | --- |
170
+ | `apex admin shops archive <shopId>` | Archive a shop and disable Apex delivery; use `--force` in non-interactive environments. |
171
+ | `apex admin shops restore <shopId>` | Restore an archived shop while leaving its runtime kill switch unchanged. |
172
+
159
173
  ## Which local format am I in?
160
174
 
161
175
  Inspect the marker under `.apex/`: `experiment-filesystem.json` means the
@@ -218,3 +232,31 @@ Read the CLI reference on the docs site:
218
232
  - https://docs.drip-apex.com/cli/commands-output
219
233
 
220
234
  Maintainers: see the [CLI release runbook](../../docs/cli-releases.md).
235
+
236
+
237
+ ## Project code
238
+
239
+ ```sh
240
+ apex project-code get --shop example.com --json
241
+ apex project-code diff --file project-code.json --shop example.com --json
242
+ apex project-code set --file project-code.json --shop example.com --backup previous-code.json --json
243
+ ```
244
+
245
+ The input is a partial projectCode object, for example `{ "css": "body { color: red; }" }`.
246
+ Supported fields are `enabled` (boolean) and `css`, `helperJs`, and `js` (strings or null).
247
+ Each code field permits at most 20,000 characters. Omitted fields remain unchanged.
248
+ Null or blank code clears that field. Unknown fields and empty objects are rejected.
249
+
250
+ GET returns complete code, shop identity, and an opaque version. DIFF returns effective
251
+ before/after values and changed fields without writing. SET creates a new backup file
252
+ with complete previous code, identity, capture time, and the exact version before PATCH.
253
+ It never replaces an existing backup. Backup failures prevent the write. An effective
254
+ no-op returns `unchanged`, without a PATCH or backup file.
255
+
256
+ The backed-up version becomes expectedVersion unchanged. A conflict returns exit 5,
257
+ keeps the backup, and does not retry. Read the latest state and preview it before a new
258
+ attempt with a new backup path. Authentication uses exit 2; invalid input uses exit 3.
259
+ A successful write returns `saved`, its diff, backup path, current version, writtenVersion,
260
+ and precompile result. A failed precompile is a saved-write warning. All warnings remain
261
+ in JSON and are also written to stderr. User keys resolve domains or pin UUID context;
262
+ shop keys must match the requested identity before any backup or write.