@tryhermes/cli 0.1.4 → 0.1.5
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/dist/index.js +19 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -6928,6 +6928,10 @@ function renderConnectionDetail(c) {
|
|
|
6928
6928
|
rows.push(["PostHog project", c.posthog_project_id ?? "\u2014"]);
|
|
6929
6929
|
rows.push(["PostHog API key", c.posthog_api_key ?? "\u2014"]);
|
|
6930
6930
|
}
|
|
6931
|
+
if (c.source_type === "stripe") {
|
|
6932
|
+
rows.push(["Stripe account", c.stripe_account_id ?? "\u2014"]);
|
|
6933
|
+
rows.push(["Stripe API key", c.stripe_api_key ?? "\u2014"]);
|
|
6934
|
+
}
|
|
6931
6935
|
const labelWidth = Math.max(...rows.map(([k]) => k.length));
|
|
6932
6936
|
const lines = ["Identity"];
|
|
6933
6937
|
for (const [k, v] of rows) {
|
|
@@ -6991,7 +6995,7 @@ async function resolveConnectionId(explicit, opts = {}) {
|
|
|
6991
6995
|
}
|
|
6992
6996
|
function registerConnectionsCommand(program3) {
|
|
6993
6997
|
const conns = program3.command("connections").description(
|
|
6994
|
-
"Manage the customer data sources Hermes scans (Postgres, MySQL, CSV, Firestore, PostHog)"
|
|
6998
|
+
"Manage the customer data sources Hermes scans (Postgres, MySQL, CSV, Firestore, PostHog, Stripe)"
|
|
6995
6999
|
).action(function() {
|
|
6996
7000
|
this.help();
|
|
6997
7001
|
});
|
|
@@ -7056,6 +7060,9 @@ function registerConnectionsCommand(program3) {
|
|
|
7056
7060
|
conns.command("add").description(
|
|
7057
7061
|
"Tell Hermes about another data source. Existing sources and triggers are left intact."
|
|
7058
7062
|
).option("--label <label>", "human-readable label for this source").option("--default", "make this the default source for new triggers").option("--postgres-url <url>", "\u2192 source_type=postgres").option("--mysql-url <url>", "\u2192 source_type=mysql").option("--posthog-host <url>", "\u2192 source_type=posthog").option("--posthog-project-id <id>", "PostHog project id").option("--posthog-api-key <key>", "PostHog personal API key").option(
|
|
7063
|
+
"--stripe-api-key <key>",
|
|
7064
|
+
"Stripe secret (sk_...) or restricted (rk_...) key \u2192 source_type=stripe"
|
|
7065
|
+
).option(
|
|
7059
7066
|
"--firestore-credentials <json-or-@file>",
|
|
7060
7067
|
"Service account JSON (raw, or @path/to/sa.json) \u2192 source_type=firestore"
|
|
7061
7068
|
).option(
|
|
@@ -7076,12 +7083,13 @@ function registerConnectionsCommand(program3) {
|
|
|
7076
7083
|
opts.postgresUrl ? "--postgres-url" : null,
|
|
7077
7084
|
opts.mysqlUrl ? "--mysql-url" : null,
|
|
7078
7085
|
opts.posthogHost || opts.posthogProjectId || opts.posthogApiKey ? "--posthog-host/--posthog-project-id/--posthog-api-key" : null,
|
|
7086
|
+
opts.stripeApiKey ? "--stripe-api-key" : null,
|
|
7079
7087
|
opts.firestoreCredentials ? "--firestore-credentials" : null,
|
|
7080
7088
|
opts.csvFile ? "--csv-file" : null
|
|
7081
7089
|
].filter(Boolean);
|
|
7082
7090
|
if (credentialFlags.length === 0) {
|
|
7083
7091
|
console.error(
|
|
7084
|
-
"Error: provide one of --postgres-url, --mysql-url, --posthog-host/--posthog-project-id/--posthog-api-key, --firestore-credentials, --csv-file."
|
|
7092
|
+
"Error: provide one of --postgres-url, --mysql-url, --posthog-host/--posthog-project-id/--posthog-api-key, --stripe-api-key, --firestore-credentials, --csv-file."
|
|
7085
7093
|
);
|
|
7086
7094
|
process.exit(1);
|
|
7087
7095
|
}
|
|
@@ -7255,6 +7263,14 @@ async function buildJsonCreateBody(opts) {
|
|
|
7255
7263
|
...confirmSwitch
|
|
7256
7264
|
};
|
|
7257
7265
|
}
|
|
7266
|
+
if (opts.stripeApiKey) {
|
|
7267
|
+
return {
|
|
7268
|
+
source_type: "stripe",
|
|
7269
|
+
stripe_api_key: String(opts.stripeApiKey),
|
|
7270
|
+
...metadata,
|
|
7271
|
+
...confirmSwitch
|
|
7272
|
+
};
|
|
7273
|
+
}
|
|
7258
7274
|
const raw = String(opts.firestoreCredentials);
|
|
7259
7275
|
const credentials = raw.startsWith("@") ? await (0, import_promises.readFile)(raw.slice(1), "utf8") : raw;
|
|
7260
7276
|
return {
|
|
@@ -8366,7 +8382,7 @@ function registerTriggersCommand(program3) {
|
|
|
8366
8382
|
"Create a trigger. You write the detection query (source-native) + email prompt; Hermes validates against the live source and persists."
|
|
8367
8383
|
).requiredOption(
|
|
8368
8384
|
"--detection-query <q>",
|
|
8369
|
-
"source-native query \u2014 SQL string, or Firestore JSON (test it first with `hermes connections query`)"
|
|
8385
|
+
"source-native query \u2014 SQL/HogQL string, or Firestore/Stripe JSON (test it first with `hermes connections query`)"
|
|
8370
8386
|
).requiredOption(
|
|
8371
8387
|
"--email-prompt <text>",
|
|
8372
8388
|
"the drafting brief for per-user email copy"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryhermes/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Hermes CLI — drive the agentic email platform (connections, triggers, drafts, sends) from the terminal.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"tsup": "^8.5.1",
|
|
23
23
|
"tsx": "^4.19.2",
|
|
24
24
|
"typescript": "^5.6.3",
|
|
25
|
-
"@workspace/eslint-config": "0.0.0",
|
|
26
25
|
"@workspace/api-types": "0.0.1",
|
|
27
|
-
"@workspace/typescript-config": "0.0.0"
|
|
26
|
+
"@workspace/typescript-config": "0.0.0",
|
|
27
|
+
"@workspace/eslint-config": "0.0.0"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "tsup && chmod +x dist/index.js",
|