@drip-apex/apex-cli 0.10.0 → 0.11.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/README.md +10 -0
- package/dist/cli.js +39 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,6 +86,16 @@ apex schema --json
|
|
|
86
86
|
|
|
87
87
|
Use `apex` as the canonical command name. `drip` is a compatibility alias.
|
|
88
88
|
|
|
89
|
+
`apex experiments list` returns code-free summaries by default, including
|
|
90
|
+
`targeting_urls` and `variation_count`, without targeting objects, variations, or goals.
|
|
91
|
+
Use `--full --json` for full details, including code. `--full` keeps the default table unchanged.
|
|
92
|
+
Use `--fields id,test_key,name,status --json` to select top-level keys (JSON always keeps `id`),
|
|
93
|
+
or `--fields status,name` to print exactly those table columns in order.
|
|
94
|
+
`--fields` and `--full` can combine; invalid fields return the allowed keys.
|
|
95
|
+
Existing CR-011 filters still narrow the set; these flags only select row content.
|
|
96
|
+
The direct API retains its full default view; the CLI requests `view=summary`.
|
|
97
|
+
Summary timestamps include `created_at` and `archived_at`; experiments have no `updated_at` field.
|
|
98
|
+
|
|
89
99
|
`apex experiments list` hides archived experiments by default. Pass
|
|
90
100
|
`--include-archived` to include them; archived rows display their archive date
|
|
91
101
|
when the API provides `archived_at`.
|
package/dist/cli.js
CHANGED
|
@@ -7112,7 +7112,7 @@ var import_node_os3 = __toESM(require("node:os"));
|
|
|
7112
7112
|
// package.json
|
|
7113
7113
|
var package_default = {
|
|
7114
7114
|
name: "@drip-apex/apex-cli",
|
|
7115
|
-
version: "0.
|
|
7115
|
+
version: "0.11.0",
|
|
7116
7116
|
license: "MIT",
|
|
7117
7117
|
description: "Apex CLI for managing experiments, approved roadmap ideas, and draft workspaces.",
|
|
7118
7118
|
private: false,
|
|
@@ -7762,6 +7762,8 @@ function listExperiments(creds, opts) {
|
|
|
7762
7762
|
if (opts?.limit) params.set("limit", String(opts.limit));
|
|
7763
7763
|
if (opts?.cursor) params.set("cursor", opts.cursor);
|
|
7764
7764
|
if (opts?.includeArchived) params.set("archived", "1");
|
|
7765
|
+
if (opts?.view) params.set("view", opts.view);
|
|
7766
|
+
if (opts?.fields !== void 0) params.set("fields", opts.fields);
|
|
7765
7767
|
const qs = params.toString();
|
|
7766
7768
|
return request(creds, "GET", `/api/v1/experiments${qs ? `?${qs}` : ""}`);
|
|
7767
7769
|
}
|
|
@@ -9805,16 +9807,23 @@ async function resolveExperiment(idOrSlug) {
|
|
|
9805
9807
|
res.errorDetails
|
|
9806
9808
|
);
|
|
9807
9809
|
}
|
|
9808
|
-
var list = new Command("list").alias("ls").description(
|
|
9810
|
+
var list = new Command("list").alias("ls").description(
|
|
9811
|
+
"List experiments in summary view by default; use --full for details or --fields for selected columns (archived experiments are hidden by default)"
|
|
9812
|
+
).option(
|
|
9809
9813
|
"-s, --status <status>",
|
|
9810
9814
|
"Filter by status (draft|awaiting_client_approval|changes_requested|client_approved|qa|ready_to_launch|running|paused|completed)"
|
|
9811
|
-
).option("-n, --limit <n>", "Max results", "20").option("--include-archived", "Include archived experiments").
|
|
9815
|
+
).option("-n, --limit <n>", "Max results", "20").option("--include-archived", "Include archived experiments").option("--full", "Return full experiment details instead of the default summary").option(
|
|
9816
|
+
"--fields <list>",
|
|
9817
|
+
"Comma-separated fields to return and table columns in order (JSON always keeps id)"
|
|
9818
|
+
).action(async function action3(opts) {
|
|
9812
9819
|
const creds = requireCredentials();
|
|
9813
9820
|
const spinner = await createSpinner("Fetching experiments...");
|
|
9814
9821
|
const res = await listExperiments(creds, {
|
|
9815
9822
|
status: opts.status,
|
|
9816
9823
|
limit: parseInt(opts.limit, 10),
|
|
9817
|
-
includeArchived: opts.includeArchived
|
|
9824
|
+
includeArchived: opts.includeArchived,
|
|
9825
|
+
view: opts.full ? "full" : "summary",
|
|
9826
|
+
fields: opts.fields
|
|
9818
9827
|
});
|
|
9819
9828
|
if (!res.ok) {
|
|
9820
9829
|
spinner?.fail("Failed to fetch experiments");
|
|
@@ -9827,18 +9836,32 @@ var list = new Command("list").alias("ls").description("List experiments (archiv
|
|
|
9827
9836
|
console.log(source_default.dim("No experiments found."));
|
|
9828
9837
|
return;
|
|
9829
9838
|
}
|
|
9830
|
-
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9841
|
-
|
|
9839
|
+
if (opts.fields !== void 0) {
|
|
9840
|
+
const fields3 = [
|
|
9841
|
+
...new Set(opts.fields.split(",").map((field) => field.trim()))
|
|
9842
|
+
];
|
|
9843
|
+
printTable(
|
|
9844
|
+
fields3.map((field) => field.toUpperCase()),
|
|
9845
|
+
experiments.map(
|
|
9846
|
+
(experiment) => fields3.map((field) => {
|
|
9847
|
+
const value = experiment[field];
|
|
9848
|
+
return value == null ? "-" : typeof value === "object" ? JSON.stringify(value) : String(value);
|
|
9849
|
+
})
|
|
9850
|
+
)
|
|
9851
|
+
);
|
|
9852
|
+
} else
|
|
9853
|
+
printTable(
|
|
9854
|
+
["NAME", "SLUG", "STATUS", "ARCHIVED", "TRAFFIC", "CREATED"],
|
|
9855
|
+
experiments.map((e) => [
|
|
9856
|
+
e.name.slice(0, 40),
|
|
9857
|
+
e.slug ?? source_default.dim("-"),
|
|
9858
|
+
statusBadge(e.status),
|
|
9859
|
+
e.archived_at ? formatDate(e.archived_at) : source_default.dim("-"),
|
|
9860
|
+
`${(e.traffic_allocation * 100).toFixed(0)}%`,
|
|
9861
|
+
formatDate(e.created_at)
|
|
9862
|
+
]),
|
|
9863
|
+
[40, 25, 12, 15, 8, 15]
|
|
9864
|
+
);
|
|
9842
9865
|
if (res.data.pagination.has_more) {
|
|
9843
9866
|
console.log(source_default.dim(`
|
|
9844
9867
|
(more results available)`));
|