@letterstory/cli 0.177.187 → 0.177.188

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/lib/cli.mjs CHANGED
@@ -93,7 +93,7 @@ import {
93
93
  import { fetchParkedSections, withoutParked } from "./parked.mjs";
94
94
 
95
95
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
96
- export const VERSION = "0.177.187";
96
+ export const VERSION = "0.177.188";
97
97
 
98
98
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
99
99
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -131,6 +131,8 @@ export const BOOLEAN_FLAGS = new Set([
131
131
  // visits export: only the people or companies who fit the ICP, or only those who don't.
132
132
  "icp",
133
133
  "not-icp",
134
+ "project-is-one-app",
135
+ "shared-project",
134
136
  // visits sites: also return each site's script.
135
137
  "install",
136
138
  // org mcp add: the server signs in with OAuth instead of a header value.
@@ -2246,7 +2248,8 @@ Evidence (what signed-in people do in your own app):
2246
2248
  usage evaluate-action --since <ISO> --until <ISO> --definition <file.json>
2247
2249
  usage [--days 7|30|90] [--site <id>] [--limit <n>] People, companies and the features they use
2248
2250
  usage --host <app host> What to add to the app before anyone signed in
2249
- usage posthog connect --project <id> --key <phx_…> [--posthog-host <h>] [--host <app host>]
2251
+ usage posthog connect --project <id> --key <phx_…> [--posthog-host <h>] [--host <app host>] [--project-is-one-app]
2252
+ usage posthog connect --project <id> --site <id> --host <app host> [--posthog-host <h>] (--project-is-one-app|--shared-project)
2250
2253
  Connect your PostHog: 90 days now, then every day
2251
2254
  usage posthog [status] | sync [--days 7] | disconnect
2252
2255
  The connection, a sync now, or remove it
@@ -260,6 +260,7 @@ export const ARGS = {
260
260
  dry_run: { flag: "dry-run", type: "bool" },
261
261
  },
262
262
  connect_posthog_usage: {
263
+ project_is_one_app: { flag: "project-is-one-app", negate: "shared-project", type: "bool" },
263
264
  known_internal_accounts: {
264
265
  value: (flags) =>
265
266
  flags["internal-accounts"]
@@ -270,7 +271,10 @@ export const ARGS = {
270
271
  // --key, or POSTHOG_PERSONAL_API_KEY so the key stays out of the shell's history.
271
272
  personal_api_key: {
272
273
  value: (flags) => {
273
- const key = typeof flags.key === "string" ? flags.key : process.env.POSTHOG_PERSONAL_API_KEY;
274
+ if (typeof flags.key === "string") return flags.key;
275
+ if (flags.site && flags.host && (flags["project-is-one-app"] || flags["shared-project"]))
276
+ return undefined;
277
+ const key = process.env.POSTHOG_PERSONAL_API_KEY;
274
278
  if (!key) throw new CliError("posthog connect needs --key (or POSTHOG_PERSONAL_API_KEY).");
275
279
  return key;
276
280
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.187",
3
+ "version": "0.177.188",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",