@avsbhq/cli 3.8.1 → 3.9.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/LICENSE +21 -0
- package/README.md +17 -8
- package/dist/cli.js +1444 -759
- package/dist/types/avsb.d.ts +9 -5
- package/dist/types/variation-code.d.ts +1 -1
- package/package.json +3 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AvsB Platform
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -119,7 +119,7 @@ avsb codegen # inside a cloned or pulled folder
|
|
|
119
119
|
|
|
120
120
|
## Commands
|
|
121
121
|
|
|
122
|
-
Every command group the CLI ships. All of them need a token already in place (see Authentication) except `avsb login`, which supplies one, plus `avsb logout`, `avsb status` and `avsb agents-md`, which only touch local files.
|
|
122
|
+
Every command group the CLI ships. All of them need a token already in place (see Authentication) except `avsb login`, which supplies one, plus `avsb logout`, `avsb status` and `avsb agents-md`, which only touch local files, and `avsb completion`, which only prints a script.
|
|
123
123
|
|
|
124
124
|
### Setup
|
|
125
125
|
|
|
@@ -152,7 +152,7 @@ Personal access tokens belong to a user, not to one organization, so a single to
|
|
|
152
152
|
| `avsb status` | Show what the local manifest says about this experiment |
|
|
153
153
|
| `avsb dev` | Watch local files and hot reload through the Chrome extension |
|
|
154
154
|
| `avsb pull` | Overwrite local files with the platform's current code. `-f, --force` |
|
|
155
|
-
| `avsb push` | Compile and upload local code. `-f, --force` |
|
|
155
|
+
| `avsb push` | Compile and upload local code. `-f, --force`, `--publish`, `--no-publish` |
|
|
156
156
|
|
|
157
157
|
### Project scripts
|
|
158
158
|
|
|
@@ -204,7 +204,7 @@ Tracking definitions: what counts as a click, a pageview, or a custom event.
|
|
|
204
204
|
| `avsb metrics unarchive <metricId>` | Restore an archived metric |
|
|
205
205
|
| `avsb metrics delete <metricId>` | Delete a metric. Refused while metric bindings reference it. `-f, --force` |
|
|
206
206
|
|
|
207
|
-
Every metrics command accepts `--project <PRJ-42 or 42>`, and falls back to the project in the local manifest when you are inside a cloned folder.
|
|
207
|
+
Every metrics command accepts `--project <PRJ-42 or 42>`, and falls back to the project in the local manifest when you are inside a cloned folder. A `<metricId>` can be `MET-17`, `17`, or the long ID.
|
|
208
208
|
|
|
209
209
|
### Metric bindings
|
|
210
210
|
|
|
@@ -213,8 +213,8 @@ Analysis-side wrappers: how a metric is measured in an experiment.
|
|
|
213
213
|
| Command | Description |
|
|
214
214
|
| ------- | ----------- |
|
|
215
215
|
| `avsb metric-bindings list` | List bindings. `--library`, `--search <text>`, `--include-archived`, `--limit <n>` |
|
|
216
|
-
| `avsb metric-bindings create` | Create a binding. `--measure`, `--direction`, `--name`, `--description`, `--metric`, `--numerator-metric`, `--denominator-metric`, `--composition <json>`, `--component <
|
|
217
|
-
| `avsb metric-bindings update <id>` | Update a binding. Same flags, plus `--library` / `--no-library` |
|
|
216
|
+
| `avsb metric-bindings create` | Create a binding. `--measure`, `--direction`, `--name`, `--description`, `--metric`, `--numerator-metric`, `--denominator-metric`, `--composition <json>`, `--component <bindingId:weight>`, `--percentile`, `--value-source`, `--winsorize-upper`, `--winsorize-lower` |
|
|
217
|
+
| `avsb metric-bindings update <id>` | Update a binding (`MBD-8`, `8`, or the long ID). Same flags, plus `--library` / `--no-library` |
|
|
218
218
|
| `avsb metric-bindings archive <id>` | Archive a binding |
|
|
219
219
|
| `avsb metric-bindings unarchive <id>` | Restore an archived binding |
|
|
220
220
|
| `avsb metric-bindings delete <id>` | Delete a binding. Refused while experiments attach it. `-f, --force` |
|
|
@@ -234,12 +234,20 @@ Measures: `UNIQUE_CONVERSIONS_PER_VISITOR`, `TOTAL_EVENTS`, `UNIQUE_VISITORS_WHO
|
|
|
234
234
|
|
|
235
235
|
| Command | Description |
|
|
236
236
|
| ------- | ----------- |
|
|
237
|
-
| `avsb codegen` | Generate TypeScript types from a published datafile. `-p, --project <project>` (defaults to the local manifest), `-e, --env <key>` (default `production`), `-o, --output <path>` (default `./src/generated/flags.ts`) |
|
|
237
|
+
| `avsb codegen` | Generate TypeScript types from a published datafile. `-p, --project <project>` (defaults to the local manifest), `-e, --env <key>` (default `production`), `-o, --output <path>` (default `./src/generated/flags.ts`), `-m, --manifest <path>`, `--no-augment`, `--check`, `--watch`, `--interval <seconds>` |
|
|
238
|
+
| `avsb find-refs` | Find flag keys in your source and compare them with the platform. `-p, --project <project>`, `-d, --dir <path>`, `-i, --ignore <pattern>`, `--max-files <count>`, `--strict`, `--json` |
|
|
238
239
|
|
|
239
240
|
The generated file declares `FlagKey` (a union of your flag keys), `FlagValues` (booleans, numbers, string-literal unions, and `unknown` for JSON flags, which you narrow yourself), and `ContextSchema` (one entry per context kind, each with `key: string` plus your registered attributes).
|
|
240
241
|
|
|
241
242
|
`--project` accepts `PRJ-42`, `42`, or a dashboard URL. Inside a folder created by `avsb project pull` or `avsb clone`, leave it out: the project comes from `.avsb-project.json`, then `.avsb.json`, and the run says which file it read.
|
|
242
243
|
|
|
244
|
+
### Webhooks
|
|
245
|
+
|
|
246
|
+
| Command | Description |
|
|
247
|
+
| ------- | ----------- |
|
|
248
|
+
| `avsb listen` | Watch this project's webhook deliveries and forward a copy to a local URL. `--project <project>`, `--forward <url>` (must start with `http://` or `https://`, anything else exits 2), `--print-secret-hint` |
|
|
249
|
+
| `avsb trigger [event]` | Send a sample webhook event to this project's webhooks. `--project <project>`, `--webhook <id>`, `--list` |
|
|
250
|
+
|
|
243
251
|
## Output for scripts
|
|
244
252
|
|
|
245
253
|
Every read command takes `--json` and prints exactly one document on stdout:
|
|
@@ -294,11 +302,12 @@ Press `Ctrl+C` to stop.
|
|
|
294
302
|
|
|
295
303
|
Compiles your TypeScript and SCSS locally, then uploads the source and the compiled output. Compile errors are reported with file, line, and column, and nothing is uploaded until they are fixed.
|
|
296
304
|
|
|
297
|
-
Before uploading, the CLI hashes the platform's copy and warns you if it changed since your last sync. When the experiment is running, it offers to publish the change immediately.
|
|
305
|
+
Before uploading, the CLI hashes the platform's copy and warns you if it changed since your last sync. When the experiment is running or paused, it offers to publish the change immediately; `--publish` and `--no-publish` answer that question up front, which is what a CI job wants.
|
|
298
306
|
|
|
299
307
|
```bash
|
|
300
308
|
avsb push
|
|
301
309
|
avsb push --force # skip the remote-change check
|
|
310
|
+
avsb push --publish # publish without the question
|
|
302
311
|
```
|
|
303
312
|
|
|
304
313
|
### Pull
|
|
@@ -338,7 +347,7 @@ project-10/
|
|
|
338
347
|
avsb.d.ts # type definitions for the avsb API, TypeScript projects only
|
|
339
348
|
```
|
|
340
349
|
|
|
341
|
-
Re-running `project pull`
|
|
350
|
+
Re-running `project pull` updates the existing folder in place, whether you run it from inside `project-<id>/` or from the folder that holds it; it never creates a nested copy. If your local script has edits it asks first, and `--force` overwrites them without asking.
|
|
342
351
|
|
|
343
352
|
## Cloned experiment structure
|
|
344
353
|
|