@drip-apex/apex-cli 0.6.2 → 0.7.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 +37 -1
- package/README.md +76 -1
- package/dist/cli.js +1231 -346
- package/package.json +1 -1
- package/skills/apex-cli/SKILL.md +28 -0
package/AGENTS.md
CHANGED
|
@@ -50,7 +50,7 @@ the first writes: `apex experiments create`, `apex goals create`,
|
|
|
50
50
|
- Missing auth: run `apex login` interactively, or set `APEX_API_KEY`.
|
|
51
51
|
- Headless login: pass `--api-key` or set `APEX_API_KEY`; `DRIP_API_KEY` remains a compatibility fallback.
|
|
52
52
|
- Do not wait for prompts in CI or agent runs. If a command returns exit `4`, rerun with the exact flag named in the JSON error details only after checking the plan or destructive action.
|
|
53
|
-
- Apply invalidates QA: inspect `apex experiments plan`, then rerun apply with `--
|
|
53
|
+
- Apply invalidates QA: inspect `apex experiments plan`, then rerun apply with `--accept-qa-invalidation` if intended.
|
|
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
|
|
|
@@ -70,3 +70,39 @@ the first writes: `apex experiments create`, `apex goals create`,
|
|
|
70
70
|
- Edit experiment files, variation code, metrics, and targeting only through supported paths.
|
|
71
71
|
- Do not bypass the variation artifact persistence path with direct API writes.
|
|
72
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.
|
|
101
|
+
|
|
102
|
+
Classification uses `--counting-type standard|setup_test|aa_test|non_program` on
|
|
103
|
+
`apex experiments create` (default `standard`) and `apex experiments update`.
|
|
104
|
+
Classification writes are draft-only. In pulled `experiment.json`, `experimentType`
|
|
105
|
+
and `countingType` equal `delivery_type` and `counting_type` from
|
|
106
|
+
`apex experiments get --json`. Omitting or setting `countingType` to null preserves
|
|
107
|
+
the stored value. Classification edits invalidate QA approval; paused and running
|
|
108
|
+
experiments reject these metadata changes.
|
package/README.md
CHANGED
|
@@ -109,6 +109,10 @@ including every subcommand, argument, option, and alias.
|
|
|
109
109
|
### Experiments and delivery
|
|
110
110
|
|
|
111
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.
|
|
112
116
|
- `apex triggers` — manage data-layer triggers and temporary setup capture.
|
|
113
117
|
- `apex triggers get --shop <domain-or-id>` — read the identified shop's runtime triggers.
|
|
114
118
|
- `apex triggers set` — replace the shop's runtime triggers from a JSON file.
|
|
@@ -123,7 +127,7 @@ including every subcommand, argument, option, and alias.
|
|
|
123
127
|
- `apex webhooks` — manage shop webhooks.
|
|
124
128
|
- `apex simulate` — simulate data-layer triggers without emitting events.
|
|
125
129
|
- `apex experiments` — create, inspect, operate, and synchronize experiments.
|
|
126
|
-
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.
|
|
130
|
+
Use `apex experiments screenshots <id-or-slug>` to force-assign every capture, including control, to its variation server-side for deterministic screenshots. Resume a job that outlives the CLI timeout with `--job <id>`; polling continues without creating another job, and the stored job's devices and variations win, so `--devices`/`--variations` are ignored (the CLI warns). 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.
|
|
127
131
|
- `apex push` — synchronize `.drip.config.ts` with Apex.
|
|
128
132
|
- `apex preview` — open a variation QA preview.
|
|
129
133
|
- `apex roadmap` — consume approved roadmap ideas and handoffs.
|
|
@@ -174,6 +178,41 @@ means it is an `apex workspace checkout/status/publish` workspace. Keep the two
|
|
|
174
178
|
formats in different folders; when the wrong command is run, Apex points to the
|
|
175
179
|
matching status command.
|
|
176
180
|
|
|
181
|
+
## Page targeting: URL rules and Pages
|
|
182
|
+
|
|
183
|
+
Page targeting has two supported authoring paths, and both stay supported.
|
|
184
|
+
|
|
185
|
+
| Key in `targeting` | What it is |
|
|
186
|
+
| --- | --- |
|
|
187
|
+
| `url` | An array of URL rules: `{ "type": "simple" \| "regex", "pattern": "/products/*", "include": true, "matchType": "exact" \| "contains" \| "wildcard" \| "regex" }`. |
|
|
188
|
+
| `authorUrl` | Read-only, and present on every pull. The subset of `url` that an author wrote, recorded by the server; an empty array means no author-written rules. An apply ignores it and the server recomputes it. |
|
|
189
|
+
| `pages` | An array of `{ "id": "<page id>", "include": true }` references to saved Pages. |
|
|
190
|
+
| `pageRules` | Read-only. The server's expanded copy of each referenced Page, including its name and its own URL rules. |
|
|
191
|
+
| `pageMatchMode` | `"any"` (default) or `"all"` when more than one Page is referenced. |
|
|
192
|
+
|
|
193
|
+
**URL rules work without a saved Page.** `apex experiments create --source-url`
|
|
194
|
+
and a hand-written `url` array in `targeting.json` are complete targeting on
|
|
195
|
+
their own. Nothing rejects them, and no Page is required.
|
|
196
|
+
|
|
197
|
+
**An included Page decides where the test runs.** At runtime the URL gate and
|
|
198
|
+
the page-rules gate must BOTH match, but the URL gate is an OR over the whole
|
|
199
|
+
expanded `url` list, and a Page referenced with `"include": true` copies that
|
|
200
|
+
Page's own include rules into `url`. A visitor on the Page therefore passes the
|
|
201
|
+
URL gate through the derived copy even when no authored include rule matches,
|
|
202
|
+
so while an included Page is referenced your authored INCLUDE rules add no
|
|
203
|
+
pages. A Page referenced with `"include": false` contributes only an exclude
|
|
204
|
+
rule, so it can only veto and your authored INCLUDE rules still provide the
|
|
205
|
+
positive match. Authored EXCLUDE rules always apply, and detaching an included
|
|
206
|
+
Page gives the authored rules the decision back.
|
|
207
|
+
|
|
208
|
+
`apex experiments get` prints the result of those two rules as one
|
|
209
|
+
`Targeting:` line, in the same words the dashboard Setup tab uses, for example
|
|
210
|
+
`2 URL rules (no saved Page)` or `Cart page and 1 URL rule`.
|
|
211
|
+
|
|
212
|
+
In a pulled `targeting.json`, `url` is the expanded rule set and `authorUrl` is
|
|
213
|
+
the authored subset, always present. Edit `url` and `pages`; treat `authorUrl`
|
|
214
|
+
and `pageRules` as output.
|
|
215
|
+
|
|
177
216
|
## Push config format
|
|
178
217
|
|
|
179
218
|
Run `apex push -c <config>` to load a JavaScript or TypeScript config. The
|
|
@@ -228,3 +267,39 @@ Read the CLI reference on the docs site:
|
|
|
228
267
|
- https://docs.drip-apex.com/cli/commands-output
|
|
229
268
|
|
|
230
269
|
Maintainers: see the [CLI release runbook](../../docs/cli-releases.md).
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
## Project code
|
|
273
|
+
|
|
274
|
+
```sh
|
|
275
|
+
apex project-code get --shop example.com --json
|
|
276
|
+
apex project-code diff --file project-code.json --shop example.com --json
|
|
277
|
+
apex project-code set --file project-code.json --shop example.com --backup previous-code.json --json
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
The input is a partial projectCode object, for example `{ "css": "body { color: red; }" }`.
|
|
281
|
+
Supported fields are `enabled` (boolean) and `css`, `helperJs`, and `js` (strings or null).
|
|
282
|
+
Each code field permits at most 20,000 characters. Omitted fields remain unchanged.
|
|
283
|
+
Null or blank code clears that field. Unknown fields and empty objects are rejected.
|
|
284
|
+
|
|
285
|
+
GET returns complete code, shop identity, and an opaque version. DIFF returns effective
|
|
286
|
+
before/after values and changed fields without writing. SET creates a new backup file
|
|
287
|
+
with complete previous code, identity, capture time, and the exact version before PATCH.
|
|
288
|
+
It never replaces an existing backup. Backup failures prevent the write. An effective
|
|
289
|
+
no-op returns `unchanged`, without a PATCH or backup file.
|
|
290
|
+
|
|
291
|
+
The backed-up version becomes expectedVersion unchanged. A conflict returns exit 5,
|
|
292
|
+
keeps the backup, and does not retry. Read the latest state and preview it before a new
|
|
293
|
+
attempt with a new backup path. Authentication uses exit 2; invalid input uses exit 3.
|
|
294
|
+
A successful write returns `saved`, its diff, backup path, current version, writtenVersion,
|
|
295
|
+
and precompile result. A failed precompile is a saved-write warning. All warnings remain
|
|
296
|
+
in JSON and are also written to stderr. User keys resolve domains or pin UUID context;
|
|
297
|
+
shop keys must match the requested identity before any backup or write.
|
|
298
|
+
|
|
299
|
+
Classification uses `--counting-type standard|setup_test|aa_test|non_program` on
|
|
300
|
+
`apex experiments create` (default `standard`) and `apex experiments update`.
|
|
301
|
+
Classification writes are draft-only. In pulled `experiment.json`, `experimentType`
|
|
302
|
+
and `countingType` equal `delivery_type` and `counting_type` from
|
|
303
|
+
`apex experiments get --json`. Omitting or setting `countingType` to null preserves
|
|
304
|
+
the stored value. Classification edits invalidate QA approval; paused and running
|
|
305
|
+
experiments reject these metadata changes.
|